[jboss-svn-commits] JBL Code SVN: r14204 - in labs/jbosstm/workspace/interop: WSA-interop and 71 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Aug 14 09:05:05 EDT 2007
Author: kevin.conner at jboss.com
Date: 2007-08-14 09:05:04 -0400 (Tue, 14 Aug 2007)
New Revision: 14204
Added:
labs/jbosstm/workspace/interop/WSA-interop/
labs/jbosstm/workspace/interop/WSA-interop/build.xml
labs/jbosstm/workspace/interop/WSA-interop/lib/
labs/jbosstm/workspace/interop/WSA-interop/lib/jbossjts.jar
labs/jbosstm/workspace/interop/WSA-interop/lib/jbossts-common.jar
labs/jbosstm/workspace/interop/WSA-interop/lib/junit-3.8.1.jar
labs/jbosstm/workspace/interop/WSA-interop/lib/saxon8.jar
labs/jbosstm/workspace/interop/WSA-interop/lib/servlet.jar
labs/jbosstm/workspace/interop/WSA-interop/lib/stax-api-1.0.jar
labs/jbosstm/workspace/interop/WSA-interop/lib/ws-c.jar
labs/jbosstm/workspace/interop/WSA-interop/lib/wstx-asl-2.0.3.jar
labs/jbosstm/workspace/interop/WSA-interop/src/
labs/jbosstm/workspace/interop/WSA-interop/src/com/
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/InteropConstants.java
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/InteropTestCase.java
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/InteropTestSuite.java
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/MessageLogging.java
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/Soap11TestCase.java
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/Soap12TestCase.java
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/WSDLParser.java
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/wsaWSDL1TestService.wsdl
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/wsaWSDL2TestService.wsdl
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/TestConstants.java
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/TestLogController.java
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/TestLogServlet.java
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/TestRunner.java
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/TestServlet.java
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/directoryContents.html
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/notFoundResponse.html
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/processor.xsl
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/InteropConstants.java
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/client/
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/client/InteropClient.java
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/handlers/
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/handlers/EchoHandler.java
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/handlers/EchoResponseHandler.java
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/handlers/EchoSoapFaultHandler.java
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/handlers/EchoSynchResponseHandler.java
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/handlers/NotifyHandler.java
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/policy/
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/policy/InteropClientPolicy.java
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/policy/InteropPolicy.java
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/processors/
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/processors/EchoCallback.java
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/processors/InteropProcessor.java
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/server/
labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/server/InteropInitialisation.java
labs/jbosstm/workspace/interop/WSA-interop/web.xml
labs/jbosstm/workspace/interop/WSA-interop/web/
labs/jbosstm/workspace/interop/WSA-interop/web/details.jsp
labs/jbosstm/workspace/interop/WSA-interop/web/index.jsp
labs/jbosstm/workspace/interop/WSA-interop/web/invalidParameters.html
labs/jbosstm/workspace/interop/WSA-interop/web/results.jsp
labs/jbosstm/workspace/interop/WSTX10-interop/
labs/jbosstm/workspace/interop/WSTX10-interop/build.xml
labs/jbosstm/workspace/interop/WSTX10-interop/lib/
labs/jbosstm/workspace/interop/WSTX10-interop/lib/jbossjts.jar
labs/jbosstm/workspace/interop/WSTX10-interop/lib/jbossts-common.jar
labs/jbosstm/workspace/interop/WSTX10-interop/lib/junit-3.8.1.jar
labs/jbosstm/workspace/interop/WSTX10-interop/lib/saxon8.jar
labs/jbosstm/workspace/interop/WSTX10-interop/lib/servlet.jar
labs/jbosstm/workspace/interop/WSTX10-interop/lib/stax-api-1.0.jar
labs/jbosstm/workspace/interop/WSTX10-interop/lib/ws-c.jar
labs/jbosstm/workspace/interop/WSTX10-interop/lib/ws-t.jar
labs/jbosstm/workspace/interop/WSTX10-interop/lib/wsas.jar
labs/jbosstm/workspace/interop/WSTX10-interop/lib/wscf.jar
labs/jbosstm/workspace/interop/WSTX10-interop/lib/wstx-asl-2.0.3.jar
labs/jbosstm/workspace/interop/WSTX10-interop/lib/wstx.jar
labs/jbosstm/workspace/interop/WSTX10-interop/src/
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/ATTestCase.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/BATestCase.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/InteropTestCase.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/InteropTestSuite.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/MessageLogging.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropPreparedAfterTimeoutState.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropRetryPreparedAbortState.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropRetryPreparedCommitState.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropRetryReplayState.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/BAInteropParticipantCompletedState.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/BaseState.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/InteropWaitState.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/AddressingProxySAXHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/BaseHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/ProxyConversation.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/ProxyConversationState.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/ProxyListenerService.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/ProxyURIRewriting.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/WriterSAXHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/TestConstants.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/TestLogController.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/TestLogServlet.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/TestRunner.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/TestServlet.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/directoryContents.html
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/notFoundResponse.html
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/processor.xsl
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/InteropConstants.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ATInteropConstants.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ATInteropUtil.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/AsyncParticipantStub.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ParticipantStub.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/SyncParticipantStub.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/TestMessageType.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/AsyncParticipantClient.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/InitiatorClient.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/SyncParticipantClient.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/InitiatorResponseHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/InitiatorSoapFaultHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCommitHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCompletionCommitHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCompletionRollbackHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantEarlyAbortedHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantEarlyReadonlyHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantLostCommittedHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantPhase2RollbackHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantPreparedAfterTimeoutHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantReadonlyHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantReplayAbortHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantReplayCommitHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryCommitHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryPreparedAbortHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryPreparedCommitHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryReplayHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRollbackHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantVolatileAndDurableHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitDurable2PCParticipant.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitFailureDurable2PCParticipant.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitFailureRecoveryDurable2PCParticipant.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitVolatile2PCParticipant.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/ParticipantAdapter.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/ReadonlyDurable2PCParticipant.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/ReplayAbortDurable2PCParticipant.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/RetryReplayDurable2PCParticipant.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/RollbackDurable2PCParticipant.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/VolatileAndDurableDurable2PCParticipant.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/VolatileAndDurableVolatile2PCParticipant.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/policy/
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/policy/ATInitiatorPolicy.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/policy/ATParticipantPolicy.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATInitiatorCallback.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATInitiatorProcessor.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATParticipantProcessor.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/server/
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/server/ATInitiatorInitialisation.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/AsyncParticipantStub.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/BAInteropConstants.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/BAInteropUtil.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/ParticipantStub.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/SyncParticipantStub.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/TestMessageType.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/AsyncParticipantClient.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/InitiatorClient.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/SyncParticipantClient.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/InitiatorResponseHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/InitiatorSoapFaultHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCanceledHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantClosedHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCompensatedHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCompensationFaultHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantExitHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantFaultHandler.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CancelParticipant.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CompletedParticipant.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/ExitParticipant.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/FaultParticipant.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/FaultedCompensateParticipant.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/ParticipantCompletionParticipantAdapter.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/policy/
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/policy/BAInitiatorPolicy.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/policy/BAParticipantPolicy.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAInitiatorCallback.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAInitiatorProcessor.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAParticipantProcessor.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/server/
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/server/BAInitiatorInitialisation.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/server/
labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/server/ParticipantInitialisation.java
labs/jbosstm/workspace/interop/WSTX10-interop/src/wscf.xml
labs/jbosstm/workspace/interop/WSTX10-interop/src/wst.xml
labs/jbosstm/workspace/interop/WSTX10-interop/src/wstx.xml
labs/jbosstm/workspace/interop/WSTX10-interop/web.xml
labs/jbosstm/workspace/interop/WSTX10-interop/web/
labs/jbosstm/workspace/interop/WSTX10-interop/web/details.jsp
labs/jbosstm/workspace/interop/WSTX10-interop/web/index.jsp
labs/jbosstm/workspace/interop/WSTX10-interop/web/invalidParameters.html
labs/jbosstm/workspace/interop/WSTX10-interop/web/results.jsp
labs/jbosstm/workspace/interop/WSTX11-interop/
labs/jbosstm/workspace/interop/WSTX11-interop/build.xml
labs/jbosstm/workspace/interop/WSTX11-interop/lib/
labs/jbosstm/workspace/interop/WSTX11-interop/lib/jbossjts.jar
labs/jbosstm/workspace/interop/WSTX11-interop/lib/jbossts-common.jar
labs/jbosstm/workspace/interop/WSTX11-interop/lib/junit-3.8.1.jar
labs/jbosstm/workspace/interop/WSTX11-interop/lib/saxon8.jar
labs/jbosstm/workspace/interop/WSTX11-interop/lib/servlet.jar
labs/jbosstm/workspace/interop/WSTX11-interop/lib/stax-api-1.0.jar
labs/jbosstm/workspace/interop/WSTX11-interop/lib/ws-c.jar
labs/jbosstm/workspace/interop/WSTX11-interop/lib/ws-t.jar
labs/jbosstm/workspace/interop/WSTX11-interop/lib/wsas.jar
labs/jbosstm/workspace/interop/WSTX11-interop/lib/wscf.jar
labs/jbosstm/workspace/interop/WSTX11-interop/lib/wstx-asl-2.0.3.jar
labs/jbosstm/workspace/interop/WSTX11-interop/lib/wstx.jar
labs/jbosstm/workspace/interop/WSTX11-interop/src/
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/ATTestCase.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/BATestCase.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/InteropTestCase.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/InteropTestSuite.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/MessageLogging.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropPreparedAfterTimeoutState.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropRetryPreparedAbortState.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropRetryPreparedCommitState.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/BAInteropDroppedParticipantCompletedState.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/BAInteropParticipantCompletedState.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/BAInteropUnsolicitedCompleteState.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/BaseState.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/InteropWaitState.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/AddressingProxySAXHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/BaseHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/ProxyConversation.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/ProxyConversationState.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/ProxyListenerService.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/ProxyURIRewriting.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/WriterSAXHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/TestConstants.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/TestLogController.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/TestLogServlet.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/TestRunner.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/TestServlet.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/directoryContents.html
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/notFoundResponse.html
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/processor.xsl
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/InteropConstants.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ATInteropConstants.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ATInteropUtil.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/AsyncParticipantStub.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ParticipantStub.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/SyncParticipantStub.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/TestMessageType.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/AsyncParticipantClient.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/InitiatorClient.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/SyncParticipantClient.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/InitiatorResponseHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/InitiatorSoapFaultHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCommitHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCompletionCommitHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCompletionRollbackHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantEarlyAbortedHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantEarlyReadonlyHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantLostCommittedHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantPhase2RollbackHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantPreparedAfterTimeoutHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantReadonlyHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantReplayCommitHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryCommitHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryPreparedAbortHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryPreparedCommitHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRollbackHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantVolatileAndDurableHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitDurable2PCParticipant.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitFailureDurable2PCParticipant.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitFailureRecoveryDurable2PCParticipant.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitVolatile2PCParticipant.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/ParticipantAdapter.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/ReadonlyDurable2PCParticipant.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/RollbackDurable2PCParticipant.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/VolatileAndDurableDurable2PCParticipant.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/VolatileAndDurableVolatile2PCParticipant.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/policy/
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/policy/ATInitiatorPolicy.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/policy/ATParticipantPolicy.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATInitiatorCallback.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATInitiatorProcessor.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATParticipantProcessor.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/server/
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/server/ATInitiatorInitialisation.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/AsyncParticipantStub.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/BAInteropConstants.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/BAInteropUtil.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/ParticipantStub.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/SyncParticipantStub.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/TestMessageType.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/AsyncParticipantClient.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/InitiatorClient.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/SyncParticipantClient.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/InitiatorResponseHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/InitiatorSoapFaultHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCancelHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCannotCompleteHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCompensateHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCompensationFailHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCoordinatorCompleteCloseHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantExitHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantFailHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantMessageLossAndRecoveryHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantMixedOutcomeHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantParticipantCancelCompletedRaceHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantParticipantCompleteCloseHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantUnsolicitedCompleteHandler.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CancelParticipant.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CannotCompleteParticipant.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CompletedParticipant.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CoordinatorCompleteCloseParticipant.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CoordinatorCompletionParticipantAdapter.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/DropFirstCompensateParticipant.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/ExitParticipant.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/FailParticipant.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/FailedCompensateParticipant.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/ParticipantCompletionParticipantAdapter.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/policy/
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/policy/BAInitiatorPolicy.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/policy/BAParticipantPolicy.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAInitiatorCallback.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAInitiatorProcessor.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAParticipantProcessor.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/server/
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/server/BAInitiatorInitialisation.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/server/
labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/server/ParticipantInitialisation.java
labs/jbosstm/workspace/interop/WSTX11-interop/src/wscf.xml
labs/jbosstm/workspace/interop/WSTX11-interop/src/wst.xml
labs/jbosstm/workspace/interop/WSTX11-interop/src/wstx.xml
labs/jbosstm/workspace/interop/WSTX11-interop/web.xml
labs/jbosstm/workspace/interop/WSTX11-interop/web/
labs/jbosstm/workspace/interop/WSTX11-interop/web/details.jsp
labs/jbosstm/workspace/interop/WSTX11-interop/web/index.jsp
labs/jbosstm/workspace/interop/WSTX11-interop/web/invalidParameters.html
labs/jbosstm/workspace/interop/WSTX11-interop/web/results.jsp
Log:
Added my versions of the interop tests
Added: labs/jbosstm/workspace/interop/WSA-interop/build.xml
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/build.xml (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/build.xml 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,69 @@
+<?xml version="1.0"?>
+<project name="project" default="war">
+ <description>
+ JBoss Transactions WS-Addressing interop test
+ </description>
+
+ <property environment="env"/>
+
+ <property name="host" value="127.0.0.1"/>
+ <property name="port" value="8080"/>
+
+ <property name="jboss.deploy.dir" location="${env.HOME}/jboss-deploy"/>
+
+ <property name="build.dir" location="build"/>
+ <property name="build.classes.dir" location="${build.dir}/classes"/>
+ <property name="build.lib.dir" location="${build.dir}/lib"/>
+ <property name="build.war.file" location="${build.lib.dir}/interop.war"/>
+ <property name="build.webxml.file" location="${build.lib.dir}/web.xml"/>
+
+ <property name="src.dir" location="src"/>
+ <property name="webxml.file" location="web.xml"/>
+ <property name="lib.dir" location="lib"/>
+ <property name="web.dir" location="web"/>
+
+ <property name="dist.compile.libs" value="ws-c.jar jbossjts.jar jbossts-common.jar stax-api-1.0.jar junit-3.8.1.jar saxon8.jar"/>
+ <property name="dist.dependency.libs" value="wstx-asl-2.0.3.jar"/>
+ <property name="dist.libs" value="${dist.compile.libs} ${dist.dependency.libs}"/>
+ <property name="compile.libs" value="${dist.compile.libs} servlet.jar"/>
+ <property name="compile.debug" value="true"/>
+
+ <path id="classpath">
+ <fileset dir="${lib.dir}" includes="${compile.libs}"/>
+ </path>
+ <property name="classpath" refid="classpath"/>
+
+ <target name="init">
+ <mkdir dir="${build.dir}"/>
+ <mkdir dir="${build.classes.dir}"/>
+ <mkdir dir="${build.lib.dir}"/>
+ </target>
+
+ <target name="compile" depends="init">
+ <javac classpathref="classpath" destdir="${build.classes.dir}" srcdir="${src.dir}" debug="${compile.debug}"/>
+ </target>
+
+ <target name="war" depends="compile">
+ <copy file="${webxml.file}" tofile="${build.webxml.file}" overwrite="yes">
+ <filterset>
+ <filter token="HOST" value="${host}"/>
+ <filter token="PORT" value="${port}"/>
+ </filterset>
+ </copy>
+ <war destfile="${build.war.file}" webxml="${build.webxml.file}">
+ <classes dir="${build.classes.dir}"/>
+ <classes dir="${src.dir}" excludes="**/*.java"/>
+ <lib dir="${lib.dir}" includes="${dist.libs}"/>
+ <fileset dir="${web.dir}"/>
+ </war>
+ </target>
+
+ <target name="deploy" depends="war">
+ <copy file="${build.war.file}" todir="${jboss.deploy.dir}"/>
+ </target>
+
+ <target name="clean">
+ <delete dir="${build.dir}"/>
+ </target>
+</project>
+
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/build.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/lib/jbossjts.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/lib/jbossjts.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/lib/jbossjts.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/lib/ext/jbossjts.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/lib/jbossjts.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSA-interop/lib/jbossts-common.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/lib/jbossts-common.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/lib/jbossts-common.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/lib/ext/jbossts-common.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/lib/jbossts-common.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSA-interop/lib/junit-3.8.1.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/lib/junit-3.8.1.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/lib/junit-3.8.1.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /usr/java/junit3.8.1/junit.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/lib/junit-3.8.1.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSA-interop/lib/saxon8.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/lib/saxon8.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/lib/saxon8.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /usr/java/saxonb8/saxon8.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/lib/saxon8.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSA-interop/lib/servlet.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/lib/servlet.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/lib/servlet.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/lib/ext/servlet.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/lib/servlet.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSA-interop/lib/stax-api-1.0.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/lib/stax-api-1.0.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/lib/stax-api-1.0.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/lib/ext/stax-api-1.0.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/lib/stax-api-1.0.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSA-interop/lib/ws-c.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/lib/ws-c.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/lib/ws-c.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/lib/ws-c.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/lib/ws-c.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSA-interop/lib/wstx-asl-2.0.3.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/lib/wstx-asl-2.0.3.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/lib/wstx-asl-2.0.3.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/lib/ext/wstx-asl-2.0.3.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/lib/wstx-asl-2.0.3.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/InteropConstants.java
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/InteropConstants.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/InteropConstants.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,171 @@
+package com.jboss.transaction.interop ;
+
+import javax.xml.namespace.QName ;
+
+import com.arjuna.webservices.wsaddr2005.AddressingConstants ;
+import com.arjuna.webservices.wsaddr2005.AttributedURIType ;
+import com.arjuna.webservices.wsaddr2005.EndpointReferenceType ;
+
+/**
+ * Constants used in the interop testing.
+ *
+ * @author kevin
+ */
+public interface InteropConstants
+{
+ /**
+ * The NONE address.
+ */
+ public AttributedURIType NONE_ADDRESS = new AttributedURIType(
+ AddressingConstants.WSA_ADDRESS_NONE) ;
+
+ /**
+ * The NONE endpoint reference.
+ */
+ public EndpointReferenceType NONE_EPR = new EndpointReferenceType(
+ NONE_ADDRESS) ;
+
+ /**
+ * The ANON address.
+ */
+ public AttributedURIType ANON_ADDRESS = new AttributedURIType(
+ AddressingConstants.WSA_ADDRESS_ANONYMOUS) ;
+
+ /**
+ * The ANON endpoint reference.
+ */
+ public EndpointReferenceType ANON_EPR = new EndpointReferenceType(
+ ANON_ADDRESS) ;
+
+ /**
+ * The UNREACHABLE address.
+ */
+ public AttributedURIType UNREACHABLE_ADDRESS = new AttributedURIType(
+ "http://example.org/unreachable") ;
+
+ /**
+ * The UNREACHABLE endpoint reference.
+ */
+ public EndpointReferenceType UNREACHABLE_EPR = new EndpointReferenceType(
+ UNREACHABLE_ADDRESS) ;
+
+ /**
+ * The Namespace.
+ */
+ public String INTEROP_CUSTOMER_NAMESPACE = "http://example.org/customer" ;
+
+ /**
+ * The Attribute Namespace.
+ */
+ public String INTEROP_CUSTOMER_ATTRIBUTE_NAMESPACE = INTEROP_CUSTOMER_NAMESPACE ;
+
+ /**
+ * The namespace prefix.
+ */
+ public String INTEROP_CUSTOMER_PREFIX = "customer" ;
+
+ /**
+ * The attribute namespace prefix.
+ */
+ public String INTEROP_CUSTOMER_ATTRIBUTE_PREFIX = INTEROP_CUSTOMER_PREFIX ;
+
+ /**
+ * The metadata element.
+ */
+ public String INTEROP_ELEMENT_CUSTOMER_METADATA = "Metadata" ;
+
+ /**
+ * The metadata QNAME.
+ */
+ public QName INTEROP_ELEMENT_QNAME_CUSTOMER_METADATA = new QName(
+ INTEROP_CUSTOMER_NAMESPACE, INTEROP_ELEMENT_CUSTOMER_METADATA,
+ INTEROP_CUSTOMER_PREFIX) ;
+
+ /**
+ * The customer key element.
+ */
+ public String INTEROP_ELEMENT_CUSTOMER_KEY = "CustomerKey" ;
+
+ /**
+ * The customer key QNAME.
+ */
+ public QName INTEROP_ELEMENT_QNAME_CUSTOMER_KEY = new QName(
+ INTEROP_CUSTOMER_NAMESPACE, INTEROP_ELEMENT_CUSTOMER_KEY,
+ INTEROP_CUSTOMER_PREFIX) ;
+
+ /**
+ * The level attribute.
+ */
+ public String INTEROP_ATTRIBUTE_LEVEL = "level" ;
+
+ /**
+ * The level QName.
+ */
+ public QName INTEROP_ATTRIBUTE_QNAME_LEVEL = new QName(
+ INTEROP_CUSTOMER_ATTRIBUTE_NAMESPACE, INTEROP_ATTRIBUTE_LEVEL,
+ INTEROP_CUSTOMER_ATTRIBUTE_PREFIX) ;
+
+ /**
+ * The total attribute.
+ */
+ public String INTEROP_ATTRIBUTE_TOTAL = "total" ;
+
+ /**
+ * The total QName.
+ */
+ public QName INTEROP_ATTRIBUTE_QNAME_TOTAL = new QName(
+ INTEROP_CUSTOMER_ATTRIBUTE_NAMESPACE, INTEROP_ATTRIBUTE_TOTAL,
+ INTEROP_CUSTOMER_ATTRIBUTE_PREFIX) ;
+
+ /**
+ * The customer key reference parameter value.
+ */
+ public String INTEROP_CUSTOMER_KEY = "Key#123456789" ;
+
+ /**
+ * The fault customer key reference parameter value.
+ */
+ public String INTEROP_FAULT_CUSTOMER_KEY = "Fault#123456789" ;
+
+ /**
+ * The customer level attribute value.
+ */
+ public String INTEROP_CUSTOMER_LEVEL = "premium" ;
+
+ /**
+ * The customer total attribute value.
+ */
+ public String INTEROP_CUSTOMER_TOTAL = "1" ;
+
+ /**
+ * The Namespace.
+ */
+ public String INTEROP_ALERT_CONTROL_NAMESPACE = "http://example.org/alertcontrol" ;
+
+ /**
+ * The Attribute Namespace.
+ */
+ public String INTEROP_ALERT_CONTROL_ATTRIBUTE_NAMESPACE = INTEROP_ALERT_CONTROL_NAMESPACE ;
+
+ /**
+ * The namespace prefix.
+ */
+ public String INTEROP_ALERT_CONTROL_PREFIX = "alertcontrol" ;
+
+ /**
+ * The attribute namespace prefix.
+ */
+ public String INTEROP_ALERT_CONTROL_ATTRIBUTE_PREFIX = INTEROP_ALERT_CONTROL_PREFIX ;
+
+ /**
+ * The alertcontrol element.
+ */
+ public String INTEROP_ELEMENT_ALERT_CONTROL = "alertcontrol" ;
+
+ /**
+ * The alertcontrol QNAME.
+ */
+ public QName INTEROP_ELEMENT_QNAME_ALERT_CONTROL = new QName(
+ INTEROP_ALERT_CONTROL_NAMESPACE, INTEROP_ELEMENT_ALERT_CONTROL,
+ INTEROP_ALERT_CONTROL_PREFIX) ;
+}
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/InteropConstants.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/InteropTestCase.java
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/InteropTestCase.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/InteropTestCase.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,384 @@
+package com.jboss.transaction.interop;
+
+import java.io.IOException;
+
+import junit.framework.TestCase;
+import junit.framework.TestResult;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.SoapMessageLogging;
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.stax.TextElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wsaddr2005.EndpointReferenceType;
+import com.jboss.transaction.webservices.interop.InteropConstants;
+import com.jboss.transaction.webservices.interop.client.InteropClient;
+import com.jboss.transaction.webservices.interop.processors.EchoCallback;
+import com.jboss.transaction.webservices.interop.processors.InteropProcessor;
+
+/**
+ * Base class for interop tests.
+ * @author kevin
+ */
+public class InteropTestCase extends TestCase
+{
+ /**
+ * The log message prefix start.
+ */
+ private static final String LOG_MESSAGE_PREFIX_START = "<log:message testcase=\"" ;
+ /**
+ * The log message prefix centre.
+ */
+ private static final String LOG_MESSAGE_PREFIX_CENTRE = "\" message=\"" ;
+ /**
+ * The log message prefix end.
+ */
+ private static final String LOG_MESSAGE_PREFIX_END = "\"><log:content>" ;
+ /**
+ * The log message suffix.
+ */
+ private static final String LOG_MESSAGE_SUFFIX = "</log:content></log:message>" ;
+
+ /**
+ * The service URI of the source.
+ */
+ private static final String SOURCE_SERVICE_URI ;
+
+ /**
+ * The URI of the service.
+ */
+ private String serviceURI ;
+ /**
+ * The flag for using the test name.
+ */
+ private boolean useTestName ;
+
+ /**
+ * Construct the named test case.
+ */
+ protected InteropTestCase()
+ {
+ // Default the target service to the local service.
+ setTargetServiceURI(getSourceServiceURI()) ;
+ }
+
+ /**
+ * Set the service URI.
+ * @param serviceURI The service URI.
+ */
+ public void setTargetServiceURI(final String serviceURI)
+ {
+ this.serviceURI = serviceURI ;
+ }
+
+ /**
+ * Get the service URI.
+ * @return The service URI.
+ */
+ protected String getTargetServiceURI()
+ {
+ return serviceURI ;
+ }
+
+ /**
+ * Set the use test name flag.
+ * @param useTestName The use test name flag.
+ */
+ public void setUseTestName(final boolean useTestName)
+ {
+ this.useTestName = useTestName ;
+ }
+
+ /**
+ * Get the use test name flag.
+ * @return The use test name flag.
+ */
+ protected boolean getUseTestName()
+ {
+ return useTestName ;
+ }
+
+ /**
+ * Wraps the run method to include logging of message interactions.
+ * @param result The test result.
+ */
+ public void run(final TestResult result)
+ {
+ SoapMessageLogging.clearThreadLog() ;
+ SoapMessageLogging.setThreadLogEnabled(true) ;
+ try
+ {
+ super.run(result) ;
+ }
+ finally
+ {
+ final String[] messages = SoapMessageLogging.getThreadLog() ;
+ if (messages != null)
+ {
+ final int numMessages = messages.length ;
+ final StringBuffer buffer = new StringBuffer() ;
+ int count = 0 ;
+ while(count < numMessages)
+ {
+ final String message = messages[count] ;
+ count++ ;
+ if (message != null)
+ {
+ buffer.append(LOG_MESSAGE_PREFIX_START) ;
+ buffer.append(getName()) ;
+ buffer.append(LOG_MESSAGE_PREFIX_CENTRE) ;
+ buffer.append(count) ;
+ buffer.append(LOG_MESSAGE_PREFIX_END) ;
+ buffer.append(message) ;
+ buffer.append(LOG_MESSAGE_SUFFIX) ;
+ }
+ }
+ MessageLogging.appendThreadLog(buffer.toString()) ;
+ }
+ SoapMessageLogging.clearThreadLog() ;
+ SoapMessageLogging.setThreadLogEnabled(false) ;
+ }
+ }
+
+ /**
+ * Send a notify message.
+ * @param notifyURI The URI of the asynch notify endpoint.
+ * @param messageID The messageID to use.
+ * @param soapDetails The SOAP details.
+ * @param replyTo The reply to endpoint reference
+ * @param faultTo The fault to endpoint reference
+ * @param notifyMessage The notify message.
+ * @throws SoapFault for errors during processing.
+ */
+ public void notify(final String notifyURI, final String messageID, final SoapDetails soapDetails,
+ final EndpointReferenceType replyTo, final EndpointReferenceType faultTo, final String notifyMessage)
+ throws SoapFault
+ {
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(notifyURI, messageID) ;
+ initialiseAddressingContext(addressingContext, replyTo, faultTo, null) ;
+ try
+ {
+ InteropClient.getClient().sendNotify(addressingContext, soapDetails, notifyMessage) ;
+ }
+ catch (final IOException ioe)
+ {
+ throw new SoapFault(ioe) ;
+ }
+ }
+
+ /**
+ * Send an echo message.
+ * @param echoURI The URI of the asynch echo endpoint.
+ * @param messageID The messageID to use.
+ * @param soapDetails The soap details.
+ * @param action If true, include the SOAP and wsa action.
+ * @param replyTo The reply to endpoint reference
+ * @param faultTo The fault to endpoint reference
+ * @param duplicateHeader Any duplicate header.
+ * @param echoMessage The echo message.
+ * @return The echo response.
+ * @throws SoapFault for errors during processing.
+ */
+ public String echo(final String echoURI, final String messageID, final SoapDetails soapDetails,
+ final boolean action, final EndpointReferenceType replyTo, final EndpointReferenceType faultTo,
+ final NamedElement duplicateHeader, final String echoMessage)
+ throws SoapFault
+ {
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(echoURI, messageID) ;
+ initialiseAddressingContext(addressingContext, replyTo, faultTo, duplicateHeader) ;
+
+ try
+ {
+ return InteropClient.getClient().sendEcho(addressingContext, soapDetails, action, echoMessage) ;
+ }
+ catch (final IOException ioe)
+ {
+ throw new SoapFault(ioe) ;
+ }
+ }
+
+ /**
+ * Send an asynchronous echo message.
+ * @param echoURI The URI of the asynch echo endpoint.
+ * @param messageID The messageID to use.
+ * @param soapDetails The soap details.
+ * @param action If true, include the SOAP and wsa action.
+ * @param replyTo The reply to endpoint reference
+ * @param faultTo The fault to endpoint reference
+ * @param duplicateHeader Any duplicate header.
+ * @param echoMessage The echo message.
+ * @return The echo response.
+ * @throws SoapFault for errors during processing.
+ */
+ public String asyncEcho(final String echoURI, final String messageID, final SoapDetails soapDetails,
+ final boolean action, final EndpointReferenceType replyTo, final EndpointReferenceType faultTo,
+ final NamedElement duplicateHeader, final String echoMessage)
+ throws SoapFault
+ {
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(echoURI, messageID) ;
+ initialiseAddressingContext(addressingContext, replyTo, faultTo, duplicateHeader) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final InteropProcessor interop = InteropProcessor.getInterop() ;
+ interop.registerCallback(messageID, callback) ;
+ try
+ {
+ InteropClient.getClient().sendEchoRequest(addressingContext, soapDetails, action, echoMessage) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ catch (final IOException ioe)
+ {
+ throw new SoapFault(ioe) ;
+ }
+ finally
+ {
+ interop.removeCallback(messageID) ;
+ }
+
+ final String[] logs = callback.getLogs() ;
+ final int numLogs = (logs == null ? 0 : logs.length) ;
+ for(int count = 0 ; count < numLogs ; count++)
+ {
+ SoapMessageLogging.appendThreadLog(logs[count]) ;
+ }
+
+ if (callback.hasFailed())
+ {
+ throw new SoapFault(SoapFaultType.FAULT_RECEIVER, null, "Callback execution failed") ;
+ }
+ else if (!callback.hasTriggered())
+ {
+ throw new SoapFault(SoapFaultType.FAULT_RECEIVER, null, "Callback wasn't triggered") ;
+ }
+
+ final TextElement response = callback.getEchoResponse() ;
+ if (response != null)
+ {
+ return response.getText() ;
+ }
+ throw callback.getSoapFault() ;
+ }
+
+ /**
+ * Initialise the addressing context with extra information.
+ * @param addressingContext The addressing context.
+ * @param replyTo The reply to EPR.
+ * @param faultTo The fault to EPR.
+ * @param duplicateHeader The duplicate header.
+ */
+ private static void initialiseAddressingContext(final AddressingContext addressingContext,
+ final EndpointReferenceType replyTo, final EndpointReferenceType faultTo,
+ final NamedElement duplicateHeader)
+ {
+ if (replyTo != null)
+ {
+ addressingContext.setReplyTo(replyTo) ;
+ }
+ if (faultTo != null)
+ {
+ addressingContext.setFaultTo(faultTo) ;
+ }
+ if (duplicateHeader != null)
+ {
+ addressingContext.putAnyContent(duplicateHeader) ;
+ }
+ }
+
+ /**
+ * Return the string represenation of this test.
+ * @return the string representation.
+ */
+ public String toString()
+ {
+ return getName() ;
+ }
+
+ /**
+ * Get the source service URI.
+ * @return The source service uri.
+ */
+ protected static String getSourceServiceURI()
+ {
+ return SOURCE_SERVICE_URI ;
+ }
+
+ static
+ {
+ final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+ SOURCE_SERVICE_URI = soapRegistry.getServiceURI(InteropConstants.SERVICE_INTEROP_TEST) ;
+ }
+
+ /**
+ * The request callback.
+ * @author kevin
+ */
+ private static final class RequestCallback extends EchoCallback
+ {
+ /**
+ * The echo response.
+ */
+ private TextElement echoResponse ;
+ /**
+ * The SOAP fault.
+ */
+ private SoapFault soapFault ;
+ /**
+ * The SOAP logs.
+ */
+ private String[] logs ;
+
+ /**
+ * An echo response.
+ * @param echoResponse The echo response.
+ * @param addressingContext The current addressing context.
+ */
+ public void echoResponse(final TextElement echoResponse,
+ final AddressingContext addressingContext, final String[] logs)
+ {
+ this.echoResponse = echoResponse ;
+ this.logs = logs ;
+ }
+
+ /**
+ * 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,
+ final String[] logs)
+ {
+ this.soapFault = soapFault ;
+ this.logs = logs ;
+ }
+
+ /**
+ * Get the echo response.
+ * @return The echo response.
+ */
+ TextElement getEchoResponse()
+ {
+ return echoResponse ;
+ }
+
+ /**
+ * Get the SOAP fault.
+ * @return The SOAP fault or null.
+ */
+ SoapFault getSoapFault()
+ {
+ return soapFault ;
+ }
+
+ /**
+ * Get the logs.
+ * @return The logs.
+ */
+ String[] getLogs()
+ {
+ return logs ;
+ }
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/InteropTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/InteropTestSuite.java
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/InteropTestSuite.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/InteropTestSuite.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,102 @@
+package com.jboss.transaction.interop;
+
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Interop testsuite to initialise the service uri on addition.
+ * @author kevin
+ */
+public class InteropTestSuite extends TestSuite
+{
+ /**
+ * The service URI for this test.
+ */
+ private final String serviceURI ;
+ /**
+ * The flag for using the test name.
+ */
+ private final boolean useTestName ;
+
+ /**
+ * Construct an empty test suite with the specified service URI.
+ * @param serviceURI The service URI.
+ * @param useTestName true if the test should use the test name, false otherwise.
+ */
+ public InteropTestSuite(final String serviceURI, final boolean useTestName)
+ {
+ super() ;
+ this.serviceURI = serviceURI ;
+ this.useTestName = useTestName ;
+ }
+
+ /**
+ * Construct an empty test suite with the specified service URI and name.
+ * @param serviceURI The service URI.
+ * @param useTestName true if the test should use the test name, false otherwise.
+ * @param name The name of the test suite.
+ */
+ public InteropTestSuite(final String serviceURI, final boolean useTestName, final String name)
+ {
+ super(name) ;
+ this.serviceURI = serviceURI ;
+ this.useTestName = useTestName ;
+ }
+
+ /**
+ * Constructs a TestSuite from the given class using the specified service URI.
+ * @param serviceURI The service URI.
+ * @param useTestName true if the test should use the test name, false otherwise.
+ * @param clazz The class containing the tests.
+ */
+ public InteropTestSuite(final String serviceURI, final boolean useTestName, final Class clazz)
+ {
+ super(clazz) ;
+ this.serviceURI = serviceURI ;
+ this.useTestName = useTestName ;
+ final int numTests = countTestCases() ;
+ for(int count = 0 ; count < numTests ; count++)
+ {
+ initialiseTest(testAt(count)) ;
+ }
+ }
+
+ /**
+ * Constructs a TestSuite from the given class using the specified service URI and name.
+ * @param serviceURI The service URI.
+ * @param useTestName true if the test should use the test name, false otherwise.
+ * @param clazz The class containing the tests.
+ * @param name The name of the test suite.
+ */
+ public InteropTestSuite(final String serviceURI, final boolean useTestName, final Class clazz, final String name)
+ {
+ super(clazz, name) ;
+ this.serviceURI = serviceURI ;
+ this.useTestName = useTestName ;
+ }
+
+ /**
+ * Add a test to the test suite.
+ * @param test The test to add.
+ */
+ public void addTest(final Test test)
+ {
+ initialiseTest(test) ;
+ super.addTest(test) ;
+ }
+
+ /**
+ * Perform initialisation on the test.
+ * @param test The test to initialise.
+ */
+ private void initialiseTest(final Test test)
+ {
+ if (test instanceof InteropTestCase)
+ {
+ final InteropTestCase interopTestCase = (InteropTestCase)test ;
+ interopTestCase.setTargetServiceURI(serviceURI) ;
+ interopTestCase.setUseTestName(useTestName) ;
+ }
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/InteropTestSuite.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/MessageLogging.java
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/MessageLogging.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/MessageLogging.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,51 @@
+package com.jboss.transaction.interop;
+
+/**
+ * Class providing test message logging.
+ * @author kevin
+ */
+public class MessageLogging
+{
+ /**
+ * The thread local message log.
+ */
+ private static final ThreadLocal MESSAGE_LOG = new ThreadLocal() ;
+
+ /**
+ * 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() ;
+ return (value == null ? "" : value.toString()) ;
+ }
+
+ /**
+ * 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 StringBuffer buffer ;
+ if (value == null)
+ {
+ buffer = new StringBuffer(message) ;
+ MESSAGE_LOG.set(buffer) ;
+ }
+ else
+ {
+ buffer = (StringBuffer)value ;
+ buffer.append(message) ;
+ }
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/MessageLogging.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/Soap11TestCase.java
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/Soap11TestCase.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/Soap11TestCase.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,465 @@
+package com.jboss.transaction.interop;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.Soap11Details;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.stax.TextElement;
+import com.arjuna.webservices.wsaddr2005.AddressingConstants;
+import com.arjuna.webservices.wsaddr2005.AttributedURIType;
+import com.arjuna.webservices.wsaddr2005.EndpointReferenceType;
+import com.arjuna.webservices.wsaddr2005.MetadataType;
+import com.arjuna.wsc.messaging.MessageId;
+
+/**
+ * The SOAP 1.1 endpoint test case
+ * @author kevin
+ */
+public class Soap11TestCase extends InteropTestCase
+{
+ /**
+ * The SOAP detail for the test.
+ */
+ private final SoapDetails soapDetails = new Soap11Details() ;
+
+ /**
+ * test1100 - SOAP 1.1 one-way message
+ * One-way message containing an Action header. Everything else is defaulted.
+ * @throws Exception on failure.
+ */
+ public void test1100()
+ throws Exception
+ {
+ notify(false, (getUseTestName() ? "test1100" : "notify message")) ;
+ }
+
+ /**
+ * test1101 - SOAP 1.1 one-way defaulted with a MessageID value
+ * One-way message containing a MessageID. ReplyTo and FaultTo are defaulted.
+ * @throws Exception on failure.
+ */
+ public void test1101()
+ throws Exception
+ {
+ notify(true, (getUseTestName() ? "test1101" : "notify message")) ;
+ }
+
+ /**
+ * test1102 - SOAP 1.1 one-way message with a ReplyTo address of none
+ * One-way message containing a ReplyTo address value of none.
+ * @throws Exception on failure.
+ */
+ public void test1102()
+ throws Exception
+ {
+ notify(InteropConstants.NONE_EPR, null, (getUseTestName() ? "test1102" : "notify message")) ;
+ }
+
+ /**
+ * test1103 - SOAP 1.1 one-way message with a FaultTo address of none
+ * One-way message containing a FaultTo address value of none.
+ * @throws Exception on failure.
+ */
+ public void test1103()
+ throws Exception
+ {
+ notify(null, InteropConstants.NONE_EPR, (getUseTestName() ? "test1103" : "notify message")) ;
+ }
+
+ /**
+ * test1104 - SOAP 1.1 one-way message with a ReplyTo and FaultTo address of none
+ * One-way message containing none ReplyTo and FaultTo address values.
+ * @throws Exception on failure.
+ */
+ public void test1104()
+ throws Exception
+ {
+ notify(InteropConstants.NONE_EPR, InteropConstants.NONE_EPR, (getUseTestName() ? "test1104" : "notify message")) ;
+ }
+
+ /**
+ * test1106 - SOAP 1.1 one-way message with ReplyTo containing a Reference Parameter
+ * One-way message containing none ReplyTo address with Reference Parameter.
+ * @throws Exception on failure.
+ */
+ public void test1106()
+ throws Exception
+ {
+ final EndpointReferenceType epr = new EndpointReferenceType(InteropConstants.NONE_ADDRESS) ;
+ final NamedElement customerReferenceParameter = new NamedElement(InteropConstants.INTEROP_ELEMENT_QNAME_CUSTOMER_KEY, new TextElement(InteropConstants.INTEROP_CUSTOMER_KEY)) ;
+ epr.addReferenceParameter(customerReferenceParameter) ;
+ notify(epr, null, (getUseTestName() ? "test1106" : "notify message")) ;
+ }
+
+ /**
+ * test1107 - SOAP 1.1 one-way message with ReplyTo containing WSDL Metadata
+ * One-way message containing none ReplyTo address with a WSDL 1.1 and WSDL 2.0 documents appearing in the Metadata.
+ * @throws Exception on failure.
+ */
+ public void test1107()
+ throws Exception
+ {
+ final EndpointReferenceType epr = new EndpointReferenceType(InteropConstants.NONE_ADDRESS) ;
+
+ epr.addMetadata(WSDLParser.getWSDL1()) ;
+ epr.addMetadata(WSDLParser.getWSDL2()) ;
+
+ notify(epr, null, (getUseTestName() ? "test1107" : "notify message")) ;
+ }
+
+ /**
+ * test1108 - SOAP 1.1 one-way message with ReplyTo containing EPR extensions
+ * One-way message containing a ReplyTo address with an element extension and an attribute extension of the ReferenceParameters and Metadata elements.
+ * @throws Exception on failure.
+ */
+ public void test1108()
+ throws Exception
+ {
+ final EndpointReferenceType epr = new EndpointReferenceType(InteropConstants.NONE_ADDRESS) ;
+ final NamedElement customerReferenceParameter = new NamedElement(InteropConstants.INTEROP_ELEMENT_QNAME_CUSTOMER_KEY, new TextElement(InteropConstants.INTEROP_CUSTOMER_KEY)) ;
+ epr.addReferenceParameter(customerReferenceParameter) ;
+
+ final MetadataType metadata = new MetadataType() ;
+ metadata.putAttribute(InteropConstants.INTEROP_ATTRIBUTE_QNAME_TOTAL, InteropConstants.INTEROP_CUSTOMER_TOTAL) ;
+ epr.setMetadata(metadata) ;
+
+ epr.putAnyContent(new NamedElement(InteropConstants.INTEROP_ELEMENT_QNAME_CUSTOMER_METADATA, new TextElement("Customer metadata to be ignored"))) ;
+
+ epr.getReferenceParameters().putAttribute(InteropConstants.INTEROP_ATTRIBUTE_QNAME_LEVEL, InteropConstants.INTEROP_CUSTOMER_LEVEL) ;
+
+ notify(epr, null, (getUseTestName() ? "test1108" : "notify message")) ;
+ }
+
+ /**
+ * test1130 - SOAP 1.1 two-way message.
+ * Two-way message exchange containing an Action. All other fields are defaulted. The presence of a MessageID in the
+ * first message and of the corresponding RelatesTo in the second message is tested.
+ * @throws Exception on failure.
+ */
+ public void test1130()
+ throws Exception
+ {
+ echo(null, null, null, (getUseTestName() ? "test1130" : "echo message")) ;
+ }
+
+ /**
+ * test1131 - SOAP 1.1 two-way message with ReplyTo address of anonymous.
+ * Two-way message exchange containing an Action, MessageID and a ReplyTo of anonymous. All other fields are defaulted.
+ * @throws Exception on failure.
+ */
+ public void test1131()
+ throws Exception
+ {
+ echo(InteropConstants.ANON_EPR, null, null, (getUseTestName() ? "test1131" : "echo message")) ;
+ }
+
+ /**
+ * test1132 - SOAP 1.1 two-way message with ReplyTo address containing Reference Parameters.
+ * Two-way message exchange containing an Action and a ReplyTo with the address set to anonymous.
+ * The ReplyTo contains at least one Reference Parameter value. The reply message is returned on
+ * the HTTP response with the Reference Parameter value as a first class SOAP header.
+ * @throws Exception on failure.
+ */
+ public void test1132()
+ throws Exception
+ {
+ final EndpointReferenceType epr = new EndpointReferenceType(InteropConstants.ANON_ADDRESS) ;
+ final NamedElement customerReferenceParameter = new NamedElement(InteropConstants.INTEROP_ELEMENT_QNAME_CUSTOMER_KEY, new TextElement(InteropConstants.INTEROP_CUSTOMER_KEY)) ;
+ epr.addReferenceParameter(customerReferenceParameter) ;
+ echo(epr, null, null, (getUseTestName() ? "test1132" : "echo message")) ;
+ }
+
+ /**
+ * test1133 - SOAP 1.1 two-way message with fault. ReplyTo and FaultTo addresses containing Reference Parameters.
+ * Two-way message exchange containing an Action. The ReplyTo and FaultTo addresses are both anonymous.
+ * The ReplyTo and FaultTo contain at least one Reference Parameter value which are different.
+ * A fault message is returned on the HTTP response with the FaultTo Reference Parameter value as a first class SOAP header.
+ * @throws Exception on failure.
+ */
+ public void test1133()
+ throws Exception
+ {
+ final EndpointReferenceType replyTo = new EndpointReferenceType(InteropConstants.ANON_ADDRESS) ;
+ final NamedElement replyCustomerReferenceParameter = new NamedElement(InteropConstants.INTEROP_ELEMENT_QNAME_CUSTOMER_KEY, new TextElement(InteropConstants.INTEROP_CUSTOMER_KEY)) ;
+ replyTo.addReferenceParameter(replyCustomerReferenceParameter) ;
+ final EndpointReferenceType faultTo = new EndpointReferenceType(InteropConstants.ANON_ADDRESS) ;
+ final NamedElement faultCustomerReferenceParameter = new NamedElement(InteropConstants.INTEROP_ELEMENT_QNAME_CUSTOMER_KEY, new TextElement(InteropConstants.INTEROP_FAULT_CUSTOMER_KEY)) ;
+ faultTo.addReferenceParameter(faultCustomerReferenceParameter) ;
+ try
+ {
+ echo(replyTo, faultTo, null, (getUseTestName() ? "faultTest1133" : "")) ;
+ fail("Expected EmptyString SoapFault") ;
+ }
+ catch (final SoapFault soapFault)
+ {
+ }
+ }
+
+ /**
+ * test1134 - SOAP 1.1 two-way message with fault. FaultTo is defaulted, ReplyTo address contains Reference Parameters.
+ * Two-way message exchange containing an Action and a ReplyTo address, but no FaultTo EPR. The ReplyTo address is anonymous.
+ * The ReplyTo contains at least one Reference Parameter value. A fault message is returned on the HTTP response with the
+ * ReplyTo Reference Parameter value as a first class SOAP header.
+ * @throws Exception on failure.
+ */
+ public void test1134()
+ throws Exception
+ {
+ final EndpointReferenceType replyTo = new EndpointReferenceType(InteropConstants.ANON_ADDRESS) ;
+ final NamedElement replyCustomerReferenceParameter = new NamedElement(InteropConstants.INTEROP_ELEMENT_QNAME_CUSTOMER_KEY, new TextElement(InteropConstants.INTEROP_CUSTOMER_KEY)) ;
+ replyTo.addReferenceParameter(replyCustomerReferenceParameter) ;
+ try
+ {
+ echo(replyTo, null, null, (getUseTestName() ? "faultTest1134" : "")) ;
+ fail("Expected EmptyString SoapFault") ;
+ }
+ catch (final SoapFault soapFault)
+ {
+ }
+ }
+
+ /**
+ * test1140 - SOAP 1.1 two-way message with a duplicate To header.
+ * Two-way message exchange containing a duplicate To header.
+ * @throws Exception on failure.
+ */
+ public void test1140()
+ throws Exception
+ {
+ final NamedElement to = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_TO, InteropConstants.ANON_ADDRESS) ;
+ try
+ {
+ echo(null, null, to, (getUseTestName() ? "test1140" : "echo message")) ;
+ fail("Expected SoapFault") ;
+ }
+ catch (final SoapFault soapFault)
+ {
+ }
+ }
+
+ /**
+ * test1141 - SOAP 1.1 two-way message with a duplicate Reply-To header.
+ * Two-way message exchange containing a duplicate Reply-To header.
+ * @throws Exception on failure.
+ */
+ public void test1141()
+ throws Exception
+ {
+ final NamedElement replyTo = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_REPLY_TO, InteropConstants.ANON_EPR) ;
+ try
+ {
+ echo(InteropConstants.ANON_EPR, null, replyTo, (getUseTestName() ? "test1141" : "echo message")) ;
+ fail("Expected SoapFault") ;
+ }
+ catch (final SoapFault soapFault)
+ {
+ }
+ }
+
+ /**
+ * test1142 - SOAP 1.1 two-way message with a duplicate Fault-To header.
+ * Two-way message exchange containing a duplicate Fault-To header.
+ * @throws Exception on failure.
+ */
+ public void test1142()
+ throws Exception
+ {
+ final NamedElement faultTo = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_FAULT_TO, InteropConstants.ANON_EPR) ;
+ try
+ {
+ echo(null, InteropConstants.ANON_EPR, faultTo, (getUseTestName() ? "test1142" : "echo message")) ;
+ fail("Expected SoapFault") ;
+ }
+ catch (final SoapFault soapFault)
+ {
+ }
+ }
+
+ /**
+ * test1143 - SOAP 1.1 two-way message with a duplicate action header.
+ * Two-way message exchange containing a duplicate action header.
+ * @throws Exception on failure.
+ */
+ public void test1143()
+ throws Exception
+ {
+ final NamedElement action = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_ACTION, new AttributedURIType("action:duplicateAction")) ;
+ try
+ {
+ echo(null, null, action, (getUseTestName() ? "test1143" : "echo message")) ;
+ fail("Expected SoapFault") ;
+ }
+ catch (final SoapFault soapFault)
+ {
+ }
+ }
+
+ /**
+ * test1144 - SOAP 1.1 two-way message with a duplicate message ID header.
+ * Two-way message exchange containing a duplicate message ID header.
+ * @throws Exception on failure.
+ */
+ public void test1144()
+ throws Exception
+ {
+ final NamedElement messageID = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_MESSAGE_ID, new AttributedURIType("auid:duplicateMessageID")) ;
+ try
+ {
+ echo(null, null, messageID, (getUseTestName() ? "test1144" : "echo message")) ;
+ fail("Expected SoapFault") ;
+ }
+ catch (final SoapFault soapFault)
+ {
+ }
+ }
+
+ /**
+ * test1146 - SOAP 1.1 two-way message with a duplicate To header.
+ * @throws Exception on failure.
+ */
+ public void test1146()
+ throws Exception
+ {
+ final NamedElement to = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_TO, InteropConstants.ANON_ADDRESS) ;
+ try
+ {
+ echo(null, null, to, (getUseTestName() ? "test1146" : "echo message")) ;
+ fail("Expected SoapFault") ;
+ }
+ catch (final SoapFault soapFault)
+ {
+ }
+ }
+
+ /**
+ * test1147 - SOAP 1.1 two-way message with no action header.
+ * Two-way message exchange containing no action header.
+ * @throws Exception on failure.
+ */
+ public void test1147()
+ throws Exception
+ {
+ try
+ {
+ echo(getTargetServiceURI(), MessageId.getMessageId(), soapDetails, false, null, null, null, (getUseTestName() ? "test1147" : "echo message")) ;
+ fail("Expected SoapFault") ;
+ }
+ catch (final SoapFault soapFault)
+ {
+ }
+ }
+
+ /**
+ * test1149 - SOAP 1.1 two-way message with a duplicate To header and a ReplyTo of none.
+ * Two-way message exchange containing a duplicate To header and ReplyTo of none. An InvalidAddressingHeader
+ * fault should be generated, but not sent due to the ReplyTo header.
+ * @throws Exception on failure.
+ */
+ public void test1149()
+ throws Exception
+ {
+ final NamedElement to = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_TO, InteropConstants.ANON_ADDRESS) ;
+ try
+ {
+ asynchEcho(InteropConstants.NONE_EPR, null, to, (getUseTestName() ? "test1145" : "echo message")) ;
+ fail("Expected SoapFault") ;
+ }
+ catch (final SoapFault soapFault)
+ {
+ }
+ }
+
+ /**
+ * test1150 - SOAP 1.1 two-way message with a non-anonymous ReplyTo address.
+ * Two-way message exchange containing an Action and a ReplyTo identifying an endpoint. All other fields are defaulted.
+ * @throws Exception on failure.
+ */
+ public void test1150()
+ throws Exception
+ {
+ final EndpointReferenceType epr = new EndpointReferenceType(new AttributedURIType(getSourceServiceURI())) ;
+ asynchEcho(epr, null, null, (getUseTestName() ? "test1150" : "echo message")) ;
+ }
+
+ /**
+ * test1152 - SOAP 1.1 two-way message with a non-anonymous ReplyTo address and a FaultTo targeted to none.
+ * Two-way message exchange containing an Action, a ReplyTo identifying an endpoint, and a FaultTo targeted
+ * to none. All other fields are defaulted.
+ * @throws Exception on failure.
+ */
+ public void test1152()
+ throws Exception
+ {
+ final EndpointReferenceType epr = new EndpointReferenceType(new AttributedURIType(getSourceServiceURI())) ;
+ final String result = echo(epr, InteropConstants.NONE_EPR, null, (getUseTestName() ? "faultTest1152" : "")) ;
+ assertNull(result) ;
+ }
+
+ /**
+ * test1170 - SOAP 1.1 two-way message with wsa:From.
+ * Two-way message exchange containing an Action and a From marked with mustUnderstand. All other
+ * fields are defaulted. It is checked that the receiver understands the message.
+ * @throws Exception on failure.
+ */
+ public void test1170()
+ throws Exception
+ {
+ final EndpointReferenceType epr = new EndpointReferenceType(new AttributedURIType(getSourceServiceURI())) ;
+ epr.putAttribute(soapDetails.getMustUnderstandQName(), "1") ;
+ final NamedElement from = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_FROM, epr) ;
+ echo(null, null, from, (getUseTestName() ? "test1170" : "echo message")) ;
+ }
+
+ /**
+ * Make a synchronous call to the echo service.
+ * @param replyTo The reply to endpoint reference or bull.
+ * @param faultTo The fault to endpoint reference or null.
+ * @param duplicateHeader A dusplicate header or null.
+ * @param message The echo message.
+ * @throws Exception For errors during processing.
+ */
+ private String echo(final EndpointReferenceType replyTo, final EndpointReferenceType faultTo, final NamedElement duplicateHeader, final String message)
+ throws Exception
+ {
+ return echo(getTargetServiceURI(), MessageId.getMessageId(), soapDetails, true, replyTo, faultTo, duplicateHeader, message) ;
+ }
+
+ /**
+ * Make an asynchronous call to the echo service.
+ * @param replyTo The reply to endpoint reference or null.
+ * @param faultTo The fault to endpoint reference or null.
+ * @param duplicateHeader A dusplicate header or null.
+ * @param message The echo message.
+ * @throws Exception For errors during processing.
+ */
+ private String asynchEcho(final EndpointReferenceType replyTo, final EndpointReferenceType faultTo, final NamedElement duplicateHeader, final String message)
+ throws Exception
+ {
+ return asyncEcho(getTargetServiceURI(), MessageId.getMessageId(), soapDetails, true, replyTo, faultTo, duplicateHeader, message) ;
+ }
+
+ /**
+ * Call the notify service.
+ * @param addMessageId true if a message id is to be added, false otherwise.
+ * @param message The notify message,
+ * @throws Exception For errors during processing.
+ */
+ private void notify(final boolean addMessageId, final String message)
+ throws Exception
+ {
+ notify(getTargetServiceURI(), (addMessageId ? MessageId.getMessageId() : null), soapDetails, null, null, message) ;
+ }
+
+ /**
+ * Call the notify service.
+ * @param replyTo The reply to endpoint reference or null.
+ * @param faultTo The fault to endpoint reference or null.
+ * @param message The notify message,
+ * @throws Exception For errors during processing.
+ */
+ private void notify(final EndpointReferenceType replyTo, final EndpointReferenceType faultTo, final String message)
+ throws Exception
+ {
+ notify(getTargetServiceURI(), MessageId.getMessageId(), soapDetails, replyTo, faultTo, message) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/Soap11TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/Soap12TestCase.java
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/Soap12TestCase.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/Soap12TestCase.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,597 @@
+package com.jboss.transaction.interop;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.Soap12Details;
+import com.arjuna.webservices.stax.AnyElement;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.stax.TextElement;
+import com.arjuna.webservices.wsaddr2005.AddressingConstants;
+import com.arjuna.webservices.wsaddr2005.AttributedURIType;
+import com.arjuna.webservices.wsaddr2005.EndpointReferenceType;
+import com.arjuna.webservices.wsaddr2005.MetadataType;
+import com.arjuna.wsc.messaging.MessageId;
+
+/**
+ * The SOAP 1.2 endpoint test case
+ * @author kevin
+ */
+public class Soap12TestCase extends InteropTestCase
+{
+ /**
+ * The SOAP detail for the test.
+ */
+ private final Soap12Details soapDetails = new Soap12Details() ;
+
+ /**
+ * test1200 - SOAP 1.2 one-way message
+ * One-way message containing an Action header. Everything else is defaulted.
+ * @throws Exception on failure.
+ */
+ public void test1200()
+ throws Exception
+ {
+ notify(false, (getUseTestName() ? "test1200" : "notify message")) ;
+ }
+
+ /**
+ * test1201 - SOAP 1.2 one-way defaulted with a MessageID value
+ * One-way message containing a MessageID. ReplyTo and FaultTo are defaulted.
+ * @throws Exception on failure.
+ */
+ public void test1201()
+ throws Exception
+ {
+ notify(true, (getUseTestName() ? "test1201" : "notify message")) ;
+ }
+
+ /**
+ * test1202 - SOAP 1.2 one-way message with a ReplyTo address of none
+ * One-way message containing a ReplyTo address value of none.
+ * @throws Exception on failure.
+ */
+ public void test1202()
+ throws Exception
+ {
+ notify(InteropConstants.NONE_EPR, null, (getUseTestName() ? "test1202" : "notify message")) ;
+ }
+
+ /**
+ * test1203 - SOAP 1.2 one-way message with a FaultTo address of none
+ * One-way message containing a FaultTo address value of none.
+ * @throws Exception on failure.
+ */
+ public void test1203()
+ throws Exception
+ {
+ notify(null, InteropConstants.NONE_EPR, (getUseTestName() ? "test1203" : "notify message")) ;
+ }
+
+ /**
+ * test1204 - SOAP 1.2 one-way message with a ReplyTo and FaultTo address of none
+ * One-way message containing none ReplyTo and FaultTo address values.
+ * @throws Exception on failure.
+ */
+ public void test1204()
+ throws Exception
+ {
+ notify(InteropConstants.NONE_EPR, InteropConstants.NONE_EPR, (getUseTestName() ? "test1204" : "notify message")) ;
+ }
+
+ /**
+ * test1206 - SOAP 1.2 one-way message with ReplyTo containing a Reference Parameter
+ * One-way message containing none ReplyTo address with Reference Parameter.
+ * @throws Exception on failure.
+ */
+ public void test1206()
+ throws Exception
+ {
+ final EndpointReferenceType epr = new EndpointReferenceType(InteropConstants.NONE_ADDRESS) ;
+ final NamedElement customerReferenceParameter = new NamedElement(InteropConstants.INTEROP_ELEMENT_QNAME_CUSTOMER_KEY, new TextElement(InteropConstants.INTEROP_CUSTOMER_KEY)) ;
+ epr.addReferenceParameter(customerReferenceParameter) ;
+ notify(epr, null, (getUseTestName() ? "test1206" : "notify message")) ;
+ }
+
+ /**
+ * test1207 - SOAP 1.2 one-way message with ReplyTo containing WSDL Metadata
+ * One-way message containing none ReplyTo address with a WSDL 1.1 and WSDL 2.0 documents appearing in the Metadata.
+ * @throws Exception on failure.
+ */
+ public void test1207()
+ throws Exception
+ {
+ final EndpointReferenceType epr = new EndpointReferenceType(InteropConstants.NONE_ADDRESS) ;
+
+ epr.addMetadata(WSDLParser.getWSDL1()) ;
+ epr.addMetadata(WSDLParser.getWSDL2()) ;
+
+ notify(epr, null, (getUseTestName() ? "test1207" : "notify message")) ;
+ }
+
+ /**
+ * test1208 - SOAP 1.2 one-way message with ReplyTo containing EPR extensions
+ * One-way message containing a ReplyTo address with an element extension and an attribute extension of the ReferenceParameters and Metadata elements.
+ * @throws Exception on failure.
+ */
+ public void test1208()
+ throws Exception
+ {
+ final EndpointReferenceType epr = new EndpointReferenceType(InteropConstants.NONE_ADDRESS) ;
+ final NamedElement customerReferenceParameter = new NamedElement(InteropConstants.INTEROP_ELEMENT_QNAME_CUSTOMER_KEY, new TextElement(InteropConstants.INTEROP_CUSTOMER_KEY)) ;
+ epr.addReferenceParameter(customerReferenceParameter) ;
+
+ final MetadataType metadata = new MetadataType() ;
+ metadata.putAttribute(InteropConstants.INTEROP_ATTRIBUTE_QNAME_TOTAL, InteropConstants.INTEROP_CUSTOMER_TOTAL) ;
+ epr.setMetadata(metadata) ;
+
+ epr.putAnyContent(new NamedElement(InteropConstants.INTEROP_ELEMENT_QNAME_CUSTOMER_METADATA, new TextElement("Customer metadata to be ignored"))) ;
+
+ epr.getReferenceParameters().putAttribute(InteropConstants.INTEROP_ATTRIBUTE_QNAME_LEVEL, InteropConstants.INTEROP_CUSTOMER_LEVEL) ;
+
+ notify(epr, null, (getUseTestName() ? "test1208" : "notify message")) ;
+ }
+
+ /**
+ * test1230 - SOAP 1.2 two-way message.
+ * Two-way message exchange containing an Action. All other fields are defaulted. The presence of a MessageID in the
+ * first message and of the corresponding RelatesTo in the second message is tested.
+ * @throws Exception on failure.
+ */
+ public void test1230()
+ throws Exception
+ {
+ echo(null, null, null, (getUseTestName() ? "test1230" : "echo message")) ;
+ }
+
+ /**
+ * test1231 - SOAP 1.2 two-way message with ReplyTo address of anonymous.
+ * Two-way message exchange containing an Action, MessageID and a ReplyTo of anonymous. All other fields are defaulted.
+ * @throws Exception on failure.
+ */
+ public void test1231()
+ throws Exception
+ {
+ echo(InteropConstants.ANON_EPR, null, null, (getUseTestName() ? "test1231" : "echo message")) ;
+ }
+
+ /**
+ * test1232 - SOAP 1.2 two-way message with ReplyTo address containing Reference Parameters.
+ * Two-way message exchange containing an Action and a ReplyTo with the address set to anonymous
+ * The ReplyTo contains at least one Reference Parameter value. The reply message is returned on
+ * the HTTP response with the Reference Parameter value as a first class SOAP header.
+ * @throws Exception on failure.
+ */
+ public void test1232()
+ throws Exception
+ {
+ final EndpointReferenceType epr = new EndpointReferenceType(InteropConstants.ANON_ADDRESS) ;
+ final NamedElement customerReferenceParameter = new NamedElement(InteropConstants.INTEROP_ELEMENT_QNAME_CUSTOMER_KEY, new TextElement(InteropConstants.INTEROP_CUSTOMER_KEY)) ;
+ epr.addReferenceParameter(customerReferenceParameter) ;
+ echo(epr, null, null, (getUseTestName() ? "test1232" : "echo message")) ;
+ }
+
+ /**
+ * test1233 - SOAP 1.2 two-way message with fault. ReplyTo and FaultTo addresses containing Reference Parameters.
+ * Two-way message exchange containing an Action. The ReplyTo and FaultTo addresses are both anonymous.
+ * The ReplyTo and FaultTo contain at least one Reference Parameter value which are different.
+ * A fault message is returned on the HTTP response with the FaultTo Reference Parameter value as a first class SOAP header.
+ * @throws Exception on failure.
+ */
+ public void test1233()
+ throws Exception
+ {
+ final EndpointReferenceType replyTo = new EndpointReferenceType(InteropConstants.ANON_ADDRESS) ;
+ final NamedElement replyCustomerReferenceParameter = new NamedElement(InteropConstants.INTEROP_ELEMENT_QNAME_CUSTOMER_KEY, new TextElement(InteropConstants.INTEROP_CUSTOMER_KEY)) ;
+ replyTo.addReferenceParameter(replyCustomerReferenceParameter) ;
+ final EndpointReferenceType faultTo = new EndpointReferenceType(InteropConstants.ANON_ADDRESS) ;
+ final NamedElement faultCustomerReferenceParameter = new NamedElement(InteropConstants.INTEROP_ELEMENT_QNAME_CUSTOMER_KEY, new TextElement(InteropConstants.INTEROP_FAULT_CUSTOMER_KEY)) ;
+ faultTo.addReferenceParameter(faultCustomerReferenceParameter) ;
+ try
+ {
+ echo(replyTo, faultTo, null, (getUseTestName() ? "faultTest1233" : "")) ;
+ fail("Expected EmptyString SoapFault") ;
+ }
+ catch (final SoapFault soapFault)
+ {
+ }
+ }
+
+ /**
+ * test1234 - SOAP 1.2 two-way message with fault. FaultTo is defaulted, ReplyTo address contains Reference Parameters.
+ * Two-way message exchange containing an Action and a ReplyTo address, but no FaultTo EPR. The ReplyTo address is anonymous.
+ * The ReplyTo contains at least one Reference Parameter value. A fault message is returned on the HTTP response with the
+ * ReplyTo Reference Parameter value as a first class SOAP header.
+ * @throws Exception on failure.
+ */
+ public void test1234()
+ throws Exception
+ {
+ final EndpointReferenceType replyTo = new EndpointReferenceType(InteropConstants.ANON_ADDRESS) ;
+ final NamedElement replyCustomerReferenceParameter = new NamedElement(InteropConstants.INTEROP_ELEMENT_QNAME_CUSTOMER_KEY, new TextElement(InteropConstants.INTEROP_CUSTOMER_KEY)) ;
+ replyTo.addReferenceParameter(replyCustomerReferenceParameter) ;
+ try
+ {
+ echo(replyTo, null, null, (getUseTestName() ? "faultTest1234" : "")) ;
+ fail("Expected EmptyString SoapFault") ;
+ }
+ catch (final SoapFault soapFault)
+ {
+ }
+ }
+
+ /**
+ * test1235 - SOAP 1.2 two-way message with fault. FaultTo is anonymous, ReplyTo is non-anonymous.
+ * Two-way message exchange containing an Action, a ReplyTo EPR, and a FaultTo EPR. The ReplyTo address is not anonymous.
+ * The FaultTo address is anonymous. The FaultTo contains at least one Reference Parameter value. A fault message is returned
+ * on the HTTP response.
+ * @throws Exception on failure.
+ */
+ public void test1235()
+ throws Exception
+ {
+ final EndpointReferenceType replyTo = new EndpointReferenceType(new AttributedURIType(getSourceServiceURI())) ;
+ final EndpointReferenceType faultTo = new EndpointReferenceType(InteropConstants.ANON_ADDRESS) ;
+ final NamedElement faultCustomerReferenceParameter = new NamedElement(InteropConstants.INTEROP_ELEMENT_QNAME_CUSTOMER_KEY, new TextElement(InteropConstants.INTEROP_FAULT_CUSTOMER_KEY)) ;
+ faultTo.addReferenceParameter(faultCustomerReferenceParameter) ;
+ try
+ {
+ echo(replyTo, faultTo, null, (getUseTestName() ? "faultTest1235" : "")) ;
+ fail("Expected EmptyString SoapFault") ;
+ }
+ catch (final SoapFault soapFault)
+ {
+ }
+ }
+
+ /**
+ * test1236 - SOAP 1.2 two-way message with a ReplyTo address of none.
+ * Two-way message exchange containing an ReplyTo EPR. The Reply-To EPR is has a value of
+ * http://www.w3.org/2005/08/addressing/none. No message is sent back.
+ * @throws Exception on failure.
+ */
+ public void test1236()
+ throws Exception
+ {
+ final String result = echo(InteropConstants.NONE_EPR, null, null, (getUseTestName() ? "faultTest1236" : "")) ;
+ assertNull(result) ;
+ }
+
+ /**
+ * test1237 - SOAP 1.2 two-way message with a ReplyTo address of none and a role of '/next'.
+ * Two-way message exchange containing an ReplyTo EPR. The Reply-To EPR is has a value of "http://www.w3.org/2005/08/addressing/none"
+ * and a role of "http://www.w3.org/2003/05/soap-envelope/role/next". No message is sent back.
+ * @throws Exception on failure.
+ */
+ public void test1237()
+ throws Exception
+ {
+ final EndpointReferenceType replyTo = new EndpointReferenceType(InteropConstants.NONE_ADDRESS) ;
+ replyTo.putAttribute(soapDetails.getRoleQName(), soapDetails.getNextRole()) ;
+
+ final String result = echo(replyTo, null, null, (getUseTestName() ? "faultTest1237" : "")) ;
+ assertNull(result) ;
+ }
+
+ /**
+ * test1238 - SOAP 1.2 two-way message triggers mustUnderstand fault
+ * A SOAP header marked with @mustUndertand="1" and a FaultTo address of none. The header isn't understood and a mustUnderstand fault
+ * is generated by the underlying SOAP processing model and sent back to the node A.
+ * @throws Exception on failure.
+ */
+ public void test1238()
+ throws Exception
+ {
+ final AnyElement alertControlElement = new AnyElement() ;
+ alertControlElement.putAttribute(soapDetails.getMustUnderstandQName(), "true") ;
+ final NamedElement alertcontrol = new NamedElement(InteropConstants.INTEROP_ELEMENT_QNAME_ALERT_CONTROL, alertControlElement) ;
+ try
+ {
+ echo(null, InteropConstants.NONE_EPR, alertcontrol, (getUseTestName() ? "test1237" : "echo message")) ;
+ fail("Expected SoapFault") ;
+ }
+ catch (final SoapFault soapFault)
+ {
+ }
+ }
+
+ /**
+ * test1240 - SOAP 1.2 two-way message with a duplicate To header.
+ * Two-way message exchange containing a duplicate To header.
+ * @throws Exception on failure.
+ */
+ public void test1240()
+ throws Exception
+ {
+ final NamedElement to = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_TO, InteropConstants.ANON_ADDRESS) ;
+ try
+ {
+ echo(null, null, to, (getUseTestName() ? "test1240" : "echo message")) ;
+ fail("Expected SoapFault") ;
+ }
+ catch (final SoapFault soapFault)
+ {
+ }
+ }
+
+ /**
+ * test1241 - SOAP 1.2 two-way message with a duplicate Reply-To header.
+ * Two-way message exchange containing a duplicate Reply-To header.
+ * @throws Exception on failure.
+ */
+ public void test1241()
+ throws Exception
+ {
+ final NamedElement replyTo = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_REPLY_TO, InteropConstants.ANON_EPR) ;
+ try
+ {
+ echo(InteropConstants.ANON_EPR, null, replyTo, (getUseTestName() ? "test1241" : "echo message")) ;
+ fail("Expected SoapFault") ;
+ }
+ catch (final SoapFault soapFault)
+ {
+ }
+ }
+
+ /**
+ * test1242 - SOAP 1.2 two-way message with a duplicate Fault-To header.
+ * Two-way message exchange containing a duplicate Fault-To header.
+ * @throws Exception on failure.
+ */
+ public void test1242()
+ throws Exception
+ {
+ final NamedElement faultTo = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_FAULT_TO, InteropConstants.ANON_EPR) ;
+ try
+ {
+ echo(null, InteropConstants.ANON_EPR, faultTo, (getUseTestName() ? "test1242" : "echo message")) ;
+ fail("Expected SoapFault") ;
+ }
+ catch (final SoapFault soapFault)
+ {
+ }
+ }
+
+ /**
+ * test1243 - SOAP 1.2 two-way message with a duplicate action header.
+ * Two-way message exchange containing a duplicate action header.
+ * @throws Exception on failure.
+ */
+ public void test1243()
+ throws Exception
+ {
+ final NamedElement action = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_ACTION, new AttributedURIType("action:duplicateAction")) ;
+ try
+ {
+ echo(null, null, action, (getUseTestName() ? "test1243" : "echo message")) ;
+ fail("Expected SoapFault") ;
+ }
+ catch (final SoapFault soapFault)
+ {
+ }
+ }
+
+ /**
+ * test1244 - SOAP 1.2 two-way message with a duplicate message ID header.
+ * Two-way message exchange containing a duplicate message ID header.
+ * @throws Exception on failure.
+ */
+ public void test1244()
+ throws Exception
+ {
+ final NamedElement messageID = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_MESSAGE_ID, new AttributedURIType("auid:duplicateMessageID")) ;
+ try
+ {
+ echo(null, null, messageID, (getUseTestName() ? "test1244" : "echo message")) ;
+ fail("Expected SoapFault") ;
+ }
+ catch (final SoapFault soapFault)
+ {
+ }
+ }
+
+ /**
+ * test1246 - SOAP 1.2 two-way message with a duplicate To header.
+ * Two-way message exchange containing a duplicate To header, generating a ProblemHeaderQName fault detail.
+ * @throws Exception on failure.
+ */
+ public void test1246()
+ throws Exception
+ {
+ final NamedElement to = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_TO, InteropConstants.ANON_ADDRESS) ;
+ try
+ {
+ echo(null, null, to, (getUseTestName() ? "test1246" : "echo message")) ;
+ fail("Expected SoapFault") ;
+ }
+ catch (final SoapFault soapFault)
+ {
+ }
+ }
+
+ /**
+ * test1247 - SOAP 1.2 two-way message with a duplicate To header.
+ * Two-way message exchange containing a duplicate To header, generating an InvalidCardinality subcode/subcode.
+ * @throws Exception on failure.
+ */
+ public void test1247()
+ throws Exception
+ {
+ final NamedElement to = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_TO, InteropConstants.ANON_ADDRESS) ;
+ try
+ {
+ echo(null, null, to, (getUseTestName() ? "test1247" : "echo message")) ;
+ fail("Expected SoapFault") ;
+ }
+ catch (final SoapFault soapFault)
+ {
+ }
+ }
+
+ /**
+ * test1248 - SOAP 1.2 two-way message with no action header.
+ * Two-way message exchange containing no action header.
+ * @throws Exception on failure.
+ */
+ public void test1248()
+ throws Exception
+ {
+ try
+ {
+ echo(getTargetServiceURI(), MessageId.getMessageId(), soapDetails, false, null, null, null, (getUseTestName() ? "test1248" : "echo message")) ;
+ fail("Expected SoapFault") ;
+ }
+ catch (final SoapFault soapFault)
+ {
+ }
+ }
+
+ /**
+ * test1249 - SOAP 1.2 two-way message with a duplicate To header and a ReplyTo of none.
+ * Two-way message exchange containing a duplicate To header and ReplyTo of none. An InvalidAddressingHeader
+ * fault should be generated, but not sent due to the ReplyTo header.
+ * @throws Exception on failure.
+ */
+ public void test1249()
+ throws Exception
+ {
+ final NamedElement to = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_TO, InteropConstants.ANON_ADDRESS) ;
+ try
+ {
+ asynchEcho(InteropConstants.NONE_EPR, null, to, (getUseTestName() ? "test1249" : "echo message")) ;
+ fail("Expected SoapFault") ;
+ }
+ catch (final SoapFault soapFault)
+ {
+ }
+ }
+
+ /**
+ * test1250 - SOAP 1.2 two-way message with a non-anonymous ReplyTo address.
+ * Two-way message exchange containing an Action and a ReplyTo identifying an endpoint. All other fields are defaulted.
+ * @throws Exception on failure.
+ */
+ public void test1250()
+ throws Exception
+ {
+ final EndpointReferenceType epr = new EndpointReferenceType(new AttributedURIType(getSourceServiceURI())) ;
+ asynchEcho(epr, null, null, (getUseTestName() ? "test1250" : "echo message")) ;
+ }
+
+ /**
+ * test1251 - SOAP 1.2 two-way message with a non-anonymous ReplyTo address and a Reply targeted to none.
+ * Two-way message exchange containing an Action, a ReplyTo identifying an endpoint, and a ReplyTo targeted
+ * to none. All other fields are defaulted.
+ * @throws Exception on failure.
+ */
+ public void test1251()
+ throws Exception
+ {
+ final EndpointReferenceType epr = new EndpointReferenceType(new AttributedURIType(getSourceServiceURI())) ;
+ final EndpointReferenceType noneReplyToEPR = new EndpointReferenceType(new AttributedURIType(getSourceServiceURI())) ;
+ noneReplyToEPR.putAttribute(soapDetails.getRoleQName(), soapDetails.getNoneRole()) ;
+
+ final NamedElement noneReplyTo = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_REPLY_TO, noneReplyToEPR) ;
+ asynchEcho(epr, null, noneReplyTo, (getUseTestName() ? "test1241" : "echo message")) ;
+ }
+
+ /**
+ * test1252 - SOAP 1.2 two-way message with a non-anonymous ReplyTo address and a FaultTo targeted to none.
+ * Two-way message exchange containing an Action, a ReplyTo identifying an endpoint, and a FaultTo targeted
+ * to none. All other fields are defaulted.
+ * @throws Exception on failure.
+ */
+ public void test1252()
+ throws Exception
+ {
+ final EndpointReferenceType epr = new EndpointReferenceType(new AttributedURIType(getSourceServiceURI())) ;
+
+ final String result = echo(epr, InteropConstants.NONE_EPR, null, (getUseTestName() ? "faultTest1152" : "")) ;
+ assertNull(result) ;
+ }
+
+ /**
+ * test1260 - SOAP 1.2 two-way message with an unreachable ReplyTo address.
+ * Two-way message exchange containing an Action and a ReplyTo identifying an unreachable endpoint. All other fields are defaulted.
+ * @throws Exception on failure.
+ */
+ public void test1260()
+ throws Exception
+ {
+ final EndpointReferenceType epr = new EndpointReferenceType(new AttributedURIType(getSourceServiceURI())) ;
+ try
+ {
+ asynchEcho(InteropConstants.UNREACHABLE_EPR, epr, null, (getUseTestName() ? "test1260" : "echo message")) ;
+ fail("Expected SoapFault") ;
+ }
+ catch (final SoapFault soapFault)
+ {
+ }
+ }
+
+ /**
+ * test1270 - SOAP 1.2 two-way message with wsa:From.
+ * Two-way message exchange containing an Action and a From marked with mustUnderstand. All other
+ * fields are defaulted. It is checked that the receiver understands the message.
+ * @throws Exception on failure.
+ */
+ public void test1270()
+ throws Exception
+ {
+ final EndpointReferenceType epr = new EndpointReferenceType(new AttributedURIType(getSourceServiceURI())) ;
+ epr.putAttribute(soapDetails.getMustUnderstandQName(), "true") ;
+ final NamedElement from = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_FROM, epr) ;
+ echo(null, null, from, (getUseTestName() ? "test1270" : "echo message")) ;
+ }
+
+ /**
+ * Make a synchronous call to the echo service.
+ * @param replyTo The reply to endpoint reference or bull.
+ * @param faultTo The fault to endpoint reference or null.
+ * @param duplicateHeader A dusplicate header or null.
+ * @param message The echo message.
+ * @throws Exception For errors during processing.
+ */
+ private String echo(final EndpointReferenceType replyTo, final EndpointReferenceType faultTo, final NamedElement duplicateHeader, final String message)
+ throws Exception
+ {
+ return echo(getTargetServiceURI(), MessageId.getMessageId(), soapDetails, true, replyTo, faultTo, duplicateHeader, message) ;
+ }
+
+ /**
+ * Make an asynchronous call to the echo service.
+ * @param replyTo The reply to endpoint reference or null.
+ * @param faultTo The fault to endpoint reference or null.
+ * @param duplicateHeader A dusplicate header or null.
+ * @param message The echo message.
+ * @throws Exception For errors during processing.
+ */
+ private String asynchEcho(final EndpointReferenceType replyTo, final EndpointReferenceType faultTo, final NamedElement duplicateHeader, final String message)
+ throws Exception
+ {
+ return asyncEcho(getTargetServiceURI(), MessageId.getMessageId(), soapDetails, true, replyTo, faultTo, duplicateHeader, message) ;
+ }
+
+ /**
+ * Call the notify service.
+ * @param addMessageId true if a message id is to be added, false otherwise.
+ * @param message The notify message,
+ * @throws Exception For errors during processing.
+ */
+ private void notify(final boolean addMessageId, final String message)
+ throws Exception
+ {
+ notify(getTargetServiceURI(), (addMessageId ? MessageId.getMessageId() : null), soapDetails, null, null, message) ;
+ }
+
+ /**
+ * Call the notify service.
+ * @param replyTo The reply to endpoint reference or null.
+ * @param faultTo The fault to endpoint reference or null.
+ * @param message The notify message,
+ * @throws Exception For errors during processing.
+ */
+ private void notify(final EndpointReferenceType replyTo, final EndpointReferenceType faultTo, final String message)
+ throws Exception
+ {
+ notify(getTargetServiceURI(), MessageId.getMessageId(), soapDetails, replyTo, faultTo, message) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/Soap12TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/WSDLParser.java
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/WSDLParser.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/WSDLParser.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,105 @@
+package com.jboss.transaction.interop;
+
+import java.io.IOException;
+import java.io.StringReader;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.soap.SoapUtils;
+import com.arjuna.webservices.stax.AnyElement;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.util.ClassLoaderHelper;
+
+/**
+ * Provide access to WSDL for the interop test.
+ * @author kevin
+ */
+public class WSDLParser
+{
+ /**
+ * The WSDL1 source.
+ */
+ private static String WSDL1_SOURCE ;
+
+ /**
+ * The WSDL2 source.
+ */
+ private static String WSDL2_SOURCE ;
+
+ /**
+ * Get the WSDL 1 named element.
+ * @return The WSDL 1 named element.
+ * @throws IOException for errors during reading.
+ * @throws XMLStreamException For errors during parsing.
+ */
+ public static NamedElement getWSDL1()
+ throws IOException, XMLStreamException
+ {
+ if (WSDL1_SOURCE == null)
+ {
+ throw new IOException("Error reading WSDL1 resource") ;
+ }
+
+ return getNamedElement(WSDL1_SOURCE) ;
+ }
+
+ /**
+ * Get the WSDL 2 named element.
+ * @return The WSDL 2 named element.
+ * @throws IOException for errors during reading.
+ * @throws XMLStreamException For errors during parsing.
+ */
+ public static NamedElement getWSDL2()
+ throws IOException, XMLStreamException
+ {
+ if (WSDL2_SOURCE == null)
+ {
+ throw new IOException("Error reading WSDL2 resource") ;
+ }
+
+ return getNamedElement(WSDL2_SOURCE) ;
+ }
+
+ /**
+ * Get the named element representing the source.
+ * @param source The XML source.
+ * @return The named element for the source.
+ * @throws XMLStreamException
+ */
+ private static NamedElement getNamedElement(final String source)
+ throws XMLStreamException
+ {
+ final XMLStreamReader reader = SoapUtils.getXMLStreamReader(new StringReader(source)) ;
+ reader.nextTag() ;
+ final QName name = reader.getName() ;
+ final AnyElement content = new AnyElement(reader) ;
+ return new NamedElement(name, content) ;
+ }
+
+ static
+ {
+ WSDL1_SOURCE = readResource("wsaWSDL1TestService.wsdl") ;
+ WSDL2_SOURCE = readResource("wsaWSDL2TestService.wsdl") ;
+ }
+
+ /**
+ * Read a resource into a string.
+ * @param resourceName The resource name.
+ * @return The contents of the resource.
+ */
+ private static String readResource(final String resourceName)
+ {
+ try
+ {
+ return ClassLoaderHelper.getResourceAsString(WSDLParser.class, resourceName) ;
+ }
+ catch (final IOException ioe)
+ {
+ System.err.println("Unexpected IOException while reading WSDL definitions for resource: " + resourceName + ", " + ioe) ;
+ ioe.printStackTrace(System.err) ;
+ return null ;
+ }
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/WSDLParser.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/wsaWSDL1TestService.wsdl
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/wsaWSDL1TestService.wsdl (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/wsaWSDL1TestService.wsdl 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Id: wsaTestService.wsdl,v 1.4 2005/12/21 20:50:30 pdowney Exp $ -->
+<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:whttp="http://schemas.xmlsoap.org/wsdl/http/"
+ xmlns:s0="http://example.org/notify"
+ xmlns:s1="http://example.org/echo"
+ xmlns:service="http://example.org/wsaTestService"
+ xmlns:wsaw="http://www.w3.org/2005/08/addressing/wsdl"
+ targetNamespace="http://example.org/wsaTestService">
+
+ <types>
+ <xs:schema targetNamespace="http://example.org/notify"
+ elementFormDefault="qualified" attributeFormDefault="unqualified">
+ <xs:element name='notify' type='xs:string'/>
+ </xs:schema>
+
+ <xs:schema targetNamespace="http://example.org/echo"
+ elementFormDefault="qualified" attributeFormDefault="unqualified">
+ <xs:element name='echoIn' type='xs:string'/>
+ <xs:element name='echoOut' type='xs:string'/>
+ </xs:schema>
+ </types>
+
+ <message name="wsaNotifyMessage">
+ <part name="wsaNotifyMessagePart" element="s0:notify"/>
+ </message>
+
+ <message name="wsaEchoInMessage">
+ <part name="wsaEchoInPart" element="s1:echoIn"/>
+ </message>
+
+ <message name="wsaEchoOutMessage">
+ <part name="wsaEchoOutPart" element="s1:echoOut"/>
+ </message>
+
+ <portType name="wsaTestPortType">
+ <operation name="notify">
+ <input message="service:wsaNotifyMessage"
+ wsaw:Action="http://example.org/action/notify"/>
+ </operation>
+
+ <operation name="echoIn">
+ <input message="service:wsaEchoInMessage"
+ wsaw:Action="http://example.org/action/echoIn"/>
+ </operation>
+
+ <operation name="echoOut">
+ <input message="service:wsaEchoOutMessage"
+ wsaw:Action="http://example.org/action/echoOut"/>
+ </operation>
+
+ </portType>
+
+ <binding name="wsaTestSoap11Binding" type="service:wsaTestPortType">
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="notify">
+ <soap:operation style="document" soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ </operation>
+
+ <operation name="echoIn">
+ <soap:operation style="document" soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ </operation>
+
+ <operation name="echoOut">
+ <soap:operation style="document" soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ </operation>
+
+ </binding>
+
+ <service name="wsaTestService">
+ <port name="wsaTestPort" binding="service:wsaTestSoap11Binding">
+ <soap:address location="http://example.org/node/B"/>
+ </port>
+ </service>
+</definitions>
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/wsaWSDL1TestService.wsdl
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/xml
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/wsaWSDL2TestService.wsdl
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/wsaWSDL2TestService.wsdl (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/wsaWSDL2TestService.wsdl 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Id: wsaTestService.wsdl,v 1.5 2005/12/19 13:39:18 dillsley Exp $ -->
+<description xmlns="http://www.w3.org/2006/01/wsdl"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:whttp="http://www.w3.org/2006/01/wsdl/http"
+ xmlns:wsoap="http://www.w3.org/2006/01/wsdl/soap"
+ xmlns:wsdlx="http://www.w3.org/2006/01/wsdl-extensions"
+ xmlns:notify="http://example.org/notify"
+ xmlns:echo="http://example.org/echo"
+ xmlns:service="http://example.org/wsaTestService"
+ targetNamespace="http://example.org/wsaTestService">
+
+ <types>
+ <xs:schema targetNamespace="http://example.org/notify"
+ elementFormDefault="qualified" attributeFormDefault="unqualified">
+ <xs:element name='notify' type='xs:string'/>
+ </xs:schema>
+ <xs:schema targetNamespace="http://example.org/echo"
+ elementFormDefault="qualified" attributeFormDefault="unqualified">
+ <xs:element name='echoIn' type='xs:string'/>
+ <xs:element name='echoOut' type='xs:string'/>
+ </xs:schema>
+ </types>
+
+ <interface name="wsaTestService">
+ <fault name="service:EmptyEchoString" />
+ <operation name="notify" pattern="http://www.w3.org/2006/01/wsdl/in-only">
+ <input messageLabel="In" element="notify:notify"/>
+ </operation>
+ <operation name="echoIn" pattern="http://www.w3.org/2006/01/wsdl/robust-in-only">
+ <input messageLabel="In" element="s1:echoIn"/>
+ <outfault ref="service:EmptyEchoString" messageLabel="Out" />
+ </operation>
+ <operation name="echoOut" pattern="http://www.w3.org/2006/01/wsdl/robust-in-only">
+ <input messageLabel="In" element="s1:echoOut"/>
+ <outfault ref="service:EmptyEchoString" messageLabel="Out" />
+ </operation>
+ <operation name="echo" pattern="http://www.w3.org/2006/01/wsdl/in-out">
+ <input messageLabel="In" element="s1:echoIn"/>
+ <output messageLabel="Out" element="s1:echoOut"/>
+ <outfault ref="service:EmptyEchoString" messageLabel="Out" />
+ </operation>
+ </interface>
+
+ <binding name="wsaTestSoap11Binding" interface="wsaTestService"
+ type="http://www.w3.org/2006/01/wsdl/soap"
+ wsoap:version="1.1" >
+ wsoap:protocol="http://www.w3.org/2003/05/soap/bindings/HTTP">
+ <operation ref="notify" />
+ <operation ref="echoIn" />
+ <operation ref="echoOut" />
+ <operation ref="echo" />
+ <fault ref="service:EmptyEchoString" wsoap:code="echo:EmptyEchoString"/>
+ </binding>
+
+ <binding name="wsaTestSoap12Binding" interface="wsaTestService"
+ type="http://www.w3.org/2006/01/wsdl/soap"
+ wsoap:version="1.2" >
+ wsoap:protocol="http://www.w3.org/2003/05/soap/bindings/HTTP">
+ <!-- Note: the request only SOAP MEP doesn't actually exist! -->
+ <operation ref="notify" wsoap:mep="http://www.w3.org/2003/05/soap/mep/request" />
+ <operation ref="echoIn" wsoap:mep="http://www.w3.org/2003/05/soap/mep/request" />
+ <operation ref="echoOut" wsoap:mep="http://www.w3.org/2003/05/soap/mep/request" />
+ <operation ref="echo" wsoap:mep="http://www.w3.org/2003/05/soap/mep/request-response" />
+ <fault ref="service:EmptyEchoString" wsoap:code="echo:EmptyEchoString"/>
+ </binding>
+
+ <service name="wsaTestService" interface="service:wsaTestService">
+ <endpoint name="wsaTestSoap11Endpoint" binding="service:wsaTestSoap11Binding"
+ address="http://example.org/node/B"/>
+ <endpoint name="wsaTestSoap12Endpoint" binding="service:wsaTestSoap12Binding"
+ address="http://example.org/node/B"/>
+ </service>
+
+</description>
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/interop/wsaWSDL2TestService.wsdl
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/TestConstants.java
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/TestConstants.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/TestConstants.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,572 @@
+package com.jboss.transaction.test ;
+
+import java.util.Map;
+import java.util.TreeMap;
+
+/**
+ * This class contains constants used to map the front end onto
+ * the WS-Addressing interop tests.
+ * @author kevin
+ */
+public class TestConstants
+{
+ /**
+ * The name of the Service URI parameter.
+ */
+ public static final String PARAM_SERVICE_URI = "serviceuri" ;
+ /**
+ * The name of the test parameter.
+ */
+ public static final String PARAM_TEST = "test" ;
+ /**
+ * The name of the use test name parameter.
+ */
+ public static final String PARAM_USE_TEST_NAME = "useTestName" ;
+
+ /**
+ * The name of the test results attribute.
+ */
+ public static final String ATTRIBUTE_TEST_RESULT = "testResult" ;
+ /**
+ * The name of the test validation attribute.
+ */
+ public static final String ATTRIBUTE_TEST_VALIDATION = "testValidation" ;
+ /**
+ * The name of the log count attribute.
+ */
+ public static final String ATTRIBUTE_LOG_COUNT = "logCount" ;
+ /**
+ * The name of the log name attribute.
+ */
+ public static final String ATTRIBUTE_LOG_NAME = "logName" ;
+
+ /**
+ * test name for all tests
+ */
+ public static final String NAME_ALL_TESTS = "allTests" ;
+ /**
+ * test name for all Soap 1.1 tests
+ */
+ public static final String NAME_ALL_SOAP_11_TESTS = "allSoap11Tests" ;
+ /**
+ * test name for all Soap 1.2 tests
+ */
+ public static final String NAME_ALL_SOAP_12_TESTS = "allSoap12Tests" ;
+ /**
+ * The prefix for all Soap 1.1 tests.
+ */
+ public static final String PREFIX_SOAP_11_TESTS = "test11" ;
+ /**
+ * The prefix for all Soap 1.2 tests.
+ */
+ public static final String PREFIX_SOAP_12_TESTS = "test12" ;
+
+ /**
+ * test name for test1100
+ */
+ public static final String NAME_TEST_1100 = "test1100" ;
+ /**
+ * test description for test1100
+ */
+ public static final String DESCRIPTION_TEST_1100 = "SOAP 1.1 one-way message" ;
+ /**
+ * test name for test1200
+ */
+ public static final String NAME_TEST_1200 = "test1200" ;
+ /**
+ * test description for test1200
+ */
+ public static final String DESCRIPTION_TEST_1200 = "SOAP 1.2 one-way message" ;
+ /**
+ * test name for test1101
+ */
+ public static final String NAME_TEST_1101 = "test1101" ;
+ /**
+ * test description for test1101
+ */
+ public static final String DESCRIPTION_TEST_1101 = "SOAP 1.1 one-way defaulted with a MessageID value" ;
+ /**
+ * test name for test1201
+ */
+ public static final String NAME_TEST_1201 = "test1201" ;
+ /**
+ * test description for test1201
+ */
+ public static final String DESCRIPTION_TEST_1201 = "SOAP 1.2 one-way defaulted with a MessageID value" ;
+ /**
+ * test name for test1102
+ */
+ public static final String NAME_TEST_1102 = "test1102" ;
+ /**
+ * test description for test1102
+ */
+ public static final String DESCRIPTION_TEST_1102 = "SOAP 1.1 one-way message with a ReplyTo address of none" ;
+ /**
+ * test name for test1202
+ */
+ public static final String NAME_TEST_1202 = "test1202" ;
+ /**
+ * test description for test1202
+ */
+ public static final String DESCRIPTION_TEST_1202 = "SOAP 1.2 one-way message with a ReplyTo address of none" ;
+ /**
+ * test name for test1103
+ */
+ public static final String NAME_TEST_1103 = "test1103" ;
+ /**
+ * test description for test1103
+ */
+ public static final String DESCRIPTION_TEST_1103 = "SOAP 1.1 one-way message with a FaultTo address of none" ;
+ /**
+ * test name for test1203
+ */
+ public static final String NAME_TEST_1203 = "test1203" ;
+ /**
+ * test description for test1203
+ */
+ public static final String DESCRIPTION_TEST_1203 = "SOAP 1.2 one-way message with a FaultTo address of none" ;
+ /**
+ * test name for test1104
+ */
+ public static final String NAME_TEST_1104 = "test1104" ;
+ /**
+ * test description for test1104
+ */
+ public static final String DESCRIPTION_TEST_1104 = "SOAP 1.1 one-way message with a ReplyTo and FaultTo address of none" ;
+ /**
+ * test name for test1204
+ */
+ public static final String NAME_TEST_1204 = "test1204" ;
+ /**
+ * test description for test1204
+ */
+ public static final String DESCRIPTION_TEST_1204 = "SOAP 1.2 one-way message with a ReplyTo and FaultTo address of none" ;
+ /**
+ * test name for test1106
+ */
+ public static final String NAME_TEST_1106 = "test1106" ;
+ /**
+ * test description for test1106
+ */
+ public static final String DESCRIPTION_TEST_1106 = "SOAP 1.1 one-way message with ReplyTo containing a Reference Parameter" ;
+ /**
+ * test name for test1206
+ */
+ public static final String NAME_TEST_1206 = "test1206" ;
+ /**
+ * test description for test1206
+ */
+ public static final String DESCRIPTION_TEST_1206 = "SOAP 1.2 one-way message with ReplyTo containing a Reference Parameter" ;
+ /**
+ * test name for test1107
+ */
+ public static final String NAME_TEST_1107 = "test1107" ;
+ /**
+ * test description for test1107
+ */
+ public static final String DESCRIPTION_TEST_1107 = "SOAP 1.1 one-way message with ReplyTo containing WSDL Metadata" ;
+ /**
+ * test name for test1207
+ */
+ public static final String NAME_TEST_1207 = "test1207" ;
+ /**
+ * test description for test1207
+ */
+ public static final String DESCRIPTION_TEST_1207 = "SOAP 1.2 one-way message with ReplyTo containing WSDL Metadata" ;
+ /**
+ * test name for test1108
+ */
+ public static final String NAME_TEST_1108 = "test1108" ;
+ /**
+ * test description for test1108
+ */
+ public static final String DESCRIPTION_TEST_1108 = "SOAP 1.1 one-way message with ReplyTo containing EPR extensions" ;
+ /**
+ * test name for test1208
+ */
+ public static final String NAME_TEST_1208 = "test1208" ;
+ /**
+ * test description for test1208
+ */
+ public static final String DESCRIPTION_TEST_1208 = "SOAP 1.2 one-way message with ReplyTo containing EPR extensions" ;
+ /**
+ * test name for test1130
+ */
+ public static final String NAME_TEST_1130 = "test1130" ;
+ /**
+ * test description for test1130
+ */
+ public static final String DESCRIPTION_TEST_1130 = "SOAP 1.1 two-way message." ;
+ /**
+ * test name for test1230
+ */
+ public static final String NAME_TEST_1230 = "test1230" ;
+ /**
+ * test description for test1230
+ */
+ public static final String DESCRIPTION_TEST_1230 = "SOAP 1.2 two-way message." ;
+ /**
+ * test name for test1131
+ */
+ public static final String NAME_TEST_1131 = "test1131" ;
+ /**
+ * test description for test1131
+ */
+ public static final String DESCRIPTION_TEST_1131 = "SOAP 1.1 two-way message with ReplyTo address of anonymous." ;
+ /**
+ * test name for test1231
+ */
+ public static final String NAME_TEST_1231 = "test1231" ;
+ /**
+ * test description for test1231
+ */
+ public static final String DESCRIPTION_TEST_1231 = "SOAP 1.2 two-way message with ReplyTo address of anonymous." ;
+ /**
+ * test name for test1132
+ */
+ public static final String NAME_TEST_1132 = "test1132" ;
+ /**
+ * test description for test1132
+ */
+ public static final String DESCRIPTION_TEST_1132 = "SOAP 1.1 two-way message with ReplyTo address containing Reference Parameters." ;
+ /**
+ * test name for test1232
+ */
+ public static final String NAME_TEST_1232 = "test1232" ;
+ /**
+ * test description for test1232
+ */
+ public static final String DESCRIPTION_TEST_1232 = "SOAP 1.2 two-way message with ReplyTo address containing Reference Parameters." ;
+ /**
+ * test name for test1133
+ */
+ public static final String NAME_TEST_1133 = "test1133" ;
+ /**
+ * test description for test1133
+ */
+ public static final String DESCRIPTION_TEST_1133 = "SOAP 1.1 two-way message with fault. ReplyTo and FaultTo addresses containing Reference Parameters." ;
+ /**
+ * test name for test1233
+ */
+ public static final String NAME_TEST_1233 = "test1233" ;
+ /**
+ * test description for test1233
+ */
+ public static final String DESCRIPTION_TEST_1233 = "SOAP 1.2 two-way message with fault. ReplyTo and FaultTo addresses containing Reference Parameters." ;
+ /**
+ * test name for test1134
+ */
+ public static final String NAME_TEST_1134 = "test1134" ;
+ /**
+ * test description for test1134
+ */
+ public static final String DESCRIPTION_TEST_1134 = "SOAP 1.1 two-way message with fault. FaultTo is defaulted, ReplyTo address contains Reference Parameters." ;
+ /**
+ * test name for test1234
+ */
+ public static final String NAME_TEST_1234 = "test1234" ;
+ /**
+ * test description for test1234
+ */
+ public static final String DESCRIPTION_TEST_1234 = "SOAP 1.2 two-way message with fault. FaultTo is defaulted, ReplyTo address contains Reference Parameters." ;
+ /**
+ * test name for test1235
+ */
+ public static final String NAME_TEST_1235 = "test1235" ;
+ /**
+ * test description for test1235
+ */
+ public static final String DESCRIPTION_TEST_1235 = "SOAP 1.2 two-way message with fault. FaultTo is anonymous, ReplyTo is non-anonymous." ;
+ /**
+ * test name for test1236
+ */
+ public static final String NAME_TEST_1236 = "test1236" ;
+ /**
+ * test description for test1236
+ */
+ public static final String DESCRIPTION_TEST_1236 = "SOAP 1.2 two-way message with a ReplyTo address of none." ;
+ /**
+ * test name for test1237
+ */
+ public static final String NAME_TEST_1237 = "test1237" ;
+ /**
+ * test description for test1237
+ */
+ public static final String DESCRIPTION_TEST_1237 = "SOAP 1.2 two-way message with a ReplyTo address of none and a role of '/next'." ;
+ /**
+ * test name for test1238
+ */
+ public static final String NAME_TEST_1238 = "test1238" ;
+ /**
+ * test description for test1238
+ */
+ public static final String DESCRIPTION_TEST_1238 = "SOAP 1.2 two-way message triggers mustUnderstand fault" ;
+ /**
+ * test name for test1140
+ */
+ public static final String NAME_TEST_1140 = "test1140" ;
+ /**
+ * test description for test1140
+ */
+ public static final String DESCRIPTION_TEST_1140 = "SOAP 1.1 two-way message with a duplicate To header." ;
+ /**
+ * test name for test1141
+ */
+ public static final String NAME_TEST_1141 = "test1141" ;
+ /**
+ * test description for test1141
+ */
+ public static final String DESCRIPTION_TEST_1141 = "SOAP 1.1 two-way message with a duplicate Reply-To header." ;
+ /**
+ * test name for test1142
+ */
+ public static final String NAME_TEST_1142 = "test1142" ;
+ /**
+ * test description for test1142
+ */
+ public static final String DESCRIPTION_TEST_1142 = "SOAP 1.1 two-way message with a duplicate Fault-To header." ;
+ /**
+ * test name for test1143
+ */
+ public static final String NAME_TEST_1143 = "test1143" ;
+ /**
+ * test description for test1143
+ */
+ public static final String DESCRIPTION_TEST_1143 = "SOAP 1.1 two-way message with a duplicate action header." ;
+ /**
+ * test name for test1144
+ */
+ public static final String NAME_TEST_1144 = "test1144" ;
+ /**
+ * test description for test1144
+ */
+ public static final String DESCRIPTION_TEST_1144 = "SOAP 1.1 two-way message with a duplicate message ID header." ;
+ /**
+ * test name for test1146
+ */
+ public static final String NAME_TEST_1146 = "test1146" ;
+ /**
+ * test description for test1146
+ */
+ public static final String DESCRIPTION_TEST_1146 = "SOAP 1.1 two-way message with a duplicate To header." ;
+ /**
+ * test name for test1147
+ */
+ public static final String NAME_TEST_1147 = "test1147" ;
+ /**
+ * test description for test1147
+ */
+ public static final String DESCRIPTION_TEST_1147 = "SOAP 1.1 two-way message with no action header." ;
+ /**
+ * test name for test1149
+ */
+ public static final String NAME_TEST_1149 = "test1149" ;
+ /**
+ * test description for test1149
+ */
+ public static final String DESCRIPTION_TEST_1149 = "SOAP 1.1 two-way message with a duplicate To header and a ReplyTo of none." ;
+ /**
+ * test name for test1240
+ */
+ public static final String NAME_TEST_1240 = "test1240" ;
+ /**
+ * test description for test1240
+ */
+ public static final String DESCRIPTION_TEST_1240 = "SOAP 1.2 two-way message with a duplicate To header." ;
+ /**
+ * test name for test1241
+ */
+ public static final String NAME_TEST_1241 = "test1241" ;
+ /**
+ * test description for test1241
+ */
+ public static final String DESCRIPTION_TEST_1241 = "SOAP 1.2 two-way message with a duplicate Reply-To header." ;
+ /**
+ * test name for test1242
+ */
+ public static final String NAME_TEST_1242 = "test1242" ;
+ /**
+ * test description for test1242
+ */
+ public static final String DESCRIPTION_TEST_1242 = "SOAP 1.2 two-way message with a duplicate Fault-To header." ;
+ /**
+ * test name for test1243
+ */
+ public static final String NAME_TEST_1243 = "test1243" ;
+ /**
+ * test description for test1243
+ */
+ public static final String DESCRIPTION_TEST_1243 = "SOAP 1.2 two-way message with a duplicate action header." ;
+ /**
+ * test name for test1244
+ */
+ public static final String NAME_TEST_1244 = "test1244" ;
+ /**
+ * test description for test1244
+ */
+ public static final String DESCRIPTION_TEST_1244 = "SOAP 1.2 two-way message with a duplicate message ID header." ;
+ /**
+ * test name for test1246
+ */
+ public static final String NAME_TEST_1246 = "test1246" ;
+ /**
+ * test description for test1246
+ */
+ public static final String DESCRIPTION_TEST_1246 = "SOAP 1.2 two-way message with a duplicate To header." ;
+ /**
+ * test name for test1247
+ */
+ public static final String NAME_TEST_1247 = "test1247" ;
+ /**
+ * test description for test1247
+ */
+ public static final String DESCRIPTION_TEST_1247 = "SOAP 1.2 two-way message with a duplicate To header." ;
+ /**
+ * test name for test1248
+ */
+ public static final String NAME_TEST_1248 = "test1248" ;
+ /**
+ * test name for test1249
+ */
+ public static final String NAME_TEST_1249 = "test1249" ;
+ /**
+ * test description for test1249
+ */
+ public static final String DESCRIPTION_TEST_1249 = "SOAP 1.2 two-way message with a duplicate To header and a ReplyTo of none." ;
+ /**
+ * test description for test1248
+ */
+ public static final String DESCRIPTION_TEST_1248 = "SOAP 1.2 two-way message with no action header." ;
+ /**
+ * test name for test1150
+ */
+ public static final String NAME_TEST_1150 = "test1150" ;
+ /**
+ * test description for test1150
+ */
+ public static final String DESCRIPTION_TEST_1150 = "SOAP 1.1 two-way message with a non-anonymous ReplyTo address." ;
+ /**
+ * test name for test1250
+ */
+ public static final String NAME_TEST_1250 = "test1250" ;
+ /**
+ * test description for test1250
+ */
+ public static final String DESCRIPTION_TEST_1250 = "SOAP 1.2 two-way message with a non-anonymous ReplyTo address." ;
+ /**
+ * test name for test1251
+ */
+ public static final String NAME_TEST_1251 = "test1251" ;
+ /**
+ * test description for test1251
+ */
+ public static final String DESCRIPTION_TEST_1251 = "SOAP 1.2 two-way message with a non-anonymous ReplyTo address and a Reply targeted to none." ;
+ /**
+ * test name for test1152
+ */
+ public static final String NAME_TEST_1152 = "test1152" ;
+ /**
+ * test description for test1152
+ */
+ public static final String DESCRIPTION_TEST_1152 = "SOAP 1.1 two-way message with a non-anonymous ReplyTo address and a FaultTo targeted to none." ;
+ /**
+ * test name for test1252
+ */
+ public static final String NAME_TEST_1252 = "test1252" ;
+ /**
+ * test description for test1252
+ */
+ public static final String DESCRIPTION_TEST_1252 = "SOAP 1.2 two-way message with a non-anonymous ReplyTo address and a FaultTo targeted to none." ;
+ /**
+ * test name for test1260
+ */
+ public static final String NAME_TEST_1260 = "test1260" ;
+ /**
+ * test description for test1260
+ */
+ public static final String DESCRIPTION_TEST_1260 = "SOAP 1.2 two-way message with an unreachable ReplyTo address." ;
+ /**
+ * test name for test1170
+ */
+ public static final String NAME_TEST_1170 = "test1170" ;
+ /**
+ * test description for test1170
+ */
+ public static final String DESCRIPTION_TEST_1170 = "SOAP 1.1 two-way message with wsa:From." ;
+ /**
+ * test name for test1270
+ */
+ public static final String NAME_TEST_1270 = "test1270" ;
+ /**
+ * test description for test1270
+ */
+ public static final String DESCRIPTION_TEST_1270 = "SOAP 1.2 two-way message with wsa:From." ;
+
+ /**
+ * The name to description map.
+ */
+ public static final Map DESCRIPTIONS ;
+
+ static
+ {
+ final TreeMap descriptions = new TreeMap() ;
+
+ descriptions.put(NAME_TEST_1100, DESCRIPTION_TEST_1100) ;
+ descriptions.put(NAME_TEST_1200, DESCRIPTION_TEST_1200) ;
+ descriptions.put(NAME_TEST_1101, DESCRIPTION_TEST_1101) ;
+ descriptions.put(NAME_TEST_1201, DESCRIPTION_TEST_1201) ;
+ descriptions.put(NAME_TEST_1102, DESCRIPTION_TEST_1102) ;
+ descriptions.put(NAME_TEST_1202, DESCRIPTION_TEST_1202) ;
+ descriptions.put(NAME_TEST_1103, DESCRIPTION_TEST_1103) ;
+ descriptions.put(NAME_TEST_1203, DESCRIPTION_TEST_1203) ;
+ descriptions.put(NAME_TEST_1104, DESCRIPTION_TEST_1104) ;
+ descriptions.put(NAME_TEST_1204, DESCRIPTION_TEST_1204) ;
+ descriptions.put(NAME_TEST_1106, DESCRIPTION_TEST_1106) ;
+ descriptions.put(NAME_TEST_1206, DESCRIPTION_TEST_1206) ;
+ descriptions.put(NAME_TEST_1107, DESCRIPTION_TEST_1107) ;
+ descriptions.put(NAME_TEST_1207, DESCRIPTION_TEST_1207) ;
+ descriptions.put(NAME_TEST_1108, DESCRIPTION_TEST_1108) ;
+ descriptions.put(NAME_TEST_1208, DESCRIPTION_TEST_1208) ;
+ descriptions.put(NAME_TEST_1130, DESCRIPTION_TEST_1130) ;
+ descriptions.put(NAME_TEST_1230, DESCRIPTION_TEST_1230) ;
+ descriptions.put(NAME_TEST_1131, DESCRIPTION_TEST_1131) ;
+ descriptions.put(NAME_TEST_1231, DESCRIPTION_TEST_1231) ;
+ descriptions.put(NAME_TEST_1132, DESCRIPTION_TEST_1132) ;
+ descriptions.put(NAME_TEST_1232, DESCRIPTION_TEST_1232) ;
+ descriptions.put(NAME_TEST_1133, DESCRIPTION_TEST_1133) ;
+ descriptions.put(NAME_TEST_1233, DESCRIPTION_TEST_1233) ;
+ descriptions.put(NAME_TEST_1134, DESCRIPTION_TEST_1134) ;
+ descriptions.put(NAME_TEST_1234, DESCRIPTION_TEST_1234) ;
+ descriptions.put(NAME_TEST_1235, DESCRIPTION_TEST_1235) ;
+ descriptions.put(NAME_TEST_1236, DESCRIPTION_TEST_1236) ;
+ descriptions.put(NAME_TEST_1237, DESCRIPTION_TEST_1237) ;
+ descriptions.put(NAME_TEST_1238, DESCRIPTION_TEST_1238) ;
+ descriptions.put(NAME_TEST_1140, DESCRIPTION_TEST_1140) ;
+ descriptions.put(NAME_TEST_1141, DESCRIPTION_TEST_1141) ;
+ descriptions.put(NAME_TEST_1142, DESCRIPTION_TEST_1142) ;
+ descriptions.put(NAME_TEST_1143, DESCRIPTION_TEST_1143) ;
+ descriptions.put(NAME_TEST_1144, DESCRIPTION_TEST_1144) ;
+ descriptions.put(NAME_TEST_1146, DESCRIPTION_TEST_1146) ;
+ descriptions.put(NAME_TEST_1147, DESCRIPTION_TEST_1147) ;
+ descriptions.put(NAME_TEST_1149, DESCRIPTION_TEST_1149) ;
+ descriptions.put(NAME_TEST_1240, DESCRIPTION_TEST_1240) ;
+ descriptions.put(NAME_TEST_1241, DESCRIPTION_TEST_1241) ;
+ descriptions.put(NAME_TEST_1242, DESCRIPTION_TEST_1242) ;
+ descriptions.put(NAME_TEST_1243, DESCRIPTION_TEST_1243) ;
+ descriptions.put(NAME_TEST_1244, DESCRIPTION_TEST_1244) ;
+ descriptions.put(NAME_TEST_1246, DESCRIPTION_TEST_1246) ;
+ descriptions.put(NAME_TEST_1247, DESCRIPTION_TEST_1247) ;
+ descriptions.put(NAME_TEST_1249, DESCRIPTION_TEST_1249) ;
+ descriptions.put(NAME_TEST_1248, DESCRIPTION_TEST_1248) ;
+ descriptions.put(NAME_TEST_1150, DESCRIPTION_TEST_1150) ;
+ descriptions.put(NAME_TEST_1250, DESCRIPTION_TEST_1250) ;
+ descriptions.put(NAME_TEST_1251, DESCRIPTION_TEST_1251) ;
+ descriptions.put(NAME_TEST_1152, DESCRIPTION_TEST_1152) ;
+ descriptions.put(NAME_TEST_1252, DESCRIPTION_TEST_1252) ;
+ descriptions.put(NAME_TEST_1260, DESCRIPTION_TEST_1260) ;
+ descriptions.put(NAME_TEST_1170, DESCRIPTION_TEST_1170) ;
+ descriptions.put(NAME_TEST_1270, DESCRIPTION_TEST_1270) ;
+
+ DESCRIPTIONS = descriptions ;
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/TestConstants.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/TestLogController.java
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/TestLogController.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/TestLogController.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,84 @@
+package com.jboss.transaction.test;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+
+/**
+ * The test log controller.
+ * @author kevin
+ */
+public class TestLogController
+{
+ /**
+ * The base directory for logs, hardcoded for now.
+ */
+ private static File baseDir ;
+
+ static
+ {
+ final String userHome = System.getProperty("user.home") ;
+ baseDir = new File(userHome, "logs") ;
+ if (!baseDir.exists())
+ {
+ baseDir.mkdir() ;
+ }
+ }
+
+ /**
+ * Read the contents of the specified log.
+ * @param logName The log to retrieve.
+ * @return The log contents.
+ * @throws IOException for reading errors.
+ */
+ public static String readLog(final String logName)
+ throws IOException
+ {
+ final File logFile = new File(baseDir, logName) ;
+ if (logFile.exists() && logFile.canRead())
+ {
+ final FileReader reader = new FileReader(logFile) ;
+ try
+ {
+ final StringBuffer buffer = new StringBuffer() ;
+ final char[] charBuffer = new char[256] ;
+ while(reader.ready())
+ {
+ final int count = reader.read(charBuffer) ;
+ if (count > 0)
+ {
+ buffer.append(charBuffer, 0, count) ;
+ }
+ }
+ return buffer.toString() ;
+ }
+ finally
+ {
+ reader.close() ;
+ }
+ }
+ throw new IOException("Cannot read log file: " + logName) ;
+ }
+
+ /**
+ * Write the contents of the specified log.
+ * @param logName The log to write.
+ * @param contents The log contents.
+ * @throws IOException for reading errors.
+ */
+ public static void writeLog(final String logName, final String contents)
+ throws IOException
+ {
+ final File logFile = new File(baseDir, logName) ;
+ final FileWriter writer = new FileWriter(logFile) ;
+ try
+ {
+ writer.write(contents) ;
+ }
+ finally
+ {
+ writer.close() ;
+ }
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/TestLogController.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/TestLogServlet.java
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/TestLogServlet.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/TestLogServlet.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,96 @@
+package com.jboss.transaction.test;
+
+import java.io.IOException;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.arjuna.webservices.util.ClassLoaderHelper;
+
+/**
+ * The test servlet.
+ * @author kevin
+ */
+public class TestLogServlet extends HttpServlet
+{
+ /**
+ * The servlet serial version UID.
+ */
+ private static final long serialVersionUID = 2566877081747112520L ;
+
+ /**
+ * The not found HTML page.
+ */
+ private String notFoundResponse ;
+ /**
+ * The directory contents HTML page.
+ */
+ private String directoryContents ;
+
+ /**
+ * Initialise the servlet.
+ * @param servletConfig The servlet configuration.
+ */
+ public void init(final ServletConfig servletConfig)
+ throws ServletException
+ {
+ super.init(servletConfig) ;
+ try
+ {
+ notFoundResponse = ClassLoaderHelper.getResourceAsString(TestLogServlet.class, "notFoundResponse.html") ;
+ directoryContents = ClassLoaderHelper.getResourceAsString(TestLogServlet.class, "directoryContents.html") ;
+ }
+ catch (final IOException ioe)
+ {
+ throw new ServletException("Failed to load HTML pages", ioe) ;
+ }
+ }
+
+ /**
+ * Return the specified logs
+ * @param request The HTTP servlet request.
+ * @param response The HTTP servlet response.
+ */
+ protected void doGet(final HttpServletRequest request, final HttpServletResponse response)
+ throws ServletException, IOException
+ {
+ final String logName = request.getPathInfo() ;
+ if ((logName == null) || (logName.length() == 0))
+ {
+ response.sendRedirect("logs/") ;
+ return ;
+ }
+ else if ("/".equals(logName))
+ {
+ response.setContentType("text/html") ;
+ response.setStatus(HttpServletResponse.SC_OK) ;
+ response.setContentLength(directoryContents.length()) ;
+ response.getOutputStream().print(directoryContents) ;
+ }
+ else
+ {
+ final String contents ;
+ try
+ {
+ contents = TestLogController.readLog(logName) ;
+ }
+ catch (final Throwable th)
+ {
+ log("Error reading log file", th) ;
+ response.setContentType("text/html") ;
+ response.setStatus(HttpServletResponse.SC_NOT_FOUND) ;
+ response.setContentLength(notFoundResponse.length()) ;
+ response.getOutputStream().print(notFoundResponse) ;
+ return ;
+ }
+
+ response.setContentType("text/xml") ;
+ response.setStatus(HttpServletResponse.SC_OK) ;
+ response.setContentLength(contents.length()) ;
+ response.getOutputStream().print(contents) ;
+ }
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/TestLogServlet.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/TestRunner.java
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/TestRunner.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/TestRunner.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,133 @@
+package com.jboss.transaction.test;
+
+import com.jboss.transaction.interop.InteropTestCase;
+import com.jboss.transaction.interop.InteropTestSuite;
+import com.jboss.transaction.interop.MessageLogging;
+import com.jboss.transaction.interop.Soap11TestCase;
+import com.jboss.transaction.interop.Soap12TestCase;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestResult;
+import junit.framework.TestSuite;
+
+/**
+ * Class responsible for executing the appropriate JUnit test.
+ * @author kevin
+ */
+public class TestRunner
+{
+ /**
+ * The log message prefix.
+ */
+ private static final String LOG_MESSAGE_PREFIX = "<log:log xmlns:log=\"http://www.w3.org/2002/ws/addressing/logs/\">" ;
+ /**
+ * The log message suffix.
+ */
+ private static final String LOG_MESSAGE_SUFFIX = "</log:log>";
+
+ /**
+ * The SOAP 1.1 test class.
+ */
+ private static final Class SOAP_11_TEST_CLASS = Soap11TestCase.class ;
+ /**
+ * The SOAP 1.2 test class.
+ */
+ private static final Class SOAP_12_TEST_CLASS = Soap12TestCase.class ;
+
+ /**
+ * Execute the specific test against the specified service.
+ * @param serviceURI The URI of the service.
+ * @param useTestName true if the test should use the test name, false otherwise.
+ * @param testName The name of the test to execute.
+ * @return The test result.
+ */
+ public static TestResult execute(final String serviceURI, final boolean useTestName, final String testName)
+ {
+ MessageLogging.clearThreadLog() ;
+ final Test test ;
+ if (TestConstants.NAME_ALL_TESTS.equals(testName))
+ {
+ final TestSuite testSuite = new TestSuite() ;
+ testSuite.addTest(new InteropTestSuite(serviceURI, useTestName, SOAP_11_TEST_CLASS)) ;
+ testSuite.addTest(new InteropTestSuite(serviceURI, useTestName, SOAP_12_TEST_CLASS)) ;
+ test = testSuite ;
+ }
+ else if (TestConstants.NAME_ALL_SOAP_11_TESTS.equals(testName))
+ {
+ test = new InteropTestSuite(serviceURI, useTestName, SOAP_11_TEST_CLASS) ;
+ }
+ else if (TestConstants.NAME_ALL_SOAP_12_TESTS.equals(testName))
+ {
+ test = new InteropTestSuite(serviceURI, useTestName, SOAP_12_TEST_CLASS) ;
+ }
+ else if (testName.startsWith(TestConstants.PREFIX_SOAP_11_TESTS))
+ {
+ final Class testClass = SOAP_11_TEST_CLASS ;
+ try
+ {
+ test = createTest(testClass, serviceURI, useTestName, testName) ;
+ }
+ catch (final Throwable th)
+ {
+ System.err.println("Unexpected error instantiating test class: " + th) ;
+ return null ;
+ }
+ }
+ else if (testName.startsWith(TestConstants.PREFIX_SOAP_12_TESTS))
+ {
+ final Class testClass = SOAP_12_TEST_CLASS ;
+ try
+ {
+ test = createTest(testClass, serviceURI, useTestName, testName) ;
+ }
+ catch (final Throwable th)
+ {
+ System.err.println("Unexpected error instantiating test class: " + th) ;
+ return null ;
+ }
+ }
+ else
+ {
+ System.err.println("Unidentified test name: " + testName) ;
+ return null ;
+ }
+ MessageLogging.appendThreadLog(LOG_MESSAGE_PREFIX) ;
+ final TestResult testResult = new TestResult() ;
+ test.run(testResult) ;
+ MessageLogging.appendThreadLog(LOG_MESSAGE_SUFFIX) ;
+ return testResult ;
+ }
+
+ /**
+ * Create the test instance.
+ * @param testClass The test class name.
+ * @param serviceURI The service URI.
+ * @param useTestName true if the test should use the test name, false otherwise.
+ * @param testName The test name.
+ * @return The test instance.
+ * @throws IllegalAccessException For access exception instantiating the test class.
+ * @throws InstantiationException For errors instantiating the test class.
+ * @throws IllegalArgumentException For an invalid test class.
+ */
+ private static TestCase createTest(final Class testClass, final String serviceURI, final boolean useTestName, final String testName)
+ throws IllegalAccessException, InstantiationException, IllegalArgumentException
+ {
+ final Object testObject = testClass.newInstance() ;
+ if (testObject instanceof InteropTestCase)
+ {
+ final InteropTestCase interopTestCase = (InteropTestCase)testObject ;
+ interopTestCase.setTargetServiceURI(serviceURI) ;
+ interopTestCase.setUseTestName(useTestName) ;
+ interopTestCase.setName(testName) ;
+ return interopTestCase ;
+ }
+ else if (testObject instanceof TestCase)
+ {
+ final TestCase test = (TestCase)testObject ;
+ test.setName(testName) ;
+ return test ;
+ }
+ throw new IllegalArgumentException("Invalid class: " + testClass.getName()) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/TestRunner.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/TestServlet.java
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/TestServlet.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/TestServlet.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,182 @@
+package com.jboss.transaction.test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Templates;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import junit.framework.TestResult;
+
+import com.arjuna.webservices.util.ClassLoaderHelper;
+import com.jboss.transaction.interop.MessageLogging;
+
+/**
+ * The test servlet.
+ * @author kevin
+ */
+public class TestServlet extends HttpServlet
+{
+ /**
+ * The servlet serial version UID.
+ */
+ private static final long serialVersionUID = 6764303043215036856L ;
+
+ /**
+ * The validation templates.
+ */
+ private Templates validationTemplates ;
+
+ /**
+ * Initialise the servlet.
+ * @param config The servlet configuration.
+ */
+ public void init(final ServletConfig config)
+ throws ServletException
+ {
+ super.init(config) ;
+
+ final InputStream is = ClassLoaderHelper.getResourceAsStream(getClass(), "processor.xsl") ;
+ if (is == null)
+ {
+ throw new ServletException("Cannot locate transformation stylesheet") ;
+ }
+ final TransformerFactory factory = TransformerFactory.newInstance() ;
+ try
+ {
+ validationTemplates = factory.newTemplates(new StreamSource(is)) ;
+ }
+ catch (final TransformerConfigurationException tce)
+ {
+ throw new ServletException("Error creating transformation template!", tce) ;
+ }
+ }
+
+ /**
+ * Execute the test
+ * @param request The HTTP servlet request.
+ * @param response The HTTP servlet response.
+ */
+ protected void doPost(final HttpServletRequest request, final HttpServletResponse response)
+ throws ServletException, IOException
+ {
+ final String serviceURI = request.getParameter(TestConstants.PARAM_SERVICE_URI) ;
+ final String test = request.getParameter(TestConstants.PARAM_TEST) ;
+ final boolean useTestName = (request.getParameter(TestConstants.PARAM_USE_TEST_NAME) != null) ;
+
+ final int serviceURILength = (serviceURI == null ? 0 : serviceURI.length()) ;
+ final int testLength = (test == null ? 0 : test.length()) ;
+ if ((serviceURILength == 0) || (testLength == 0))
+ {
+ final RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/invalidParameters.html") ;
+ dispatcher.forward(request, response) ;
+ return ;
+ }
+
+ final HttpSession session = request.getSession() ;
+ final String id = session.getId() ;
+ final int logCount = getLogCount(session) ;
+ final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss") ;
+ final String date = format.format(new Date()) ;
+ final String logName = date + "-" + id + "-" + logCount ;
+
+ session.setAttribute(TestConstants.ATTRIBUTE_TEST_RESULT, null) ;
+ session.setAttribute(TestConstants.ATTRIBUTE_TEST_VALIDATION, null) ;
+ session.setAttribute(TestConstants.ATTRIBUTE_LOG_NAME, null) ;
+
+ final String threadLog ;
+ try
+ {
+ final TestResult result = TestRunner.execute(serviceURI, useTestName, test) ;
+ if (result != null)
+ {
+ session.setAttribute(TestConstants.ATTRIBUTE_TEST_RESULT, result) ;
+
+ threadLog = MessageLogging.getThreadLog() ;
+
+ try
+ {
+ TestLogController.writeLog(logName, threadLog) ;
+ session.setAttribute(TestConstants.ATTRIBUTE_LOG_NAME, logName) ;
+ }
+ catch (final IOException ioe)
+ {
+ log("Unexpected IOException writing message log", ioe) ;
+ }
+ }
+ else
+ {
+ threadLog = null ;
+ }
+ }
+ finally
+ {
+ MessageLogging.clearThreadLog() ;
+ }
+
+ if ((threadLog != null) && (threadLog.length() > 0))
+ {
+ try
+ {
+ final String testValidation = transform(threadLog) ;
+ session.setAttribute(TestConstants.ATTRIBUTE_TEST_VALIDATION, testValidation) ;
+ }
+ catch (final Throwable th)
+ {
+ log("Unexpected throwable transforming message log", th) ;
+ }
+ }
+
+ final RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/results.jsp") ;
+ dispatcher.forward(request, response) ;
+ }
+
+ /**
+ * Get the log count from the session, incrementing afterwards.
+ * @param session The current HTTP session.
+ * @return The log count.
+ */
+ private int getLogCount(final HttpSession session)
+ {
+ final Object logCountObject = session.getAttribute(TestConstants.ATTRIBUTE_LOG_COUNT) ;
+ final int logCount = (logCountObject == null ? 1 : ((Integer)logCountObject).intValue() + 1) ;
+ session.setAttribute(TestConstants.ATTRIBUTE_LOG_COUNT, new Integer(logCount)) ;
+ return logCount ;
+ }
+
+ /**
+ * Transform the specified message log.
+ * @param messageLog The specified message log.
+ * @return The transformed result.
+ * @throws TransformerConfigurationException For transformer configuration errors.
+ * @throws TransformerException The transformation errors.
+ */
+ private String transform(final String messageLog)
+ throws TransformerConfigurationException, TransformerException
+ {
+ final Source source = new StreamSource(new StringReader(messageLog)) ;
+ final Transformer transformer = validationTemplates.newTransformer() ;
+ final StringWriter writer = new StringWriter() ;
+ final Result result = new StreamResult(writer) ;
+ transformer.transform(source, result) ;
+ return writer.toString() ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/TestServlet.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/directoryContents.html
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/directoryContents.html (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/directoryContents.html 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,23 @@
+<html>
+ <head>
+ <title>JBoss Transaction WS-Addressing interop results</title>
+ </head>
+ <body>
+ <h1>WS-Addressing Interop results</h1>
+ <p>These log files are the results of executing the JBoss Transaction WS-Addressing Interop client against public endpoints</p>
+ <table>
+ <thead>
+ <tr><td>Endpoint</td><td>Log file</td></tr>
+ </thead>
+ <tbody>
+ <tr><td>JBoss</td><td><a href="jboss-jboss.xml">jboss-jboss.xml</a></td></tr>
+ <tr><td>IBM</td><td><a href="jboss-ibm.xml">jboss-ibm.xml</a></td></tr>
+ <tr><td>Sun</td><td><a href="jboss-sun.xml">jboss-sun.xml</a></td></tr>
+ <tr><td>Microsoft</td><td><a href="jboss-msft.xml">jboss-msft.xml</a></td></tr>
+ <tr><td>Apache</td><td><a href="jboss-apache.xml">jboss-apache.xml</a></td></tr>
+ <tr><td>WSO2</td><td><a href="jboss-wso2.xml">jboss-wso2.xml</a></td></tr>
+ </tbody>
+ </table>
+ <p>Please send any queries to the <a href="mailto:kevin.conner at jboss.com?subject=Log%20results%20query">interop test contact</a></p>
+ </body>
+</html>
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/directoryContents.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/notFoundResponse.html
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/notFoundResponse.html (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/notFoundResponse.html 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,9 @@
+<html>
+ <head>
+ <title>Log file not found</title>
+ </head>
+ <body>
+ <h1>Log file not found</h1>
+ Requested log file could not be found
+ </body>
+</html>
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/notFoundResponse.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/processor.xsl
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/processor.xsl (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/processor.xsl 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/ws-addressing/testsuite/observer/processor.xsl
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/test/processor.xsl
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/InteropConstants.java
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/InteropConstants.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/InteropConstants.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,96 @@
+package com.jboss.transaction.webservices.interop;
+
+import javax.xml.namespace.QName;
+
+import com.arjuna.webservices.wsaddr2005.AddressingConstants;
+
+/**
+ * Interface containing WS-Addressing Interop constants.
+ */
+public interface InteropConstants
+{
+ /**
+ * The synchronous interop test service name.
+ */
+ public String SERVICE_INTEROP_TEST = "InteropTest" ;
+
+ /**
+ * The Notify Namespace.
+ */
+ public String INTEROP_NOTIFY_NAMESPACE = "http://example.org/notify" ;
+ /**
+ * The Notify namespace prefix.
+ */
+ public String INTEROP_NOTIFY_PREFIX = "notify" ;
+
+ /**
+ * The Echo Namespace.
+ */
+ public String INTEROP_ECHO_NAMESPACE = "http://example.org/echo" ;
+ /**
+ * The Echo namespace prefix.
+ */
+ public String INTEROP_ECHO_PREFIX = "echo" ;
+
+ /**
+ * The action prefix.
+ */
+ public String INTEROP_ACTION_PREFIX = "http://example.org/action/" ;
+
+ /**
+ * The notify element.
+ */
+ public String INTEROP_ELEMENT_NOTIFY = "notify" ;
+ /**
+ * The notify QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_NOTIFY = new QName(INTEROP_NOTIFY_NAMESPACE, INTEROP_ELEMENT_NOTIFY, INTEROP_NOTIFY_PREFIX) ;
+ /**
+ * The notify Action.
+ */
+ public String INTEROP_ACTION_NOTIFY = INTEROP_ACTION_PREFIX + INTEROP_ELEMENT_NOTIFY ;
+
+ /**
+ * The echo in element.
+ */
+ public String INTEROP_ELEMENT_ECHO_IN = "echoIn" ;
+ /**
+ * The echo in QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_ECHO_IN = new QName(INTEROP_ECHO_NAMESPACE, INTEROP_ELEMENT_ECHO_IN, INTEROP_ECHO_PREFIX) ;
+ /**
+ * The echo in Action.
+ */
+ public String INTEROP_ACTION_ECHO_IN = INTEROP_ACTION_PREFIX + INTEROP_ELEMENT_ECHO_IN ;
+
+ /**
+ * The echo out element.
+ */
+ public String INTEROP_ELEMENT_ECHO_OUT = "echoOut" ;
+ /**
+ * The echo out QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_ECHO_OUT = new QName(INTEROP_ECHO_NAMESPACE, INTEROP_ELEMENT_ECHO_OUT, INTEROP_ECHO_PREFIX) ;
+ /**
+ * The echo out Action.
+ */
+ public String INTEROP_ACTION_ECHO_OUT = INTEROP_ACTION_PREFIX + INTEROP_ELEMENT_ECHO_OUT ;
+
+ /**
+ * The echo fault element.
+ */
+ public String INTEROP_ELEMENT_ECHO_FAULT = "fault" ;
+ /**
+ * The echo fault Action.
+ */
+ public String INTEROP_ACTION_ECHO_FAULT = AddressingConstants.WSA_ACTION_FAULT ;
+
+ /**
+ * The empty echo string fault code.
+ */
+ public String INTEROP_ELEMENT_EMPTY_ECHO_STRING = "EmptyEchoString" ;
+ /**
+ * The echo string fault code QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_EMPTY_ECHO_STRING = new QName(INTEROP_ECHO_NAMESPACE, INTEROP_ELEMENT_EMPTY_ECHO_STRING, INTEROP_ECHO_PREFIX) ;
+}
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/InteropConstants.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/client/InteropClient.java
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/client/InteropClient.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/client/InteropClient.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,185 @@
+package com.jboss.transaction.webservices.interop.client;
+
+import java.io.IOException;
+
+import javax.xml.namespace.QName;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.SoapService;
+import com.arjuna.webservices.base.policy.ClientPolicy;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.stax.TextElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wsaddr2005.AttributedURIType;
+import com.arjuna.webservices.wsaddr2005.client.WSAddr2005Client;
+import com.arjuna.webservices.wsaddr2005.policy.AddressingPolicy;
+import com.jboss.transaction.webservices.interop.InteropConstants;
+import com.jboss.transaction.webservices.interop.policy.InteropClientPolicy;
+
+/**
+ * The Client side of the interop.
+ * @author kevin
+ */
+public class InteropClient
+{
+ /**
+ * The client singleton.
+ */
+ private static final InteropClient CLIENT = new InteropClient() ;
+
+ /**
+ * The notify action.
+ */
+ private final String notifyAction = InteropConstants.INTEROP_ACTION_NOTIFY ;
+ /**
+ * The echo in action.
+ */
+ private final String echoInAction = InteropConstants.INTEROP_ACTION_ECHO_IN ;
+
+ /**
+ * The SOAP service representing the client.
+ */
+ private final SoapService soapService ;
+
+ /**
+ * Construct the interop synch client.
+ */
+ private InteropClient()
+ {
+ final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+ // Add WS-Addressing
+ AddressingPolicy.register(handlerRegistry) ;
+ // Add Interop client policies
+ InteropClientPolicy.register(handlerRegistry) ;
+ // Add client policies
+ ClientPolicy.register(handlerRegistry) ;
+
+ soapService = new SoapService(handlerRegistry) ;
+ }
+
+ /**
+ * Send a notify.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @param notifyMessage The notify message.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendNotify(final AddressingContext addressingContext, final SoapDetails soapDetails, final String notifyMessage)
+ throws SoapFault, IOException
+ {
+ final TextElement notify = new TextElement(notifyMessage) ;
+ final NamedElement contents = new NamedElement(InteropConstants.INTEROP_ELEMENT_QNAME_NOTIFY, notify) ;
+ final SoapBody soapBody = new SoapBody(contents, notifyAction) ;
+ addressingContext.setAction(new AttributedURIType(notifyAction)) ;
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+
+ /**
+ * Send an echo.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @param action Include the SOAP and WSA action.
+ * @param echoMessage The echo message.
+ * @return The echo response.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public String sendEcho(final AddressingContext addressingContext, final SoapDetails soapDetails, final boolean action, final String echoMessage)
+ throws SoapFault, IOException
+ {
+ final TextElement echo = new TextElement(echoMessage) ;
+ final NamedElement contents = new NamedElement(InteropConstants.INTEROP_ELEMENT_QNAME_ECHO_IN, echo) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ if (action)
+ {
+ soapBody.setAction(echoInAction) ;
+ addressingContext.setAction(new AttributedURIType(echoInAction)) ;
+ }
+ final SoapBody response = WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService) ;
+
+ if (response != null)
+ {
+ final NamedElement responseElement = response.getContents() ;
+ if (responseElement != null)
+ {
+ final QName responseName = responseElement.getName() ;
+ if (InteropConstants.INTEROP_ELEMENT_QNAME_ECHO_OUT.equals(responseName))
+ {
+ final TextElement responseContent ;
+ try
+ {
+ responseContent = (TextElement)responseElement.getElementContent() ;
+ }
+ catch (final ClassCastException cce)
+ {
+ throw new SoapFault(SoapFaultType.FAULT_RECEIVER, null, "Expected text response type for element: " + responseName) ;
+ }
+ return responseContent.getText() ;
+ }
+ else
+ {
+ throw new SoapFault(SoapFaultType.FAULT_RECEIVER, null, "Unexpected response element: " + responseName) ;
+ }
+ }
+ }
+ return null ;
+ }
+
+ /**
+ * Send an echo request.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @param action Include the SOAP and WSA action.
+ * @param echoMessage The echo message.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendEchoRequest(final AddressingContext addressingContext, final SoapDetails soapDetails, final boolean action, final String echoMessage)
+ throws SoapFault, IOException
+ {
+ final TextElement echo = new TextElement(echoMessage) ;
+ final NamedElement contents = new NamedElement(InteropConstants.INTEROP_ELEMENT_QNAME_ECHO_IN, echo) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ if (action)
+ {
+ soapBody.setAction(echoInAction) ;
+ addressingContext.setAction(new AttributedURIType(echoInAction)) ;
+ }
+
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+
+ /**
+ * Send a fault.
+ * @param addressingContext The addressing context.
+ * @param soapDetails The SOAP details.
+ * @param soapFault The SOAP fault.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendSoapFault(final AddressingContext addressingContext, final SoapDetails soapDetails, final SoapFault soapFault)
+ throws SoapFault, IOException
+ {
+ final String soapFaultAction = soapFault.getAction() ;
+ if (soapFaultAction != null)
+ {
+ addressingContext.setAction(new AttributedURIType(soapFaultAction)) ;
+ }
+ WSAddr2005Client.sendSoapFault(soapFault, addressingContext, soapDetails, soapService) ;
+ }
+
+ /**
+ * Get the Interop client singleton.
+ * @return The Interop client singleton.
+ */
+ public static InteropClient getClient()
+ {
+ return CLIENT ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/client/InteropClient.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/handlers/EchoHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/handlers/EchoHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/handlers/EchoHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,45 @@
+package com.jboss.transaction.webservices.interop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.stax.TextElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.jboss.transaction.webservices.interop.InteropConstants;
+import com.jboss.transaction.webservices.interop.processors.InteropProcessor;
+
+/**
+ * The echo handler.
+ * @author kevin
+ */
+public class EchoHandler implements 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
+ {
+ final TextElement text = new TextElement(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+
+ final TextElement response = InteropProcessor.getInterop().echo(text, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(InteropConstants.INTEROP_ELEMENT_QNAME_ECHO_OUT, response) ;
+ return new SoapBody(responseElement, InteropConstants.INTEROP_ACTION_ECHO_OUT) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/handlers/EchoHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/handlers/EchoResponseHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/handlers/EchoResponseHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/handlers/EchoResponseHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,49 @@
+package com.jboss.transaction.webservices.interop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapMessageLogging;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.TextElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.jboss.transaction.webservices.interop.processors.InteropProcessor;
+
+/**
+ * The asynchronous echo response handler.
+ * @author kevin
+ */
+public class EchoResponseHandler implements 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
+ {
+ final TextElement text = new TextElement(in) ;
+ final String[] logs = SoapMessageLogging.getThreadLog() ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ InteropProcessor.getInterop().echoResponse(text, addressingContext, logs) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/handlers/EchoResponseHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/handlers/EchoSoapFaultHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/handlers/EchoSoapFaultHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/handlers/EchoSoapFaultHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.webservices.interop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapMessageLogging;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.jboss.transaction.webservices.interop.processors.InteropProcessor;
+
+/**
+ * The asynchronous soap fault handler.
+ * @author kevin
+ */
+public class EchoSoapFaultHandler implements 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
+ {
+ final SoapFault soapFault = soapDetails.parseSoapFault(in) ;
+ final String[] logs = SoapMessageLogging.getThreadLog() ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ InteropProcessor.getInterop().soapFault(soapFault, addressingContext, logs) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/handlers/EchoSoapFaultHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/handlers/EchoSynchResponseHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/handlers/EchoSynchResponseHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/handlers/EchoSynchResponseHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,41 @@
+package com.jboss.transaction.webservices.interop.handlers;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.stax.TextElement;
+
+/**
+ * The synchronous echo response handler.
+ * @author kevin
+ */
+public class EchoSynchResponseHandler implements BodyHandler
+{
+ /**
+ * Handle the body element.
+ * @param soapDetails The SOAP details.
+ * @param context The current message context.
+ * @param responseContext The response message context.
+ * @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
+ {
+ final QName elementName = in.getName() ;
+ final TextElement elementContent = new TextElement(in) ;
+ final NamedElement contents = new NamedElement(elementName, elementContent) ;
+ return new SoapBody(contents, action) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/handlers/EchoSynchResponseHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/handlers/NotifyHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/handlers/NotifyHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/handlers/NotifyHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,47 @@
+package com.jboss.transaction.webservices.interop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.TextElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.jboss.transaction.webservices.interop.processors.InteropProcessor;
+
+/**
+ * The notify request handler.
+ * @author kevin
+ */
+public class NotifyHandler implements 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
+ {
+ final TextElement text = new TextElement(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ InteropProcessor.getInterop().notify(text, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/handlers/NotifyHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/policy/InteropClientPolicy.java
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/policy/InteropClientPolicy.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/policy/InteropClientPolicy.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,30 @@
+package com.jboss.transaction.webservices.interop.policy;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.jboss.transaction.webservices.interop.InteropConstants;
+import com.jboss.transaction.webservices.interop.handlers.EchoSynchResponseHandler;
+
+/**
+ * Policy responsible for binding in the WS-Addressing Interop Test server handlers.
+ * @author kevin
+ */
+public class InteropClientPolicy
+{
+ /**
+ * Add this policy to the registry.
+ * @param registry The registry containing the policy.
+ */
+ public static void register(final HandlerRegistry registry)
+ {
+ registry.registerBodyHandler(InteropConstants.INTEROP_ELEMENT_QNAME_ECHO_OUT, new EchoSynchResponseHandler()) ;
+ }
+
+ /**
+ * Remove this policy from the registry.
+ * @param registry The registry containing the policy.
+ */
+ public static void remove(final HandlerRegistry registry)
+ {
+ registry.removeBodyHandler(InteropConstants.INTEROP_ELEMENT_QNAME_ECHO_OUT) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/policy/InteropClientPolicy.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/policy/InteropPolicy.java
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/policy/InteropPolicy.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/policy/InteropPolicy.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,39 @@
+package com.jboss.transaction.webservices.interop.policy;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.jboss.transaction.webservices.interop.InteropConstants;
+import com.jboss.transaction.webservices.interop.handlers.EchoSoapFaultHandler;
+import com.jboss.transaction.webservices.interop.handlers.EchoHandler;
+import com.jboss.transaction.webservices.interop.handlers.EchoResponseHandler;
+import com.jboss.transaction.webservices.interop.handlers.NotifyHandler;
+
+/**
+ * Policy responsible for binding in the WS-Addressing Interop Test server handlers.
+ * @author kevin
+ */
+public class InteropPolicy
+{
+ /**
+ * Add this policy to the registry.
+ * @param registry The registry containing the policy.
+ */
+ public static void register(final HandlerRegistry registry)
+ {
+ registry.registerBodyHandler(InteropConstants.INTEROP_ELEMENT_QNAME_NOTIFY, new NotifyHandler()) ;
+ registry.registerBodyHandler(InteropConstants.INTEROP_ELEMENT_QNAME_ECHO_IN, new EchoHandler()) ;
+
+ registry.registerBodyHandler(InteropConstants.INTEROP_ELEMENT_QNAME_ECHO_OUT, new EchoResponseHandler()) ;
+ registry.registerFaultHandler(new EchoSoapFaultHandler()) ;
+ }
+
+ /**
+ * Remove this policy from the registry.
+ * @param registry The registry containing the policy.
+ */
+ public static void remove(final HandlerRegistry registry)
+ {
+ registry.registerFaultHandler(null) ;
+ registry.removeBodyHandler(InteropConstants.INTEROP_ELEMENT_QNAME_ECHO_IN) ;
+ registry.removeBodyHandler(InteropConstants.INTEROP_ELEMENT_QNAME_NOTIFY) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/policy/InteropPolicy.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/processors/EchoCallback.java
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/processors/EchoCallback.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/processors/EchoCallback.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,33 @@
+package com.jboss.transaction.webservices.interop.processors;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.base.processors.Callback;
+import com.arjuna.webservices.stax.TextElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+
+/**
+ * The callback for the asynchronous echo client.
+ * @author kevin
+ */
+public abstract class EchoCallback extends Callback
+{
+ /**
+ * An echo response.
+ * @param echoResponse The response.
+ * @param addressingContext The current addressing context.
+ * @param logs The SOAP message logs.
+ */
+ public abstract void echoResponse(final TextElement echoResponse,
+ final AddressingContext addressingContext,
+ final String[] logs) ;
+
+ /**
+ * A SOAP fault response.
+ * @param soapFault The SOAP fault response.
+ * @param addressingContext The current addressing context.
+ * @param logs The SOAP message logs.
+ */
+ public abstract void soapFault(final SoapFault soapFault,
+ final AddressingContext addressingContext,
+ final String[] logs) ;
+}
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/processors/EchoCallback.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/processors/InteropProcessor.java
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/processors/InteropProcessor.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/processors/InteropProcessor.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,100 @@
+package com.jboss.transaction.webservices.interop.processors;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.base.processors.Callback;
+import com.arjuna.webservices.stax.TextElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wsaddr2005.processor.BaseWSAddr2005ResponseProcessor;
+import com.jboss.transaction.webservices.interop.InteropConstants;
+
+/**
+ * The Interop processor.
+ * @author kevin
+ */
+public class InteropProcessor extends BaseWSAddr2005ResponseProcessor
+{
+ /**
+ * The interop singleton.
+ */
+ private static final InteropProcessor INTEROP = new InteropProcessor() ;
+
+ /**
+ * Get the interop singleton.
+ * @return The singleton.
+ */
+ public static InteropProcessor getInterop()
+ {
+ return INTEROP ;
+ }
+
+ /**
+ * Notification received.
+ * @param text The text of the notification.
+ * @param addressingContext The addressing context.
+ */
+ public void notify(final TextElement text, final AddressingContext addressingContext)
+ {
+ // KEV should we log something here?
+ }
+
+ /**
+ * Synchronous echo.
+ * @param text The text sent to the echo.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TextElement echo(final TextElement text, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ final String textValue = text.getText() ;
+ if ((textValue == null) || textValue.startsWith("fault"))
+ {
+ final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, InteropConstants.INTEROP_ELEMENT_QNAME_EMPTY_ECHO_STRING, "Empty echo string") ;
+ soapFault.setAction(InteropConstants.INTEROP_ACTION_ECHO_FAULT) ;
+ throw soapFault ;
+ }
+ return new TextElement(textValue) ;
+ }
+
+ /**
+ * Asynchronous echo response.
+ * @param echoResponse The echo response.
+ * @param addressingContext The current addressing context.
+ * @param logs The incoming message logs
+ */
+ public void echoResponse(final TextElement echoResponse, final AddressingContext addressingContext, final String[] logs)
+ {
+ handleCallbacks(new CallbackExecutorAdapter() {
+ public void execute(final Callback callback) {
+ ((EchoCallback)callback).echoResponse(echoResponse, addressingContext, logs) ;
+ }
+ }, getIDs(addressingContext)) ;
+ }
+
+ /**
+ * Asynchronous SOAP fault.
+ * @param soapFault The SOAP fault.
+ * @param addressingContext The current addressing context.
+ * @param logs The incoming message logs
+ */
+ public void soapFault(final SoapFault soapFault, final AddressingContext addressingContext, final String[] logs)
+ {
+ handleCallbacks(new CallbackExecutorAdapter() {
+ public void execute(final Callback callback) {
+ ((EchoCallback)callback).soapFault(soapFault, addressingContext, logs) ;
+ }
+ }, getIDs(addressingContext)) ;
+ }
+
+ /**
+ * Register a callback for the specific message id.
+ * @param messageID The message ID.
+ * @param callback The callback for the response.
+ */
+ public void registerCallback(final String messageID, final EchoCallback callback)
+ {
+ register(messageID, callback) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/processors/InteropProcessor.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/server/InteropInitialisation.java
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/server/InteropInitialisation.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/server/InteropInitialisation.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,44 @@
+package com.jboss.transaction.webservices.interop.server;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.SoapService;
+import com.arjuna.webservices.wsaddr2005.policy.AddressingPolicy;
+import com.jboss.transaction.webservices.interop.InteropConstants;
+import com.jboss.transaction.webservices.interop.policy.InteropPolicy;
+
+/**
+ * Initialise the interop test service.
+ * @author kevin
+ */
+public class InteropInitialisation implements ServletContextListener
+{
+ /**
+ * The context has been initialized.
+ * @param servletContextEvent The servlet context event.
+ */
+ public void contextInitialized(final ServletContextEvent servletContextEvent)
+ {
+ final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+ // Add WS-Addressing
+ AddressingPolicy.register(handlerRegistry) ;
+ // Add endpoint
+ InteropPolicy.register(handlerRegistry) ;
+
+ final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+ soapRegistry.registerSoapService(InteropConstants.SERVICE_INTEROP_TEST,
+ new SoapService(handlerRegistry)) ;
+ }
+
+ /**
+ * The context is about to be destroyed.
+ * @param servletContextEvent The servlet context event.
+ */
+ public void contextDestroyed(final ServletContextEvent servletContextEvent)
+ {
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/src/com/jboss/transaction/webservices/interop/server/InteropInitialisation.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/web/details.jsp
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/web/details.jsp (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/web/details.jsp 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,90 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"%>
+<%@page import="com.jboss.transaction.test.TestConstants"%>
+<%@page import="java.util.Enumeration"%>
+<%@page import="junit.framework.TestResult"%>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<%@page import="junit.framework.TestFailure"%>
+<%@page import="junit.framework.TestCase"%>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>JBoss Transactions WS-Addressing Interop detail page</title>
+</head>
+<body>
+<h1>Results</h1>
+<%
+ final TestResult testResult = (TestResult)session.getAttribute(TestConstants.ATTRIBUTE_TEST_RESULT) ;
+ if (testResult == null)
+ {
+%>
+No JUnit test results generated.
+<%
+ }
+ else
+ {
+ final String type = request.getParameter("type") ;
+
+ Enumeration detailEnum = null ;
+ if (type != null)
+ {
+ if ("error".equals(type))
+ {
+ detailEnum = testResult.errors() ;
+ }
+ else if ("failure".equals(type))
+ {
+ detailEnum = testResult.failures() ;
+ }
+ }
+
+ Integer indexInt = null ;
+ if (detailEnum != null)
+ {
+ final String indexVal = request.getParameter("index") ;
+ try
+ {
+ indexInt = Integer.valueOf(indexVal) ;
+ }
+ catch (final NumberFormatException nfe) {}
+ }
+
+ TestFailure testFailure = null ;
+ if (indexInt != null)
+ {
+ int index = indexInt.intValue() ;
+ if (index > 0)
+ {
+ while(detailEnum.hasMoreElements())
+ {
+ final Object current = detailEnum.nextElement() ;
+ if (--index == 0)
+ {
+ testFailure = (TestFailure)current ;
+ break ;
+ }
+ }
+ }
+ }
+
+ if (testFailure == null)
+ {
+%>
+<p>Invalid request parameters</p>
+<%
+ }
+ else
+ {
+ final TestCase failure = (TestCase)testFailure.failedTest() ;
+%>
+<p>Test: <%= failure.getName() %></p>
+<pre>
+<%= testFailure.trace() %>
+</pre>
+<%
+ }
+ }
+%>
+<p>Return to <a href="results.jsp">results page</a></p>
+</body>
+</html>
\ No newline at end of file
Added: labs/jbosstm/workspace/interop/WSA-interop/web/index.jsp
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/web/index.jsp (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/web/index.jsp 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,53 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"%>
+<%@page import="java.util.Iterator"%>
+<%@page import="java.util.Map"%>
+<%@page import="com.arjuna.webservices.SoapRegistry"%>
+<%@page import="com.jboss.transaction.test.TestConstants"%>
+<%@page import="com.jboss.transaction.webservices.interop.InteropConstants"%>
+
+<%!
+private final static String SERVICE_URI = SoapRegistry.getRegistry().getServiceURI(InteropConstants.SERVICE_INTEROP_TEST) ;%>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>JBoss Transactions WS-Addressing Interop</title>
+</head>
+<body>
+<h1>JBoss Transactions WS-Addressing Interop</h1>
+<h2>Introduction</h2>
+<p>This web application implements a set of interoperability tests specified at the <a href="http://www.w3.org/2002/ws/addr/testsuite/">WS-Addressing testsuite</a> site.</p>
+<p>Please send any queries to the <a href="mailto:kevin.conner at jboss.com?subject=Interop%20query">interop test contact</a></p>
+<h2>Interop tests</h2>
+<form action="test" method="post">
+<p>Service URI: <input name="<%= TestConstants.PARAM_SERVICE_URI %>" maxlength="2000" size="100" value="<%= SERVICE_URI %>"/></p>
+<select name="<%= TestConstants.PARAM_TEST %>">
+<option value="<%= TestConstants.NAME_ALL_TESTS %>">All tests</option>
+<option value="<%= TestConstants.NAME_ALL_SOAP_11_TESTS %>">All SOAP 1.1 tests</option>
+<option value="<%= TestConstants.NAME_ALL_SOAP_12_TESTS %>">All SOAP 1.2 tests</option>
+<%
+
+ final Map descriptions = TestConstants.DESCRIPTIONS ;
+ final Iterator entryIter = descriptions.entrySet().iterator() ;
+ while(entryIter.hasNext())
+ {
+ final Map.Entry entry = (Map.Entry)entryIter.next() ;
+ final String testName = (String)entry.getKey() ;
+ final String testDescription = (String)entry.getValue() ;
+%>
+<option value="<%= testName %>"><%=testName + " - " + testDescription%></option>
+<%
+
+}
+%>
+</select>
+<p>
+Use Test Name: <input type="checkbox" name="<%= TestConstants.PARAM_USE_TEST_NAME %>"/>
+</p>
+<p>
+<input type="submit" value="Execute"/>
+</p>
+</form>
+</body>
+</html>
\ No newline at end of file
Added: labs/jbosstm/workspace/interop/WSA-interop/web/invalidParameters.html
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/web/invalidParameters.html (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/web/invalidParameters.html 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>JBoss Transactions WS-Addressing Interop invalid parameters page</title>
+</head>
+<body>
+Unfortunately the parameters specified are invalid, please resubmit the request. If the request repeatedly fails please contact the <a href="mailto:kevin.conner at jboss.com?subject=Interop%20invalid%20parameters">interop test contact</a>
+<p>Return to <a href="index.jsp">main page</a></p>
+</body>
+</html>
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/web/invalidParameters.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSA-interop/web/results.jsp
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/web/results.jsp (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/web/results.jsp 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,115 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"%>
+<%@page import="com.jboss.transaction.test.TestConstants"%>
+<%@page import="java.util.Enumeration"%>
+<%@page import="junit.framework.TestCase"%>
+<%@page import="junit.framework.TestFailure"%>
+<%@page import="junit.framework.TestResult"%>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>JBoss Transactions WS-Addressing Interop results page</title>
+</head>
+<body>
+<h1>Results</h1>
+<h2>Processed results</h2>
+<%
+ final String logName = (String)session.getAttribute(TestConstants.ATTRIBUTE_LOG_NAME) ;
+ if (logName != null)
+ {
+%>
+<p>View <a href="logs/<%= logName %>">log file</a></p>
+<%
+ }
+ final String validation = (String)session.getAttribute(TestConstants.ATTRIBUTE_TEST_VALIDATION) ;
+ if (validation != null)
+ {
+ if (validation.length() > 0)
+ {
+%>
+Validation failures:
+<pre>
+<%= validation %>
+</pre>
+<%
+ }
+ else
+ {
+%>
+Validation successful
+<%
+ }
+ }
+ else
+ {
+%>
+No validation report generated
+<%
+ }
+%>
+<h2>JUnit results</h2>
+<%
+ final TestResult testResult = (TestResult)session.getAttribute(TestConstants.ATTRIBUTE_TEST_RESULT) ;
+ if (testResult == null)
+ {
+%>
+No JUnit test results generated.
+<%
+ }
+ else
+ {
+ final int runCount = testResult.runCount() ;
+ final int errorCount = testResult.errorCount() ;
+ final int failureCount = testResult.failureCount() ;
+%>
+<p>Run count: <%= runCount %></p>
+<p>Error count: <%= errorCount %></p>
+<p>Failure count: <%= failureCount %></p>
+<%
+ if ((errorCount > 0) || (failureCount > 0))
+ {
+ if (errorCount > 0)
+ {
+ final Enumeration enumeration = testResult.errors() ;
+%>
+<H3>Errors</H3>
+<%
+ int count = 0 ;
+ while(enumeration.hasMoreElements())
+ {
+ final TestFailure testFailure = (TestFailure)enumeration.nextElement() ;
+ count++ ;
+ final TestCase failedTest = (TestCase)testFailure.failedTest() ;
+ final String name = failedTest.getName() ;
+ final String description = (String)TestConstants.DESCRIPTIONS.get(name) ;
+%>
+<p><a href="details.jsp?type=error&index=<%= count %>"><%= name %></a> <%= description %></p>
+<%
+ }
+ }
+ if (failureCount > 0)
+ {
+ final Enumeration enumeration = testResult.failures() ;
+%>
+<H3>Failures</H3>
+<%
+ int count = 0 ;
+ while(enumeration.hasMoreElements())
+ {
+ final TestFailure testFailure = (TestFailure)enumeration.nextElement() ;
+ count++ ;
+ final TestCase failedTest = (TestCase)testFailure.failedTest() ;
+ final String name = failedTest.getName() ;
+ final String description = (String)TestConstants.DESCRIPTIONS.get(name) ;
+%>
+<p><a href="details.jsp?type=failure&index=<%= count %>"><%= name %></a> <%= description %></p>
+<%
+ }
+ }
+ }
+ }
+%>
+<p>Return to <a href="index.jsp">main page</a></p>
+</body>
+</html>
\ No newline at end of file
Added: labs/jbosstm/workspace/interop/WSA-interop/web.xml
===================================================================
--- labs/jbosstm/workspace/interop/WSA-interop/web.xml (rev 0)
+++ labs/jbosstm/workspace/interop/WSA-interop/web.xml 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!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>interop</display-name>
+
+ <description>JBoss Transaction WS-Addressing Interop</description>
+
+ <filter>
+ <filter-name>HTTP Content Type filter</filter-name>
+ <filter-class>com.arjuna.webservices.transport.http.HttpContentTypeFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>HTTP Content Type filter</filter-name>
+ <servlet-name>HTTP SOAP Service Multiplexor Servlet</servlet-name>
+ </filter-mapping>
+
+ <!-- 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 interop services -->
+ <listener>
+ <listener-class>com.jboss.transaction.webservices.interop.server.InteropInitialisation</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.
+ -->
+ <init-param>
+ <param-name>BaseHttpURI</param-name>
+ <param-value>http://@HOST@:@PORT@/interop/soap/</param-value>
+ </init-param>
+ <!--
+ <init-param>
+ <param-name>BaseHttpsURI</param-name>
+ <param-value>https://localhost:8080/arjuna/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>
+ </servlet>
+
+ <servlet>
+ <servlet-name>JUnit test servlet</servlet-name>
+ <servlet-class>com.jboss.transaction.test.TestServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet>
+ <servlet-name>Log servlet</servlet-name>
+ <servlet-class>com.jboss.transaction.test.TestLogServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <!-- servlet mappings -->
+ <servlet-mapping>
+ <servlet-name>HTTP SOAP Service Multiplexor Servlet</servlet-name>
+ <url-pattern>/soap/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>JUnit test servlet</servlet-name>
+ <url-pattern>/test</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>Log servlet</servlet-name>
+ <url-pattern>/logs/*</url-pattern>
+ </servlet-mapping>
+
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ </welcome-file-list>
+</web-app>
Property changes on: labs/jbosstm/workspace/interop/WSA-interop/web.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:keywords
+ Rev Date
Added: labs/jbosstm/workspace/interop/WSTX10-interop/build.xml
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/build.xml (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/build.xml 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,69 @@
+<?xml version="1.0"?>
+<project name="project" default="war">
+ <description>
+ JBoss Transactions WS-Addressing interop test
+ </description>
+
+ <property environment="env"/>
+
+ <property name="host" value="127.0.0.1"/>
+ <property name="port" value="8080"/>
+
+ <property name="jboss.deploy.dir" location="${env.HOME}/jboss-deploy"/>
+
+ <property name="build.dir" location="build"/>
+ <property name="build.classes.dir" location="${build.dir}/classes"/>
+ <property name="build.lib.dir" location="${build.dir}/lib"/>
+ <property name="build.war.file" location="${build.lib.dir}/interop.war"/>
+ <property name="build.webxml.file" location="${build.lib.dir}/web.xml"/>
+
+ <property name="src.dir" location="src"/>
+ <property name="webxml.file" location="web.xml"/>
+ <property name="lib.dir" location="lib"/>
+ <property name="web.dir" location="web"/>
+
+ <property name="dist.compile.libs" value="ws-c.jar ws-t.jar wscf.jar wstx.jar wsas.jar jbossjts.jar jbossts-common.jar stax-api-1.0.jar junit-3.8.1.jar saxon8.jar"/>
+ <property name="dist.dependency.libs" value="wstx-asl-2.0.3.jar"/>
+ <property name="dist.libs" value="${dist.compile.libs} ${dist.dependency.libs}"/>
+ <property name="compile.libs" value="${dist.compile.libs} servlet.jar"/>
+ <property name="compile.debug" value="true"/>
+
+ <path id="classpath">
+ <fileset dir="${lib.dir}" includes="${compile.libs}"/>
+ </path>
+ <property name="classpath" refid="classpath"/>
+
+ <target name="init">
+ <mkdir dir="${build.dir}"/>
+ <mkdir dir="${build.classes.dir}"/>
+ <mkdir dir="${build.lib.dir}"/>
+ </target>
+
+ <target name="compile" depends="init">
+ <javac classpathref="classpath" destdir="${build.classes.dir}" srcdir="${src.dir}" debug="${compile.debug}"/>
+ </target>
+
+ <target name="war" depends="compile">
+ <copy file="${webxml.file}" tofile="${build.webxml.file}" overwrite="yes">
+ <filterset>
+ <filter token="HOST" value="${host}"/>
+ <filter token="PORT" value="${port}"/>
+ </filterset>
+ </copy>
+ <war destfile="${build.war.file}" webxml="${build.webxml.file}">
+ <classes dir="${build.classes.dir}"/>
+ <classes dir="${src.dir}" excludes="**/*.java"/>
+ <lib dir="${lib.dir}" includes="${dist.libs}"/>
+ <fileset dir="${web.dir}"/>
+ </war>
+ </target>
+
+ <target name="deploy" depends="war">
+ <copy file="${build.war.file}" todir="${jboss.deploy.dir}"/>
+ </target>
+
+ <target name="clean">
+ <delete dir="${build.dir}"/>
+ </target>
+</project>
+
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/build.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/lib/jbossjts.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/lib/jbossjts.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/lib/jbossjts.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/lib/ext/jbossjts.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/lib/jbossjts.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX10-interop/lib/jbossts-common.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/lib/jbossts-common.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/lib/jbossts-common.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/lib/ext/jbossts-common.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/lib/jbossts-common.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX10-interop/lib/junit-3.8.1.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/lib/junit-3.8.1.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/lib/junit-3.8.1.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /usr/java/junit3.8.1/junit.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/lib/junit-3.8.1.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX10-interop/lib/saxon8.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/lib/saxon8.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/lib/saxon8.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /usr/java/saxonb8/saxon8.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/lib/saxon8.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX10-interop/lib/servlet.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/lib/servlet.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/lib/servlet.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/lib/ext/servlet.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/lib/servlet.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX10-interop/lib/stax-api-1.0.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/lib/stax-api-1.0.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/lib/stax-api-1.0.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/lib/ext/stax-api-1.0.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/lib/stax-api-1.0.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX10-interop/lib/ws-c.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/lib/ws-c.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/lib/ws-c.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/lib/ws-c.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/lib/ws-c.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX10-interop/lib/ws-t.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/lib/ws-t.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/lib/ws-t.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/lib/ws-t.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/lib/ws-t.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX10-interop/lib/wsas.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/lib/wsas.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/lib/wsas.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/lib/wsas.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/lib/wsas.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX10-interop/lib/wscf.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/lib/wscf.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/lib/wscf.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/lib/wscf.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/lib/wscf.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX10-interop/lib/wstx-asl-2.0.3.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/lib/wstx-asl-2.0.3.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/lib/wstx-asl-2.0.3.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/lib/ext/wstx-asl-2.0.3.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/lib/wstx-asl-2.0.3.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX10-interop/lib/wstx.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/lib/wstx.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/lib/wstx.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/lib/wstx.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/lib/wstx.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/ATTestCase.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/ATTestCase.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/ATTestCase.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,585 @@
+package com.jboss.transaction.txinterop.interop;
+
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.wsat.AtomicTransactionConstants;
+import com.arjuna.webservices.wscoor.CoordinationConstants;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.arjuna.wst.CompletionCoordinatorParticipant;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.jboss.transaction.txinterop.interop.states.ATInteropPreparedAfterTimeoutState;
+import com.jboss.transaction.txinterop.interop.states.ATInteropRetryPreparedAbortState;
+import com.jboss.transaction.txinterop.interop.states.ATInteropRetryPreparedCommitState;
+import com.jboss.transaction.txinterop.interop.states.ATInteropRetryReplayState;
+import com.jboss.transaction.txinterop.interop.states.InteropWaitState;
+import com.jboss.transaction.txinterop.proxy.ProxyConversation;
+import com.jboss.transaction.txinterop.proxy.ProxyURIRewriting;
+import com.jboss.transaction.txinterop.webservices.InteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.AsyncParticipantStub;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropUtil;
+import com.jboss.transaction.txinterop.webservices.atinterop.ParticipantStub;
+import com.jboss.transaction.txinterop.webservices.atinterop.SyncParticipantStub;
+
+/**
+ * The AT endpoint test case
+ * @author kevin
+ */
+public class ATTestCase extends InteropTestCase
+{
+ /**
+ * The coordinator URI of the source.
+ */
+ private static final String SOURCE_COORDINATOR_URI ;
+ /**
+ * The service URI of the participant.
+ */
+ private static final String SOURCE_PARTICIPANT_URI ;
+
+ /**
+ * Construct the named test case.
+ */
+ public ATTestCase()
+ {
+ // Default the service to the local service.
+ setParticipantURI(getSourceParticipantURI()) ;
+ setTestTimeout(120000) ;
+ setAsyncTest(true) ;
+ }
+
+ /**
+ * testAT1_1 - 1.1 CompletionCommit
+ * Participant creates and commits a transaction using the initiator's coordinator.
+ * @throws Exception on failure.
+ */
+ public void testAT1_1()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_COMMITTED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final String coordinatorURI = ProxyURIRewriting.rewriteURI(ProxyConversation.getAlternateConversationId(conversationId), getSourceCoordinatorURI()) ;
+ getParticipantStub().completionCommit(serviceURI, coordinatorURI) ;
+ state.waitForCompletion(getTestTimeout()) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT1_2 - 1.2 CompletionRollback
+ * Participant creates and rolls back a transaction using the initiator's coordinator.
+ * @throws Exception on failure.
+ */
+ public void testAT1_2()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_ABORTED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final String coordinatorURI = ProxyURIRewriting.rewriteURI(ProxyConversation.getAlternateConversationId(conversationId), getSourceCoordinatorURI()) ;
+ getParticipantStub().completionRollback(serviceURI, coordinatorURI) ;
+ state.waitForCompletion(getTestTimeout()) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT2_1 - 2.1 Commit
+ * Participant registers for Durable2PC, initiator commits, transaction commits successfully.
+ * @throws Exception on failure.
+ */
+ public void testAT2_1()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_COMMITTED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().commit(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT2_2 - 2.2 Rollback
+ * Participant registers for Durable2PC, initiator rolls back.
+ * @throws Exception on failure.
+ */
+ public void testAT2_2()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_ABORTED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().rollback(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.rollback() ;
+
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT3_1 - 3.1 Phase2Rollback
+ * Coordinator aborts the transaction due to an Aborted vote during the prepare phase.
+ * @throws Exception on failure.
+ */
+ public void testAT3_1()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_ABORTED, 2) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().phase2Rollback(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+ fail("Transaction rollback expected") ;
+ }
+ catch (final TransactionRolledBackException trbe)
+ {
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT3_2 - 3.2 Readonly
+ * Tests coordinator committing a transaction with a read only participant.
+ * @throws Exception on failure.
+ */
+ public void testAT3_2()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_COMMITTED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().readonly(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT3_3 - 3.3 VolatileAndDurable
+ * Tests registration during the volatile prepare phase.
+ * @throws Exception on failure.
+ */
+ public void testAT3_3()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_COMMITTED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().volatileAndDurable(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT4_1 - 4.1 EarlyReadonly
+ * Tests the case of a participant initiated ReadOnly message occurring prior to the prepare phase.
+ * @throws Exception on failure.
+ */
+ public void testAT4_1()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_COMMITTED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().earlyReadonly(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT4_2 - 4.2 EarlyAborted
+ * Tests the case of a participant initiated Aborted message occurring prior to the prepare phase.
+ * @throws Exception on failure.
+ */
+ public void testAT4_2()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_ABORTED, 2) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().earlyAborted(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+ fail("Transaction rollback expected") ;
+ }
+ catch (final TransactionRolledBackException trbe)
+ {
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT5_1 - 5.1 ReplayAbort
+ * Participant registers for Durable2PC, initator initiates commit, participant fails after prepared, recovers and sends replay. Transaction aborts.
+ * @throws Exception on failure.
+ */
+ public void testAT5_1()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_ABORTED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().replayAbort(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+ fail("Transaction rollback expected") ;
+ }
+ catch (final TransactionRolledBackException trbe)
+ {
+ state.waitForCompletion(getTestTimeout()) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT5_2 - 5.2 ReplayCommit
+ * Participant registers for Durable2PC, initator initiates commit, participant fails after prepared, recovers and sends replay. Transaction commits normally.
+ * @throws Exception on failure.
+ */
+ public void testAT5_2()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_COMMITTED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().replayCommit(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT5_3 - 5.3 RetryPreparedCommit
+ * Tests recovery from a communication failure during the prepare phase. Transaction commits normally.
+ * @throws Exception on failure.
+ */
+ public void testAT5_3()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final ATInteropRetryPreparedCommitState state = new ATInteropRetryPreparedCommitState() ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().retryPreparedCommit(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT5_4 - 5.4 RetryPreparedAbort
+ * Tests recovery from a communication failure during the prepare phase. Transaction times out.
+ * @throws Exception on failure.
+ */
+ public void testAT5_4()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final ATInteropRetryPreparedAbortState state = new ATInteropRetryPreparedAbortState() ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().retryPreparedAbort(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+ fail("Transaction rollback expected") ;
+ }
+ catch (final TransactionRolledBackException trbe)
+ {
+ state.waitForCompletion(getTestTimeout()) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT5_5 - 5.5 RetryCommit
+ * Tests recovery from a communication failure during the commit phase. Transaction commits normally.
+ * @throws Exception on failure.
+ */
+ public void testAT5_5()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_COMMITTED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().retryCommit(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT5_6 - 5.6 RetryReplay
+ * Tests recovery from a communication failure during the commit phase. Transaction commits normally.
+ * @throws Exception on failure.
+ */
+ public void testAT5_6()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final ATInteropRetryReplayState state = new ATInteropRetryReplayState() ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().retryReplay(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+ fail("Transaction rollback expected") ;
+ }
+ catch (final TransactionRolledBackException trbe)
+ {
+ state.waitForCompletion(getTestTimeout()) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT5_7 - 5.7 PreparedAfterTimeout
+ * Tests recovery from a communication failure during the prepare phase. Transaction times out. Two participants, volatile and durable.
+ * @throws Exception on failure.
+ */
+ public void testAT5_7()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final ATInteropPreparedAfterTimeoutState state = new ATInteropPreparedAfterTimeoutState() ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().preparedAfterTimeout(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+ fail("Transaction rollback expected") ;
+ }
+ catch (final SystemException se)
+ {
+ state.waitForCompletion(getTestTimeout()) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT5_8 - 5.8 LostCommitted
+ * Tests the effect of a lost Committed message.
+ * @throws Exception on failure.
+ */
+ public void testAT5_8()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_COMMITTED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().lostCommitted(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * Get the source coordinator URI.
+ * @return The source coordinator uri.
+ */
+ protected static String getSourceCoordinatorURI()
+ {
+ return SOURCE_COORDINATOR_URI ;
+ }
+
+ /**
+ * Get the source participant URI.
+ * @return The source participant uri.
+ */
+ protected static String getSourceParticipantURI()
+ {
+ return SOURCE_PARTICIPANT_URI ;
+ }
+
+ /**
+ * Get the participant stub for the test.
+ * @return The participant stub.
+ */
+ private ParticipantStub getParticipantStub()
+ {
+ return (getAsyncTest() ? AsyncParticipantStub.getParticipantStub() : SyncParticipantStub.getParticipantStub()) ;
+ }
+
+ static
+ {
+ final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+ SOURCE_PARTICIPANT_URI = soapRegistry.getServiceURI(InteropConstants.SERVICE_PARTICIPANT) ;
+ SOURCE_COORDINATOR_URI = soapRegistry.getServiceURI(CoordinationConstants.SERVICE_ACTIVATION_COORDINATOR) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/ATTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/BATestCase.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/BATestCase.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/BATestCase.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,555 @@
+package com.jboss.transaction.txinterop.interop;
+
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.wsba.BusinessActivityConstants;
+import com.arjuna.webservices.wscoor.CoordinationConstants;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.arjuna.wst.BusinessActivityTerminator;
+import com.jboss.transaction.txinterop.interop.states.BAInteropParticipantCompletedState;
+import com.jboss.transaction.txinterop.interop.states.InteropWaitState;
+import com.jboss.transaction.txinterop.proxy.ProxyConversation;
+import com.jboss.transaction.txinterop.proxy.ProxyURIRewriting;
+import com.jboss.transaction.txinterop.webservices.InteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.AsyncParticipantStub;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropUtil;
+import com.jboss.transaction.txinterop.webservices.bainterop.ParticipantStub;
+import com.jboss.transaction.txinterop.webservices.bainterop.SyncParticipantStub;
+
+/**
+ * The BA endpoint test case
+ * @author kevin
+ */
+public class BATestCase extends InteropTestCase
+{
+ /**
+ * The coordinator URI of the source.
+ */
+ private static final String SOURCE_COORDINATOR_URI ;
+ /**
+ * The service URI of the participant.
+ */
+ private static final String SOURCE_PARTICIPANT_URI ;
+
+ /**
+ * Construct the named test case.
+ */
+ public BATestCase()
+ {
+ // Default the service to the local service.
+ setParticipantURI(getSourceParticipantURI()) ;
+ setTestTimeout(120000) ;
+ setAsyncTest(true) ;
+ }
+
+ /**
+ * testBA1_1 - 1.1 ParticipantClosed
+ * The PA successfully completes its work on behalf of the activity and the activity is closed.
+ * @throws Exception on failure.
+ */
+ public void testBA1_1()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final BAInteropParticipantCompletedState state = new BAInteropParticipantCompletedState(BusinessActivityConstants.WSBA_ACTION_CLOSED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().participantClosed(serviceURI, context) ;
+
+ assertTrue("Participant did not issue Completed", state.waitForParticipantCompleted(getTestTimeout())) ;
+
+ final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
+ terminator.close() ;
+
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testBA1_2 - 1.2 ParticipantCompensated
+ * The PA successfully completes its work on behalf of the activity and the activity is compensated.
+ * @throws Exception on failure.
+ */
+ public void testBA1_2()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final BAInteropParticipantCompletedState state = new BAInteropParticipantCompletedState(BusinessActivityConstants.WSBA_ACTION_COMPENSATED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().participantCompensated(serviceURI, context) ;
+
+ assertTrue("Participant did not issue Completed", state.waitForParticipantCompleted(getTestTimeout())) ;
+
+ final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
+ terminator.cancel() ;
+
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testBA1_3 - 1.3 ParticipantCanceled
+ * The IA cancels the activity before the PA completes its work on behalf of the activity.
+ * @throws Exception on failure.
+ */
+ public void testBA1_3()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(BusinessActivityConstants.WSBA_ACTION_CANCELLED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().participantCanceled(serviceURI, context) ;
+
+ final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
+ terminator.cancel() ;
+
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+// private void XXX()
+// {
+// final String conversationId = getConversationId() ;
+// final InteropWaitState state = new InteropWaitState(BusinessActivityConstants.WSBA_ACTION_CANCELLED) ;
+// ProxyConversation.setConversationState(conversationId, state) ;
+// try
+// {
+// final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+// final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+// getParticipantStub().cancel(serviceURI, context) ;
+//
+// final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
+// terminator.cancel() ;
+//
+// state.waitForCompletion(0) ;
+// }
+// finally
+// {
+// ProxyConversation.clearConversationState(conversationId) ;
+// }
+// assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+// fail("not yet implemented") ;
+// }
+
+ /**
+ * testBA1_4 - 1.4 ParticipantExit
+ * The PA exits without completing any work on behalf of the activity.
+ * @throws Exception on failure.
+ */
+ public void testBA1_4()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(BusinessActivityConstants.WSBA_ACTION_EXITED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().participantExit(serviceURI, context) ;
+
+ state.waitForCompletion(getTestTimeout()) ;
+
+ final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
+ terminator.cancel() ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testBA1_5 - 1.5 ParticipantFault
+ * The PA fails before completing its work on behalf of the activity.
+ * @throws Exception on failure.
+ */
+ public void testBA1_5()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(BusinessActivityConstants.WSBA_ACTION_FAULTED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().participantFault(serviceURI, context) ;
+
+ state.waitForCompletion(getTestTimeout()) ;
+
+ final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
+ terminator.cancel() ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testBA1_6 - 1.6 ParticipantCompensationFault
+ * The PA successfully completes its work on behalf of the activity but compensation fails..
+ * @throws Exception on failure.
+ */
+ public void testBA1_6()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final BAInteropParticipantCompletedState state = new BAInteropParticipantCompletedState(BusinessActivityConstants.WSBA_ACTION_FAULTED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().participantCompensationFault(serviceURI, context) ;
+
+ assertTrue("Participant did not issue Completed", state.waitForParticipantCompleted(getTestTimeout())) ;
+
+ final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
+ terminator.cancel() ;
+
+ state.waitForCompletion(getTestTimeout()) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+//
+// /**
+// * testBA1_4 - 1.4 CannotComplete
+// * The PA sends CannotComplete before completing its work on behalf of the activity.
+// * @throws Exception on failure.
+// */
+// public void testBA1_4()
+// throws Exception
+// {
+//// final String conversationId = getConversationId() ;
+//// final InteropWaitState state = new InteropWaitState(BusinessActivityConstants.WSBA_ACTION_NOT_COMPLETED) ;
+//// ProxyConversation.setConversationState(conversationId, state) ;
+//// try
+//// {
+//// final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+//// final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+//// getParticipantStub().cannotComplete(serviceURI, context) ;
+////
+//// state.waitForCompletion(getTestTimeout()) ;
+////
+//// final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
+//// terminator.cancel() ;
+//// }
+//// finally
+//// {
+//// ProxyConversation.clearConversationState(conversationId) ;
+//// }
+//// assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+// fail("not yet implemented") ;
+// }
+//
+// /**
+// * testBA1_5 - 1.5 ParticipantCompleteClose
+// * The PA successfully completes its work on behalf of the activity and the activity is closed.
+// * @throws Exception on failure.
+// */
+// public void testBA1_5()
+// throws Exception
+// {
+//// final String conversationId = getConversationId() ;
+//// final BAInteropParticipantCompletedState state = new BAInteropParticipantCompletedState(BusinessActivityConstants.WSBA_ACTION_CLOSED) ;
+//// ProxyConversation.setConversationState(conversationId, state) ;
+//// try
+//// {
+//// final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+//// final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+//// getParticipantStub().participantCompleteClose(serviceURI, context) ;
+////
+//// assertTrue("Participant did not issue Completed", state.waitForParticipantCompleted(getTestTimeout())) ;
+////
+//// final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
+//// terminator.close() ;
+////
+//// state.waitForCompletion(0) ;
+//// }
+//// finally
+//// {
+//// ProxyConversation.clearConversationState(conversationId) ;
+//// }
+//// assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+// fail("not yet implemented") ;
+// }
+//
+// /**
+// * testBA1_6 - 1.6 CoordinatorCompleteClose
+// * The PA successfully completes its work on behalf of the activity and the activity is closed.
+// * @throws Exception on failure.
+// */
+// public void testBA1_6()
+// throws Exception
+// {
+//// final String conversationId = getConversationId() ;
+//// final InteropWaitState state = new InteropWaitState(BusinessActivityConstants.WSBA_ACTION_CLOSED) ;
+//// ProxyConversation.setConversationState(conversationId, state) ;
+//// try
+//// {
+//// final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+//// final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+//// getParticipantStub().coordinatorCompleteClose(serviceURI, context) ;
+////
+//// final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
+//// terminator.complete() ;
+//// terminator.close() ;
+////
+//// state.waitForCompletion(0) ;
+//// }
+//// finally
+//// {
+//// ProxyConversation.clearConversationState(conversationId) ;
+//// }
+//// assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+// fail("not yet implemented") ;
+// }
+
+// /**
+// * testBA1_7 - 1.7 UnsolicitedComplete
+// * Tests a protocol error, participant send Completed for coordinator completion. Throws an invalid state fault.
+// * @throws Exception on failure.
+// */
+// public void testBA1_7()
+// throws Exception
+// {
+// final String conversationId = getConversationId() ;
+// final BAInteropUnsolicitedCompleteState state = new BAInteropUnsolicitedCompleteState() ;
+// ProxyConversation.setConversationState(conversationId, state) ;
+// try
+// {
+// final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+// final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+// getParticipantStub().unsolicitedComplete(serviceURI, context) ;
+//
+// state.waitForCompletion(getTestTimeout()) ;
+//
+// final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
+// terminator.cancel() ;
+// }
+// finally
+// {
+// ProxyConversation.clearConversationState(conversationId) ;
+// }
+// assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+// }
+////
+// /**
+// * testBA1_8 - 1.8 Compensate
+// * The PA successfully completes its work on behalf of the activity and the activity is compensated.
+// * @throws Exception on failure.
+// */
+// public void testBA1_8()
+// throws Exception
+// {
+// final String conversationId = getConversationId() ;
+// final BAInteropParticipantCompletedState state = new BAInteropParticipantCompletedState(BusinessActivityConstants.WSBA_ACTION_COMPENSATED) ;
+// ProxyConversation.setConversationState(conversationId, state) ;
+// try
+// {
+// final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+// final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+// getParticipantStub().participantCompleteClose(serviceURI, context) ;
+//
+// assertTrue("Participant did not issue Completed", state.waitForParticipantCompleted(getTestTimeout())) ;
+//
+// final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
+// terminator.cancel() ;
+//
+// state.waitForCompletion(0) ;
+// }
+// finally
+// {
+// ProxyConversation.clearConversationState(conversationId) ;
+// }
+// assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+// }
+//
+// /**
+// * testBA1_9 - 1.9 CompensationFail
+// * The PA successfully completes its work on behalf of the activity but compensation fails..
+// * @throws Exception on failure.
+// */
+// public void testBA1_9()
+// throws Exception
+// {
+// final String conversationId = getConversationId() ;
+// final BAInteropParticipantCompletedState state = new BAInteropParticipantCompletedState(BusinessActivityConstants.WSBA_ACTION_FAILED) ;
+// ProxyConversation.setConversationState(conversationId, state) ;
+// try
+// {
+// final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+// final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+// getParticipantStub().compensationFail(serviceURI, context) ;
+//
+// assertTrue("Participant did not issue Completed", state.waitForParticipantCompleted(getTestTimeout())) ;
+//
+// final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
+// terminator.cancel() ;
+//
+// state.waitForCompletion(getTestTimeout()) ;
+// }
+// finally
+// {
+// ProxyConversation.clearConversationState(conversationId) ;
+// }
+// assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+// }
+//
+// /**
+// * testBA1_10 - 1.10 ParticipantCancelCompletedRace
+// * Simulate a race between cancel and completed.
+// * @throws Exception on failure.
+// */
+// public void testBA1_10()
+// throws Exception
+// {
+// final String conversationId = getConversationId() ;
+// final BAInteropDroppedParticipantCompletedState state = new BAInteropDroppedParticipantCompletedState(BusinessActivityConstants.WSBA_ACTION_COMPENSATED) ;
+// ProxyConversation.setConversationState(conversationId, state) ;
+// try
+// {
+// final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+// final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+// getParticipantStub().participantCancelCompletedRace(serviceURI, context) ;
+//
+// assertTrue("Participant did not issue Completed", state.waitForParticipantCompleted(getTestTimeout())) ;
+//
+// final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
+// terminator.cancel() ;
+//
+// state.waitForCompletion(getTestTimeout()) ;
+// }
+// finally
+// {
+// ProxyConversation.clearConversationState(conversationId) ;
+// }
+// assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+// }
+//
+// /**
+// * testBA1_11 - 1.11 MessageLossAndRecovery
+// * The IA cancels the activity before the PA completes its work on behalf of the activity.
+// * @throws Exception on failure.
+// */
+// public void testBA1_11()
+// throws Exception
+// {
+// final String conversationId = getConversationId() ;
+// final InteropWaitState state = new InteropWaitState(BusinessActivityConstants.WSBA_ACTION_COMPENSATED) ;
+// ProxyConversation.setConversationState(conversationId, state) ;
+// try
+// {
+// final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+// final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+// getParticipantStub().messageLossAndRecovery(serviceURI, context) ;
+//
+// final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
+// terminator.complete() ;
+// terminator.cancel() ;
+//
+// state.waitForCompletion(0) ;
+// }
+// finally
+// {
+// ProxyConversation.clearConversationState(conversationId) ;
+// }
+// assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+// }
+//
+//// /**
+//// * testBA1_12 - 1.12 MixedOutcome
+//// * The IA cancels the activity before the PA completes its work on behalf of the activity.
+//// * @throws Exception on failure.
+//// */
+//// public void testBA1_12()
+//// throws Exception
+//// {
+//// final String conversationId = getConversationId() ;
+//// final ATInteropWaitState state = new ATInteropWaitState(BusinessActivityConstants.WSAT_ACTION_COMMITTED) ;
+//// ProxyConversation.setConversationState(conversationId, state) ;
+//// try
+//// {
+//// final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+//// final CoordinationContextType context = BAInteropUtil.createMixedOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+//// getParticipantStub().commit(serviceURI, context) ;
+////
+//// final CompletionCoordinatorParticipant participant = BAInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+//// participant.commit() ;
+////
+//// state.waitForCompletion(getTestTimeout()) ;
+//// }
+//// finally
+//// {
+//// ProxyConversation.clearConversationState(conversationId) ;
+//// }
+//// assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+//// }
+
+ /**
+ * Get the source coordinator URI.
+ * @return The source coordinator uri.
+ */
+ protected static String getSourceCoordinatorURI()
+ {
+ return SOURCE_COORDINATOR_URI ;
+ }
+
+ /**
+ * Get the source participant URI.
+ * @return The source participant uri.
+ */
+ protected static String getSourceParticipantURI()
+ {
+ return SOURCE_PARTICIPANT_URI ;
+ }
+
+ /**
+ * Get the participant stub for the test.
+ * @return The participant stub.
+ */
+ private ParticipantStub getParticipantStub()
+ {
+ return (getAsyncTest() ? AsyncParticipantStub.getParticipantStub() : SyncParticipantStub.getParticipantStub()) ;
+ }
+
+ static
+ {
+ final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+ SOURCE_PARTICIPANT_URI = soapRegistry.getServiceURI(InteropConstants.SERVICE_PARTICIPANT) ;
+ SOURCE_COORDINATOR_URI = soapRegistry.getServiceURI(CoordinationConstants.SERVICE_ACTIVATION_COORDINATOR) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/BATestCase.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/InteropTestCase.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/InteropTestCase.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/InteropTestCase.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,162 @@
+package com.jboss.transaction.txinterop.interop;
+
+import junit.framework.TestCase;
+import junit.framework.TestResult;
+
+import com.jboss.transaction.txinterop.proxy.ProxyConversation;
+
+/**
+ * Base class for interop tests.
+ * @author kevin
+ */
+public class InteropTestCase extends TestCase
+{
+ /**
+ * The log message prefix start.
+ */
+ private static final String LOG_MESSAGE_PREFIX_START = "<log:message testcase=\"" ;
+ /**
+ * The log message prefix centre.
+ */
+ private static final String LOG_MESSAGE_PREFIX_CENTRE = "\" message=\"" ;
+ /**
+ * The log message prefix end.
+ */
+ private static final String LOG_MESSAGE_PREFIX_END = "\"><log:content>" ;
+ /**
+ * The log message suffix.
+ */
+ private static final String LOG_MESSAGE_SUFFIX = "</log:content></log:message>" ;
+
+ /**
+ * The URI of the participant.
+ */
+ private String participantURI ;
+
+ /**
+ * The conversation id for the test.
+ */
+ private String conversationId ;
+
+ /**
+ * The test timeout value.
+ */
+ private long testTimeout ;
+ /**
+ * The asynchronous test flag.
+ */
+ private boolean asyncTest ;
+
+ /**
+ * Set the participant URI.
+ * @param serviceURI The participant URI.
+ */
+ public void setParticipantURI(final String participantURI)
+ {
+ this.participantURI = participantURI ;
+ }
+
+ /**
+ * Get the participant URI.
+ * @return The participant URI.
+ */
+ protected String getParticipantURI()
+ {
+ return participantURI ;
+ }
+
+ /**
+ * Set the test timeout value.
+ * testTimeout The test timeout value.
+ */
+ public void setTestTimeout(final long testTimeout)
+ {
+ this.testTimeout = testTimeout ;
+ }
+
+ /**
+ * Get the asynchronous test flag.
+ * @return The asynchronous test flag.
+ */
+ protected boolean getAsyncTest()
+ {
+ return asyncTest ;
+ }
+
+ /**
+ * Set the asynchronous test flag.
+ * asyncTest The asynchronous test flag.
+ */
+ public void setAsyncTest(final boolean asyncTest)
+ {
+ this.asyncTest = asyncTest ;
+ }
+
+ /**
+ * Get the test timeout value.
+ * @return The test timeout value.
+ */
+ protected long getTestTimeout()
+ {
+ return testTimeout ;
+ }
+
+ /**
+ * Get the conversation id.
+ * @return The conversation id.
+ */
+ protected String getConversationId()
+ {
+ return conversationId ;
+ }
+
+ /**
+ * Wraps the run method to include logging of message interactions.
+ * @param result The test result.
+ */
+ public void run(final TestResult result)
+ {
+ // get a conversation id, start the log, clear it on finish.
+ conversationId = ProxyConversation.createConversation() ;
+ try
+ {
+ super.run(result) ;
+ }
+ finally
+ {
+ final String[] messages = ProxyConversation.removeConversation(conversationId) ;
+ conversationId = null ;
+ if (messages != null)
+ {
+ final int numMessages = messages.length ;
+ final StringBuffer buffer = new StringBuffer() ;
+ int count = 0 ;
+ while(count < numMessages)
+ {
+ final String message = messages[count] ;
+ count++ ;
+ if (message != null)
+ {
+ buffer.append(LOG_MESSAGE_PREFIX_START) ;
+ buffer.append(getName()) ;
+ buffer.append(LOG_MESSAGE_PREFIX_CENTRE) ;
+ buffer.append(count) ;
+ buffer.append(LOG_MESSAGE_PREFIX_END) ;
+ buffer.append(message) ;
+ buffer.append(LOG_MESSAGE_SUFFIX) ;
+ }
+ }
+ MessageLogging.appendThreadLog(buffer.toString()) ;
+ }
+ }
+ }
+
+ /**
+ * Return the string represenation of this test.
+ * @return the string representation.
+ */
+ public String toString()
+ {
+ return getName() ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/InteropTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/InteropTestSuite.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/InteropTestSuite.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/InteropTestSuite.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,111 @@
+package com.jboss.transaction.txinterop.interop;
+
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Interop testsuite to initialise the participant uri on addition.
+ * @author kevin
+ */
+public class InteropTestSuite extends TestSuite
+{
+ /**
+ * The participant URI for this test.
+ */
+ private final String participantURI ;
+ /**
+ * The test timeout.
+ */
+ private final long testTimeout ;
+ /**
+ * The asynchronous test flag.
+ */
+ private final boolean asyncTest ;
+
+ /**
+ * Construct an empty test suite with the specified participant URI.
+ * @param testTimeout The test timeout.
+ * @param participantURI The participant URI.
+ */
+ public InteropTestSuite(final String participantURI, final long testTimeout, final boolean asyncTest)
+ {
+ super() ;
+ this.participantURI = participantURI ;
+ this.testTimeout = testTimeout ;
+ this.asyncTest = asyncTest ;
+ }
+
+ /**
+ * Construct an empty test suite with the specified participant URI and name.
+ * @param participantURI The participant URI.
+ * @param testTimeout The test timeout.
+ * @param name The name of the test suite.
+ */
+ public InteropTestSuite(final String participantURI, final long testTimeout, final boolean asyncTest, final String name)
+ {
+ super(name) ;
+ this.participantURI = participantURI ;
+ this.testTimeout = testTimeout ;
+ this.asyncTest = asyncTest ;
+ }
+
+ /**
+ * Constructs a TestSuite from the given class using the specified participant URI.
+ * @param participantURI The participant URI.
+ * @param testTimeout The test timeout.
+ * @param clazz The class containing the tests.
+ */
+ public InteropTestSuite(final String participantURI, final long testTimeout, final boolean asyncTest, final Class clazz)
+ {
+ super(clazz) ;
+ this.participantURI = participantURI ;
+ this.testTimeout = testTimeout ;
+ this.asyncTest = asyncTest ;
+ final int numTests = countTestCases() ;
+ for(int count = 0 ; count < numTests ; count++)
+ {
+ initialiseTest(testAt(count)) ;
+ }
+ }
+
+ /**
+ * Constructs a TestSuite from the given class using the specified participant URI and name.
+ * @param participantURI The participant URI.
+ * @param testTimeout The test timeout.
+ * @param clazz The class containing the tests.
+ * @param name The name of the test suite.
+ */
+ public InteropTestSuite(final String participantURI, final long testTimeout, final boolean asyncTest, final Class clazz, final String name)
+ {
+ super(clazz, name) ;
+ this.participantURI = participantURI ;
+ this.testTimeout = testTimeout ;
+ this.asyncTest = asyncTest ;
+ }
+
+ /**
+ * Add a test to the test suite.
+ * @param test The test to add.
+ */
+ public void addTest(final Test test)
+ {
+ initialiseTest(test) ;
+ super.addTest(test) ;
+ }
+
+ /**
+ * Perform initialisation on the test.
+ * @param test The test to initialise.
+ */
+ private void initialiseTest(final Test test)
+ {
+ if (test instanceof InteropTestCase)
+ {
+ final InteropTestCase interopTestCase = (InteropTestCase)test ;
+ interopTestCase.setParticipantURI(participantURI) ;
+ interopTestCase.setTestTimeout(testTimeout) ;
+ interopTestCase.setAsyncTest(asyncTest) ;
+ }
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/InteropTestSuite.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/MessageLogging.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/MessageLogging.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/MessageLogging.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,51 @@
+package com.jboss.transaction.txinterop.interop;
+
+/**
+ * Class providing test message logging.
+ * @author kevin
+ */
+public class MessageLogging
+{
+ /**
+ * The thread local message log.
+ */
+ private static final ThreadLocal MESSAGE_LOG = new ThreadLocal() ;
+
+ /**
+ * 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() ;
+ return (value == null ? "" : value.toString()) ;
+ }
+
+ /**
+ * 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 StringBuffer buffer ;
+ if (value == null)
+ {
+ buffer = new StringBuffer(message) ;
+ MESSAGE_LOG.set(buffer) ;
+ }
+ else
+ {
+ buffer = (StringBuffer)value ;
+ buffer.append(message) ;
+ }
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/MessageLogging.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropPreparedAfterTimeoutState.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropPreparedAfterTimeoutState.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropPreparedAfterTimeoutState.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,70 @@
+package com.jboss.transaction.txinterop.interop.states;
+
+import com.arjuna.webservices.wsat.AtomicTransactionConstants;
+
+/**
+ * A conversation state for prepare after timeout test.
+ */
+public class ATInteropPreparedAfterTimeoutState extends BaseState
+{
+ /**
+ * The prepared count.
+ */
+ private int preparedCount ;
+ /**
+ * The rollback count.
+ */
+ private int rollbackCount ;
+ /**
+ * Are we dropping other messages?
+ */
+ private boolean drop ;
+ /**
+ * Aborted flag.
+ */
+ private boolean aborted ;
+ /**
+ * Soap Fault flag.
+ */
+ private boolean soapFault ;
+
+ /**
+ * Handle the next action in the sequence.
+ * @param action The SOAP action.
+ * @param identifier The identifier associated with the endpoint.
+ * @return true if the message should be dropped, false otherwise.
+ */
+ public boolean handleAction(final String action, final String identifier)
+ {
+ if (AtomicTransactionConstants.WSAT_ACTION_PREPARED.equals(action))
+ {
+ if (++preparedCount == 2)
+ {
+ drop = true ;
+ }
+ }
+ else if (AtomicTransactionConstants.WSAT_ACTION_ROLLBACK.equals(action))
+ {
+ if (++rollbackCount == 2)
+ {
+ drop = false ;
+ return true ;
+ }
+ }
+ else if (AtomicTransactionConstants.WSAT_ACTION_ABORTED.equals(action))
+ {
+ aborted = true ;
+ }
+ else if (AtomicTransactionConstants.WSAT_ACTION_FAULT.equals(action))
+ {
+ soapFault = true ;
+ }
+
+ if (aborted && soapFault)
+ {
+ success() ;
+ }
+
+ return drop ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropPreparedAfterTimeoutState.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropRetryPreparedAbortState.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropRetryPreparedAbortState.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropRetryPreparedAbortState.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,51 @@
+package com.jboss.transaction.txinterop.interop.states;
+
+import com.arjuna.webservices.wsat.AtomicTransactionConstants;
+
+/**
+ * A conversation state for retry prepared abort test.
+ */
+public class ATInteropRetryPreparedAbortState extends BaseState
+{
+ /**
+ * Have we had the first prepare?
+ */
+ private boolean firstPrepare ;
+ /**
+ * Are we dropping other messages?
+ */
+ private boolean drop ;
+
+ /**
+ * Handle the next action in the sequence.
+ * @param action The SOAP action.
+ * @param identifier The identifier associated with the endpoint.
+ * @return true if the message should be dropped, false otherwise.
+ */
+ public boolean handleAction(final String action, final String identifier)
+ {
+ if (AtomicTransactionConstants.WSAT_ACTION_PREPARE.equals(action))
+ {
+ if (!firstPrepare)
+ {
+ firstPrepare = true ;
+ drop = true ;
+ return false ;
+ }
+ return true ;
+ }
+ if (AtomicTransactionConstants.WSAT_ACTION_ROLLBACK.equals(action))
+ {
+ if (drop)
+ {
+ drop = false ;
+ return true ;
+ }
+ }
+ else if (AtomicTransactionConstants.WSAT_ACTION_ABORTED.equals(action))
+ {
+ success() ;
+ }
+ return drop ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropRetryPreparedAbortState.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropRetryPreparedCommitState.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropRetryPreparedCommitState.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropRetryPreparedCommitState.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,45 @@
+package com.jboss.transaction.txinterop.interop.states;
+
+import com.arjuna.webservices.wsat.AtomicTransactionConstants;
+
+/**
+ * A conversation state for retry prepared commit state.
+ */
+public class ATInteropRetryPreparedCommitState extends BaseState
+{
+ /**
+ * The prepared count.
+ */
+ private int preparedCount ;
+ /**
+ * Are we dropping other messages?
+ */
+ private boolean drop ;
+
+ /**
+ * Handle the next action in the sequence.
+ * @param action The SOAP action.
+ * @param identifier The identifier associated with the endpoint.
+ * @return true if the message should be dropped, false otherwise.
+ */
+ public boolean handleAction(final String action, final String identifier)
+ {
+ if (AtomicTransactionConstants.WSAT_ACTION_PREPARED.equals(action))
+ {
+ preparedCount++ ;
+ if (preparedCount == 1)
+ {
+ drop = true ;
+ }
+ else
+ {
+ drop = false ;
+ }
+ }
+ else if (AtomicTransactionConstants.WSAT_ACTION_COMMITTED.equals(action))
+ {
+ success() ;
+ }
+ return drop ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropRetryPreparedCommitState.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropRetryReplayState.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropRetryReplayState.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropRetryReplayState.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,46 @@
+package com.jboss.transaction.txinterop.interop.states;
+
+import com.arjuna.webservices.wsat.AtomicTransactionConstants;
+
+/**
+ * A conversation state for retry replay state.
+ */
+public class ATInteropRetryReplayState extends BaseState
+{
+ /**
+ * The prepare count.
+ */
+ private int prepareCount ;
+ /**
+ * Are we dropping other messages?
+ */
+ private boolean drop ;
+
+ /**
+ * Handle the next action in the sequence.
+ * @param action The SOAP action.
+ * @param identifier The identifier associated with the endpoint.
+ * @return true if the message should be dropped, false otherwise.
+ */
+ public boolean handleAction(final String action, final String identifier)
+ {
+ if (AtomicTransactionConstants.WSAT_ACTION_PREPARE.equals(action))
+ {
+ prepareCount++ ;
+ if (prepareCount == 1)
+ {
+ drop = true ;
+ return false ;
+ }
+ }
+ else if (AtomicTransactionConstants.WSAT_ACTION_ROLLBACK.equals(action))
+ {
+ drop = false ;
+ }
+ else if (AtomicTransactionConstants.WSAT_ACTION_ABORTED.equals(action))
+ {
+ success() ;
+ }
+ return drop ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropRetryReplayState.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/BAInteropParticipantCompletedState.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/BAInteropParticipantCompletedState.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/BAInteropParticipantCompletedState.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,88 @@
+package com.jboss.transaction.txinterop.interop.states;
+
+import com.arjuna.webservices.wsba.BusinessActivityConstants;
+
+
+/**
+ * A conversation state for waiting on participant completed.
+ */
+public class BAInteropParticipantCompletedState extends BaseState
+{
+ /**
+ * The last action.
+ */
+ private final String lastAction ;
+ /**
+ * The participant completed flag.
+ */
+ private boolean participantCompleted ;
+
+ /**
+ * Construct the participant completed test.
+ * @param lastAction The last action.
+ */
+ public BAInteropParticipantCompletedState(final String lastAction)
+ {
+ this.lastAction = lastAction ;
+ }
+
+ /**
+ * Handle the next action in the sequence.
+ * @param action The SOAP action.
+ * @param identifier The identifier associated with the endpoint.
+ * @return true if the message should be dropped, false otherwise.
+ */
+ public synchronized boolean handleAction(final String action, final String identifier)
+ {
+ if (BusinessActivityConstants.WSBA_ACTION_COMPLETED.equals(action))
+ {
+ participantCompleted = true ;
+ notifyAll() ;
+ }
+ else if (participantCompleted && lastAction.equals(action))
+ {
+ success() ;
+ }
+ return false ;
+ }
+
+ /**
+ * Wait for the participant to complete.
+ * @param timeout The timeout.
+ * @return true if the participant has completed, false otherwise.
+ */
+ public boolean waitForParticipantCompleted(final long timeout)
+ {
+ final long endTime = System.currentTimeMillis() + timeout ;
+ final boolean result ;
+ synchronized(this)
+ {
+ while(!participantCompleted)
+ {
+ final long currentTimeout = endTime - System.currentTimeMillis() ;
+ if (currentTimeout <= 0)
+ {
+ break ;
+ }
+ try
+ {
+ wait(currentTimeout) ;
+ }
+ catch (final InterruptedException ie) {}
+ }
+
+ result = participantCompleted ;
+ }
+
+ if (result)
+ {
+ // If it is completd then wait to allow processing of message.
+ try
+ {
+ Thread.sleep(2000) ;
+ }
+ catch (final InterruptedException ie) {}
+ }
+ return result ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/BAInteropParticipantCompletedState.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/BaseState.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/BaseState.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/BaseState.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,97 @@
+package com.jboss.transaction.txinterop.interop.states;
+
+import org.xml.sax.ContentHandler;
+
+import com.jboss.transaction.txinterop.proxy.ProxyConversationState;
+
+/**
+ * The base state class for proxy conversations.
+ */
+abstract class BaseState implements ProxyConversationState
+{
+ /**
+ * The complete flag.
+ */
+ private boolean complete ;
+ /**
+ * The success flag.
+ */
+ private boolean success ;
+
+ /**
+ * Mark the conversation as successfully completed.
+ */
+ protected synchronized void success()
+ {
+ if (!complete)
+ {
+ System.out.println("KEV: success!") ;
+ complete = true ;
+ success = true ;
+ notifyAll() ;
+ }
+ else
+ {
+ System.out.println("KEV: AAAAAARRRRRRRGGGGGGGHHHHHHHHH, multiple successes called for conversation!") ;
+ }
+ }
+
+ /**
+ * Wait a specified period for the conversation to complete.
+ * @param timeout The timeout period of the conversation.
+ */
+ public synchronized void waitForCompletion(final long timeout)
+ {
+ if (!complete && (timeout > 0))
+ {
+ final long end = System.currentTimeMillis() + timeout ;
+ do
+ {
+ final long delay = end - System.currentTimeMillis() ;
+ if (delay > 0)
+ {
+ try
+ {
+ wait(delay) ;
+ }
+ catch (final InterruptedException ie) {} // ignore
+ }
+ else
+ {
+ break ;
+ }
+ }
+ while(!complete) ;
+ }
+
+ complete = true ;
+ }
+
+ /**
+ * Has the conversation complete?
+ * @return true if the conversation has complete, false otherwise.
+ */
+ public synchronized boolean isComplete()
+ {
+ return complete ;
+ }
+
+ /**
+ * Was the conversation successful?
+ * @return true if the conversation was successful, false otherwise.
+ */
+ public synchronized boolean isSuccessful()
+ {
+ return success ;
+ }
+
+ /**
+ * Get the Handler for rewriting the XML.
+ * @param nextHandler The next handler in the sequence.
+ * @return The handler or null if no rewriting required.
+ */
+ public ContentHandler getHandler(final ContentHandler nextHandler)
+ {
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/BaseState.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/InteropWaitState.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/InteropWaitState.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/InteropWaitState.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,54 @@
+package com.jboss.transaction.txinterop.interop.states;
+
+/**
+ * A conversation state that waits for a specified action before completing.
+ */
+public class InteropWaitState extends BaseState
+{
+ /**
+ * The last action.
+ */
+ private final String lastAction ;
+ /**
+ * The action count.
+ */
+ private int count ;
+
+ /**
+ * Construct the conversation state.
+ * @param lastAction The last action of the conversation.
+ */
+ public InteropWaitState(final String lastAction)
+ {
+ this(lastAction, 1) ;
+ }
+
+ /**
+ * Construct the conversation state.
+ * @param lastAction The last action of the conversation.
+ * @param count The occurrance to trigger on.
+ */
+ public InteropWaitState(final String lastAction, final int count)
+ {
+ this.lastAction = lastAction ;
+ this.count = count ;
+ }
+
+ /**
+ * Handle the next action in the sequence.
+ * @param action The SOAP action.
+ * @param identifier The identifier associated with the endpoint.
+ * @return true if the message should be dropped, false otherwise.
+ */
+ public boolean handleAction(final String action, final String identifier)
+ {
+ if (lastAction.equals(action))
+ {
+ if (--count == 0)
+ {
+ success() ;
+ }
+ }
+ return false ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/interop/states/InteropWaitState.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/AddressingProxySAXHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/AddressingProxySAXHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/AddressingProxySAXHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,211 @@
+/*
+ * Created on 20-Jan-2005
+ */
+package com.jboss.transaction.txinterop.proxy;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+
+import com.arjuna.webservices.wsaddr.AddressingConstants;
+import com.arjuna.webservices.wsarj.ArjunaConstants;
+
+/**
+ * Sax parser for rewriting the XML via the proxy.
+ * @author kevin
+ */
+public class AddressingProxySAXHandler extends BaseHandler
+{
+ /**
+ * The WS-Addressing namespace URI.
+ */
+ private static final String WSA_NAMESPACE_URI = AddressingConstants.WSA_NAMESPACE ;
+ /**
+ * The WS-Addressing To element.
+ */
+ private static final String WSA_ELEMENT_TO = AddressingConstants.WSA_ELEMENT_TO ;
+ /**
+ * The WS-Addressing Address element.
+ */
+ private static final String WSA_ELEMENT_ADDRESS = AddressingConstants.WSA_ELEMENT_ADDRESS ;
+
+ /**
+ * The SOAP 1.1 namespace.
+ */
+ private static final String SOAP11_NAMESPACE_URI = "http://schemas.xmlsoap.org/soap/envelope/" ;
+ /**
+ * The SOAP 1.2 namespace.
+ */
+ private static final String SOAP12_NAMESPACE_URI = "http://www.w3.org/2003/05/soap-envelope" ;
+ /**
+ * The SOAP header element.
+ */
+ private static final String SOAP_ELEMENT_HEADER = "Header" ;
+
+ /**
+ * Are we in a rewrite element?
+ */
+ private boolean inRewriteElement ;
+ /**
+ * Are we in a to element?
+ */
+ private boolean inToElement ;
+ /**
+ * Are we in an identifier element?
+ */
+ private boolean inIdentifierElement ;
+ /**
+ * Are we in the header element?
+ */
+ private boolean inHeaderElement ;
+ /**
+ * The current element depth.
+ */
+ private int depth ;
+ /**
+ * The to address.
+ */
+ private String toAddress ;
+ /**
+ * The identifier.
+ */
+ private String identifier ;
+ /**
+ * The string buffer for text element content.
+ */
+ private StringBuffer characterContent = new StringBuffer() ;
+
+ /**
+ * The current conversation identifier.
+ */
+ private final String conversationIdentifier ;
+
+ /**
+ * Construct the SAX handler with the output writer.
+ * @param nextHandler The next content handler.
+ * @param conversationIdentifier The conversation identifier.
+ */
+ public AddressingProxySAXHandler(final ContentHandler nextHandler, final String conversationIdentifier)
+ {
+ super(nextHandler) ;
+ this.conversationIdentifier = conversationIdentifier ;
+ }
+
+ /**
+ * Start an element.
+ * @param uri The uri.
+ * @param localName The local name.
+ * @param qName The qualified name.
+ * @param attributes The element attributes.
+ * @throws SAXException for any errors.
+ */
+ public void startElement(final String uri, final String localName, final String qName,
+ final Attributes attributes)
+ throws SAXException
+ {
+ if (WSA_NAMESPACE_URI.equals(uri))
+ {
+ if (WSA_ELEMENT_ADDRESS.equals(localName))
+ {
+ inRewriteElement = true ;
+ }
+ else if (WSA_ELEMENT_TO.equals(localName))
+ {
+ inRewriteElement = true ;
+ inToElement = true ;
+ }
+ }
+ else if ((SOAP11_NAMESPACE_URI.equals(uri) || SOAP12_NAMESPACE_URI.equals(uri)) && SOAP_ELEMENT_HEADER.equals(localName))
+ {
+ inHeaderElement = true ;
+ }
+ else if (ArjunaConstants.WSARJ_NAMESPACE.equals(uri) && ArjunaConstants.WSARJ_ELEMENT_INSTANCE_IDENTIFIER.equals(localName)
+ && inHeaderElement && (depth == 2))
+ {
+ inIdentifierElement = true ;
+ }
+
+ depth++ ;
+
+ getNextHandler().startElement(uri, localName, qName, attributes) ;
+ }
+
+ /**
+ * End an element.
+ * @param uri The uri.
+ * @param localName The local name.
+ * @param qName The qualified name.
+ * @throws SAXException for any errors.
+ */
+ public void endElement(final String uri, final String localName, final String qName)
+ throws SAXException
+ {
+ if (characterContent.length() > 0)
+ {
+ if (inRewriteElement)
+ {
+ final String newValue = ProxyURIRewriting.rewriteURI(conversationIdentifier, characterContent.toString().trim()) ;
+ getNextHandler().characters(newValue.toCharArray(), 0, newValue.length()) ;
+ if (inToElement)
+ {
+ toAddress = newValue ;
+ }
+ }
+ else if (inIdentifierElement)
+ {
+ identifier = characterContent.toString() ;
+ getNextHandler().characters(identifier.toCharArray(), 0, identifier.length()) ;
+ }
+ characterContent.setLength(0) ;
+ }
+
+ if ((SOAP11_NAMESPACE_URI.equals(uri) || SOAP12_NAMESPACE_URI.equals(uri)) && SOAP_ELEMENT_HEADER.equals(localName))
+ {
+ inHeaderElement = false ;
+ }
+
+ depth-- ;
+
+ getNextHandler().endElement(uri, localName, qName) ;
+ inRewriteElement = false ;
+ inToElement = false ;
+ }
+
+ /**
+ * Process character text.
+ * @param chars The character array.
+ * @param start The start index.
+ * @param length The length of this section.
+ * @throws SAXException for any errors.
+ */
+ public void characters(char[] chars, int start, int length)
+ throws SAXException
+ {
+ if (inRewriteElement || inIdentifierElement)
+ {
+ characterContent.append(chars, start, length) ;
+ }
+ else
+ {
+ getNextHandler().characters(chars, start, length) ;
+ }
+ }
+
+ /**
+ * Return the to address from the processing.
+ * @return The to address.
+ */
+ public String getToAddress()
+ {
+ return toAddress ;
+ }
+
+ /**
+ * Return the identifier from the processing.
+ * @return The identifier.
+ */
+ public String getIdentifier()
+ {
+ return identifier ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/AddressingProxySAXHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/BaseHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/BaseHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/BaseHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,167 @@
+/*
+ * Created on 20-Jan-2005
+ */
+package com.jboss.transaction.txinterop.proxy;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+
+/**
+ * Sax parser for rewriting the XML via the proxy.
+ * @author kevin
+ */
+public class BaseHandler implements ContentHandler
+{
+ /**
+ * The next handler in the sequence.
+ */
+ private final ContentHandler nextHandler ;
+
+ /**
+ * Construct the base handler.
+ * @param nextHandler The next content handler.
+ */
+ protected BaseHandler(final ContentHandler nextHandler)
+ {
+ this.nextHandler = nextHandler ;
+ }
+
+ /**
+ * Set the document locator.
+ * @param locator The document locator.
+ */
+ public void setDocumentLocator(final Locator locator)
+ {
+ nextHandler.setDocumentLocator(locator) ;
+ }
+
+ /**
+ * Handle the procesing instruction.
+ * @param target The pi target.
+ * @param data The pi data.
+ * @throws SAXException for any errors.
+ */
+ public void processingInstruction(final String target, final String data)
+ throws SAXException
+ {
+ nextHandler.processingInstruction(target, data) ;
+ }
+
+ /**
+ * Start the document.
+ * @throws SAXException for any errors.
+ */
+ public void startDocument()
+ throws SAXException
+ {
+ nextHandler.startDocument() ;
+ }
+
+ /**
+ * End the document.
+ * @throws SAXException for any errors.
+ */
+ public void endDocument()
+ throws SAXException
+ {
+ nextHandler.endDocument() ;
+ }
+
+ /**
+ * Start a prefix mapping.
+ * @param prefix The namespace prefix.
+ * @param uri The namespace uri.
+ * @throws SAXException for any errors.
+ */
+ public void startPrefixMapping(final String prefix, final String uri)
+ throws SAXException
+ {
+ nextHandler.startPrefixMapping(prefix, uri) ;
+ }
+
+ /**
+ * End the prefix mapping.
+ * @param prefix The namespace prefix.
+ * @throws SAXException for any errors.
+ */
+ public void endPrefixMapping(final String prefix)
+ throws SAXException
+ {
+ nextHandler.endPrefixMapping(prefix) ;
+ }
+
+ /**
+ * Start an element.
+ * @param uri The uri.
+ * @param localName The local name.
+ * @param qName The qualified name.
+ * @param attributes The element attributes.
+ * @throws SAXException for any errors.
+ */
+ public void startElement(final String uri, final String localName, final String qName,
+ final Attributes attributes)
+ throws SAXException
+ {
+ nextHandler.startElement(uri, localName, qName, attributes) ;
+ }
+
+ /**
+ * End an element.
+ * @param uri The uri.
+ * @param localName The local name.
+ * @param qName The qualified name.
+ * @throws SAXException for any errors.
+ */
+ public void endElement(final String uri, final String localName, final String qName)
+ throws SAXException
+ {
+ nextHandler.endElement(uri, localName, qName) ;
+ }
+
+ /**
+ * Process character text.
+ * @param chars The character array.
+ * @param start The start index.
+ * @param length The length of this section.
+ * @throws SAXException for any errors.
+ */
+ public void characters(char[] chars, int start, int length)
+ throws SAXException
+ {
+ nextHandler.characters(chars, start, length) ;
+ }
+
+ /**
+ * Process ignorable white space.
+ * @param chars The character array.
+ * @param start The start index.
+ * @param length The length of this section.
+ * @throws SAXException for any errors.
+ */
+ public void ignorableWhitespace(char[] chars, int start, int length)
+ throws SAXException
+ {
+ nextHandler.ignorableWhitespace(chars, start, length) ;
+ }
+
+ /**
+ * Skip an entity.
+ * @throws SAXException for any errors.
+ */
+ public void skippedEntity(final String name)
+ throws SAXException
+ {
+ nextHandler.skippedEntity(name) ;
+ }
+
+ /**
+ * Get the next handler.
+ * @return The next handler.
+ */
+ protected final ContentHandler getNextHandler()
+ {
+ return nextHandler ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/BaseHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/ProxyConversation.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/ProxyConversation.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/ProxyConversation.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,145 @@
+package com.jboss.transaction.txinterop.proxy;
+
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.TreeMap;
+
+/**
+ * Message logging via the proxy.
+ */
+public class ProxyConversation
+{
+ /**
+ * The conversation id.
+ */
+ private static int currentConversationId ;
+ /**
+ * The conversation map.
+ */
+ private static Map conversationMap = new TreeMap() ;
+ /**
+ * The conversation state map.
+ */
+ private static Map conversationStateMap = new TreeMap() ;
+
+ /**
+ * The marker for an internal id.
+ */
+ private static final char INTERNAL_ID = 'c' ;
+ /**
+ * The marker for an external id.
+ */
+ private static final char EXTERNAL_ID = 'C' ;
+
+ /**
+ * Create a conversation.
+ * @return The id of the conversation.
+ */
+ public static synchronized String createConversation()
+ {
+ final String conversationId = INTERNAL_ID + Integer.toString(++currentConversationId) ;
+ conversationMap.put(mapConversationId(conversationId), new ArrayList()) ;
+System.out.println("KEV: created conversation " + conversationId) ;
+ return conversationId ;
+ }
+
+ /**
+ * Remove the conversation.
+ * @param conversationId The conversation id.
+ * @return The conversation messages in sequence.
+ */
+ public static synchronized String[] removeConversation(final String conversationId)
+ {
+ final ArrayList list = (ArrayList)conversationMap.remove(mapConversationId(conversationId)) ;
+System.out.println("KEV: removed conversation " + conversationId) ;
+ return (list == null ? new String[0] : (String[])list.toArray(new String[list.size()])) ;
+ }
+
+ /**
+ * Append a message to the conversation.
+ * @param conversationId The conversation id.
+ * @param message The message to append to the conversation.
+ */
+ public static synchronized void appendConversation(final String conversationId, final String message)
+ {
+ final ArrayList list = (ArrayList)conversationMap.get(mapConversationId(conversationId)) ;
+ if (list != null)
+ {
+ list.add(message) ;
+ }
+ }
+
+ /**
+ * Set the conversation state for the specified conversation.
+ * @param conversationId The conversation id.
+ * @param conversationState The conversation state.
+ */
+ public static synchronized void setConversationState(final String conversationId, final ProxyConversationState conversationState)
+ {
+ conversationStateMap.put(mapConversationId(conversationId), conversationState) ;
+ }
+
+ /**
+ * Get the conversation state for the specified conversation.
+ * @param conversationId The conversation id.
+ * @return The conversation state or null.
+ */
+ public static synchronized ProxyConversationState getConversationState(final String conversationId)
+ {
+ return (ProxyConversationState)conversationStateMap.get(mapConversationId(conversationId)) ;
+ }
+
+ /**
+ * Clear the conversation state for the specified conversation.
+ * @param conversationId The conversation id.
+ */
+ public static synchronized void clearConversationState(final String conversationId)
+ {
+ conversationStateMap.remove(mapConversationId(conversationId)) ;
+ }
+
+ /**
+ * Is the conversation id an internal id?
+ * @param conversationId The conversation id.
+ * @return True if the conversation id is internal, false if it is external.
+ */
+ public static boolean isInternalConversationId(final String conversationId)
+ {
+ return ((conversationId != null) && (conversationId.length() != 0) && (conversationId.charAt(0) == INTERNAL_ID)) ;
+ }
+
+ /**
+ * Get the alternate conversation id.
+ * @param conversationId The current conversation id.
+ * @return The alternate conversation id.
+ */
+ public static String getAlternateConversationId(final String conversationId)
+ {
+ if ((conversationId == null) || (conversationId.length() == 0))
+ {
+ return conversationId ;
+ }
+ if (conversationId.charAt(0) == INTERNAL_ID)
+ {
+ return EXTERNAL_ID + mapConversationId(conversationId) ;
+ }
+ else
+ {
+ return INTERNAL_ID + mapConversationId(conversationId) ;
+ }
+ }
+
+ /**
+ * Get the map conversation id.
+ * @param conversationId The full conversation id.
+ * @return The conversation id for the map.
+ */
+ private static String mapConversationId(final String conversationId)
+ {
+ if ((conversationId == null) || (conversationId.length() == 0))
+ {
+ return conversationId ;
+ }
+ return conversationId.substring(1) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/ProxyConversation.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/ProxyConversationState.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/ProxyConversationState.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/ProxyConversationState.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,24 @@
+package com.jboss.transaction.txinterop.proxy;
+
+import org.xml.sax.ContentHandler;
+
+/**
+ * Interface representing a conversation state.
+ */
+public interface ProxyConversationState
+{
+ /**
+ * Handle the next action in the sequence.
+ * @param action The SOAP action.
+ * @param identifier The identifier associated with the endpoint.
+ * @return true if the message should be dropped, false otherwise.
+ */
+ public boolean handleAction(final String action, final String identifier) ;
+
+ /**
+ * Get the Handler for rewriting the XML.
+ * @param nextHandler The next handler in the sequence.
+ * @return The handler or null if no rewriting required.
+ */
+ public ContentHandler getHandler(final ContentHandler nextHandler) ;
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/ProxyConversationState.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/ProxyListenerService.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/ProxyListenerService.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/ProxyListenerService.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,392 @@
+/*
+ * Copyright (c) 2002, 2003, Arjuna Technologies Limited.
+ *
+ * $Id: DummyListenerService.java,v 1.2 2004/06/24 13:52:53 nmcl Exp $
+ */
+
+package com.jboss.transaction.txinterop.proxy;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.StringWriter;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.Enumeration;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.xml.sax.ContentHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+public class ProxyListenerService extends HttpServlet
+{
+ /**
+ * The SOAP 1.1 content type.
+ */
+ private static final String SOAP_11_CONTENT_TYPE = "text/xml" ;
+ /**
+ * The SOAP 1.2 content type.
+ */
+ private static final String SOAP_12_CONTENT_TYPE = "application/soap+xml" ;
+ /**
+ * The name of the SOAP Action header.
+ */
+ public static final String SOAP_ACTION_HEADER = "SOAPAction" ;
+ /**
+ * The default data size.
+ */
+ private static final int DEFAULT_DATA_SIZE = 256 ;
+
+ /**
+ * Initialise the servlet.
+ * @param config The servlet configuration.
+ */
+ public void init(final ServletConfig config)
+ throws ServletException
+ {
+ super.init(config);
+
+ // Initialise the local host:port/urlstub for the proxy.
+ final String proxyServiceURI = config.getInitParameter("proxyServiceURI") ;
+ if (proxyServiceURI == null)
+ {
+ throw new ServletException("Proxy service URI missing") ;
+ }
+ ProxyURIRewriting.setProxyURI(proxyServiceURI) ;
+ }
+
+ /**
+ * Handle the post request.
+ * @param httpServletRequest The current HTTP servlet request.
+ * @param httpServletResponse The current HTTP servlet response.
+ */
+ public void doPost(final HttpServletRequest httpServletRequest, final HttpServletResponse httpServletResponse)
+ throws ServletException, IOException
+ {
+ final String conversationIdentifier = getConversationIdentifier(httpServletRequest) ;
+
+ final byte[] requestContents = getContents(httpServletRequest.getInputStream()) ;
+ final String soapAction = httpServletRequest.getHeader(SOAP_ACTION_HEADER) ;
+ final boolean jbossClient = ProxyConversation.isInternalConversationId(conversationIdentifier) ;
+ final String alternateConversationIdentifier = ProxyConversation.getAlternateConversationId(conversationIdentifier) ;
+
+ final ProxyConversationState state = ProxyConversation.getConversationState(conversationIdentifier) ;
+
+System.out.println("KEV: processing SOAP action " + trimAction(soapAction)) ;
+ // Search header for wsa:To and wsa:Address elements, changing their URL parts as we go.
+ // Get the target URL from the to.
+ try
+ {
+ final StringWriter newMessageWriter = new StringWriter() ;
+ final WriterSAXHandler writerHandler = new WriterSAXHandler(newMessageWriter) ;
+ final AddressingProxySAXHandler addressingHandler = new AddressingProxySAXHandler(writerHandler, alternateConversationIdentifier) ;
+
+ final ContentHandler stateHandler = (state == null ? null : state.getHandler(addressingHandler)) ;
+ final ContentHandler parserHandler = (stateHandler == null ? addressingHandler : stateHandler) ;
+
+ final XMLReader xmlReader = XMLReaderFactory.createXMLReader() ;
+ xmlReader.setContentHandler(parserHandler) ;
+ xmlReader.parse(new InputSource(new ByteArrayInputStream(requestContents))) ;
+
+ final StringBuffer newMessageBuffer = newMessageWriter.getBuffer() ;
+ final StringBuffer messageBuffer = (jbossClient ? newMessageBuffer : new StringBuffer(new String(requestContents))) ;
+
+ ProxyConversation.appendConversation(conversationIdentifier, checkForXMLDecl(messageBuffer)) ;
+
+ final String identifier = addressingHandler.getIdentifier() ;
+ if ((state != null) && state.handleAction(trimAction(soapAction), identifier))
+ {
+ httpServletResponse.setStatus(HttpServletResponse.SC_ACCEPTED) ;
+ httpServletResponse.flushBuffer() ;
+ return ;
+ }
+
+ // parse input stream
+
+ final URL destURL = new URL(addressingHandler.getToAddress()) ;
+ final HttpURLConnection destConnection = (HttpURLConnection)destURL.openConnection() ;
+ try
+ {
+ destConnection.setDoOutput(true) ;
+ destConnection.setUseCaches(false) ;
+
+ // copy the headers
+ final Enumeration headerNameEnum = httpServletRequest.getHeaderNames() ;
+ while(headerNameEnum.hasMoreElements())
+ {
+ final String name = (String)headerNameEnum.nextElement() ;
+ if (name.equals(SOAP_ACTION_HEADER))
+ {
+ destConnection.setRequestProperty(name, soapAction) ;
+ }
+ else
+ {
+ final String value = httpServletRequest.getHeader(name) ;
+ destConnection.setRequestProperty(name, value) ;
+ }
+ }
+
+ // Set content length
+ destConnection.setRequestProperty("Content-Length", Integer.toString(newMessageBuffer.length())) ;
+ final int port = destURL.getPort() ;
+ final String host = (port > 0 ? destURL.getHost() + ":" + port : destURL.getHost()) ;
+ destConnection.setRequestProperty("Host", host) ;
+ destConnection.setRequestMethod("POST") ;
+ // Connect
+ destConnection.connect() ;
+ // Write the new request
+ final OutputStream os = destConnection.getOutputStream() ;
+ os.write(newMessageBuffer.toString().getBytes()) ;
+ os.flush() ;
+ os.close() ;
+
+ final int responseCode = destConnection.getResponseCode() ;
+ final String fullContentType = destConnection.getContentType() ;
+ final String contentType = getContentType(fullContentType) ;
+ switch (responseCode)
+ {
+ case HttpServletResponse.SC_OK:
+ case HttpServletResponse.SC_ACCEPTED:
+ if ((contentType != null) && !(SOAP_11_CONTENT_TYPE.equals(contentType) ||
+ SOAP_12_CONTENT_TYPE.equals(contentType)))
+ {
+ httpServletResponse.setStatus(HttpServletResponse.SC_ACCEPTED) ;
+ httpServletResponse.flushBuffer() ;
+ break ;
+ }
+ // FALL THRU
+ default:
+ // Pass the response back.
+ httpServletResponse.setStatus(destConnection.getResponseCode()) ;
+ final int contentLength = destConnection.getContentLength() ;
+ if (contentLength >= 0)
+ {
+ httpServletResponse.setContentLength(contentLength) ;
+ }
+ if (fullContentType != null)
+ {
+ httpServletResponse.setContentType(fullContentType) ;
+ }
+
+ // Copy data
+ final int datasize = DEFAULT_DATA_SIZE ;
+ final char[] data = new char[datasize] ;
+ int readCount ;
+
+ final InputStream is ;
+ if (responseCode == HttpURLConnection.HTTP_INTERNAL_ERROR)
+ {
+ is = destConnection.getErrorStream() ;
+ }
+ else
+ {
+ is = destConnection.getInputStream() ;
+ }
+ final InputStreamReader isr = new InputStreamReader(is) ;
+ try
+ {
+ final StringWriter writer = new StringWriter() ;
+ do
+ {
+ readCount = isr.read(data, 0, datasize) ;
+ if (readCount > 0)
+ {
+ writer.write(data, 0, readCount) ;
+ }
+ }
+ while(readCount > 0) ;
+ final String responseContents = writer.toString() ;
+ if (responseContents.length() > 0)
+ {
+ if ((contentType != null) && !(SOAP_11_CONTENT_TYPE.equals(contentType) ||
+ SOAP_12_CONTENT_TYPE.equals(contentType)))
+ {
+ ProxyConversation.appendConversation(conversationIdentifier, escapeContents(responseContents)) ;
+ }
+ else
+ {
+ ProxyConversation.appendConversation(conversationIdentifier, responseContents) ;
+ }
+ final ServletOutputStream sos = httpServletResponse.getOutputStream() ;
+ sos.print(responseContents) ;
+ sos.flush() ;
+ }
+ }
+ finally
+ {
+ is.close() ;
+ }
+ break ;
+ }
+ }
+ finally
+ {
+ destConnection.disconnect() ;
+ }
+ }
+ catch (Exception exception)
+ {
+ System.err.println("Proxy Listener Service: " + exception);
+ exception.printStackTrace() ;
+ }
+ catch (Error error)
+ {
+ System.err.println("Proxy Listener Service: " + error);
+ error.printStackTrace() ;
+ }
+ }
+
+ /**
+ * Trim quotes from the action.
+ * @param action The action.
+ * @return The trimmed action.
+ */
+ private static String trimAction(final String action)
+ {
+ final int length = (action == null ? 0 : action.length()) ;
+ if ((length < 2) || (action.charAt(0) != '"') || (action.charAt(length-1) != '"'))
+ {
+ return action ;
+ }
+ return action.substring(1, length-1) ;
+ }
+
+ /**
+ * Get the content type part.
+ * @param fullContentType The full content type.
+ * @return The content type.
+ */
+ private static String getContentType(final String fullContentType)
+ {
+ if (fullContentType == null)
+ {
+ return null ;
+ }
+ final int separatorIndex = fullContentType.indexOf(';') ;
+ return (separatorIndex == -1 ? fullContentType : fullContentType.substring(0, separatorIndex)) ;
+ }
+
+ /**
+ * Get the conversation identifier from the request.
+ * @return The conversation identifier.
+ */
+ private static String getConversationIdentifier(final HttpServletRequest httpServletRequest)
+ {
+ final String pathInfo = httpServletRequest.getPathInfo() ;
+ final int separator = pathInfo.indexOf('/', 1) ;
+ return pathInfo.substring(1, separator) ;
+ }
+
+ /**
+ * Get the contents of the input stream
+ * @param is The input stream.
+ * @return The contents.
+ * @throws IOException for errors.
+ */
+ private byte[] getContents(final InputStream is)
+ throws IOException
+ {
+ final ByteArrayOutputStream baos = new ByteArrayOutputStream() ;
+ final byte[] buffer = new byte[1024] ;
+ int readCount ;
+ do
+ {
+ readCount = is.read(buffer, 0, buffer.length) ;
+ if (readCount > 0)
+ {
+ baos.write(buffer, 0, readCount) ;
+ }
+ }
+ while(readCount > 0) ;
+ return baos.toByteArray() ;
+ }
+
+ /**
+ * Check for the XML declaration and remove.
+ * This method is only used if we are intending to log the SOAP message so that it is easy to combine the XML without creating invalid documents.
+ * @param contents The current stream contents.
+ * @return The stream contents as a string.
+ */
+ private static String checkForXMLDecl(final StringBuffer contents)
+ {
+ int count = 0 ;
+ try
+ {
+ while(Character.isWhitespace(contents.charAt(count))) count++ ;
+ if (contents.charAt(count) == '<')
+ {
+ if (contents.charAt(count+1) == '?')
+ {
+ count+=2 ;
+ while(contents.charAt(count++) != '>') ;
+ }
+ }
+ if (count > 0)
+ {
+ contents.delete(0, count) ;
+ }
+ }
+ catch (final StringIndexOutOfBoundsException sioobe) {}
+
+ return contents.toString() ;
+ }
+
+ /**
+ * Escape the contents of the string.
+ * @param contents The original contents.
+ * @return The escaped contents.
+ */
+ private static String escapeContents(final String contents)
+ {
+ final int length = contents.length() ;
+ StringWriter escapedContents = null ;
+
+ for(int count = 0 ; count < length ; count++)
+ {
+ final char ch = contents.charAt(count) ;
+ if ((ch == '<') || (ch == '>') || (ch == '&') || (ch == '"'))
+ {
+ if (escapedContents == null)
+ {
+ escapedContents = new StringWriter(length) ;
+ if (count > 0)
+ {
+ escapedContents.write(contents, 0, count-1) ;
+ }
+ }
+ if (ch == '<')
+ {
+ escapedContents.write("<") ;
+ }
+ else if (ch == '>')
+ {
+ escapedContents.write(">") ;
+ }
+ else if (ch == '&')
+ {
+ escapedContents.write("&") ;
+ }
+ else if (ch == '"')
+ {
+ escapedContents.write(""") ;
+ }
+ }
+ else if (escapedContents != null)
+ {
+ escapedContents.write(ch) ;
+ }
+ }
+ return (escapedContents == null ? contents : escapedContents.toString()) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/ProxyListenerService.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/ProxyURIRewriting.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/ProxyURIRewriting.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/ProxyURIRewriting.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,139 @@
+package com.jboss.transaction.txinterop.proxy;
+
+
+/**
+ * @author kevin
+ */
+public class ProxyURIRewriting
+{
+ /**
+ * The base URI of the proxy.
+ */
+ private static String PROXY_URI ;
+
+ /**
+ * Set the proxy URI.
+ * @param proxyURI The proxy URI.
+ */
+ public static synchronized void setProxyURI(final String proxyURI)
+ {
+ PROXY_URI = proxyURI ;
+ }
+
+ /**
+ * Get the proxy URI.
+ * @return The proxy URI.
+ */
+ public static synchronized String getProxyURI()
+ {
+ return PROXY_URI ;
+ }
+
+ /**
+ * Rewrite the URI.
+ * @param conversationIdentifier The conversation identifier.
+ * @param uri The uri to be rewritten.
+ * @return The replacement URI.
+ */
+ public static String rewriteURI(final String conversationIdentifier, final String uri)
+ {
+ final String proxyURI = getProxyURI() ;
+
+ if (uri != null)
+ {
+ if (uri.startsWith(proxyURI))
+ {
+ final int separatorIndex = uri.indexOf('/', proxyURI.length()+1) ;
+ final String remainder = uri.substring(separatorIndex+1) ;
+ return decodeURI(remainder) ;
+ }
+ else if (!uri.startsWith("http://www.w3.org/"))
+ {
+ return proxyURI + "/" + conversationIdentifier + "/" + encodeURI(uri) ;
+ }
+ }
+ return uri ;
+ }
+
+ /**
+ * Decode a URI that has been encoded.
+ * @param uri The encoded URI.
+ * @return The decoded URI.
+ */
+ public static String decodeURI(final String uri)
+ {
+ if (uri == null)
+ {
+ return null ;
+ }
+ final StringBuffer result = new StringBuffer() ;
+ final int length = uri.length() ;
+ int separatorCount = 0 ;
+ for(int count = 0 ; count < length ; count++)
+ {
+ final char ch = uri.charAt(count) ;
+ if (separatorCount < 3)
+ {
+ if (ch == '-')
+ {
+ result.append("/") ;
+ separatorCount++ ;
+ continue ;
+ }
+ else if (ch == '_')
+ {
+ result.append(":") ;
+ continue ;
+ }
+ result.append(ch) ;
+ }
+ else
+ {
+ result.append(ch) ;
+ }
+ }
+ return result.toString() ;
+ }
+
+ /**
+ * Encode a URI.
+ * @param uri The URI.
+ * @return The encoded URI.
+ */
+ public static String encodeURI(final String uri)
+ {
+ if (uri == null)
+ {
+ return "" ;
+ }
+
+ final StringBuffer result = new StringBuffer() ;
+ final int length = uri.length() ;
+ int separatorCount = 0 ;
+ for(int count = 0 ; count < length ; count++)
+ {
+ final char ch = uri.charAt(count) ;
+ if (separatorCount < 3)
+ {
+ if (ch == '/')
+ {
+ separatorCount++ ;
+ result.append("-") ;
+ }
+ else if (ch == ':')
+ {
+ result.append("_") ;
+ }
+ else
+ {
+ result.append(ch) ;
+ }
+ }
+ else
+ {
+ result.append(ch) ;
+ }
+ }
+ return result.toString() ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/ProxyURIRewriting.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/WriterSAXHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/WriterSAXHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/WriterSAXHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,394 @@
+/*
+ * Created on 20-Jan-2005
+ */
+package com.jboss.transaction.txinterop.proxy;
+
+import java.io.PrintWriter;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Stack;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+
+/**
+ * Sax parser for rewriting the XML via the proxy.
+ * @author kevin
+ */
+public class WriterSAXHandler implements ContentHandler
+{
+ /**
+ * Do we need to end the start tag?
+ */
+ private boolean endStartTag ;
+ /**
+ * The to address.
+ */
+ private String toAddress ;
+ /**
+ * The identifier.
+ */
+ private String identifier ;
+ /**
+ * The string buffer for text element content.
+ */
+ private StringBuffer characterContent = new StringBuffer() ;
+ /**
+ * The new namespaces.
+ */
+ private List newNamespaces = new ArrayList() ;
+ /**
+ * The stack of active namespaces.
+ */
+ private Stack namespaceStack = new Stack() ;
+ /**
+ * The active namespaces.
+ */
+ private Map activeNamespaces = new HashMap() ;
+
+ /**
+ * The writer for output.
+ */
+ private final PrintWriter printWriter ;
+
+ /**
+ * Construct the SAX handler with the output writer.
+ * @param writer The writer for output.
+ */
+ public WriterSAXHandler(final Writer writer)
+ {
+ this.printWriter = new PrintWriter(writer) ;
+ }
+
+ /**
+ * Set the document locator.
+ * @param locator The document locator.
+ */
+ public void setDocumentLocator(final Locator locator)
+ {
+ }
+
+ /**
+ * Handle the procesing instruction.
+ * @param target The pi target.
+ * @param data The pi data.
+ * @throws SAXException for any errors.
+ */
+ public void processingInstruction(final String target, final String data)
+ throws SAXException
+ {
+ }
+
+ /**
+ * Start the document.
+ * @throws SAXException for any errors.
+ */
+ public void startDocument()
+ throws SAXException
+ {
+ }
+
+ /**
+ * End the document.
+ * @throws SAXException for any errors.
+ */
+ public void endDocument()
+ throws SAXException
+ {
+ printWriter.flush() ;
+ }
+
+ /**
+ * Start a prefix mapping.
+ * @param prefix The namespace prefix.
+ * @param uri The namespace uri.
+ * @throws SAXException for any errors.
+ */
+ public void startPrefixMapping(final String prefix, final String uri)
+ throws SAXException
+ {
+ newNamespaces.add(new NamespaceInfo(prefix, uri)) ;
+ }
+
+ /**
+ * End the prefix mapping.
+ * @param prefix The namespace prefix.
+ * @throws SAXException for any errors.
+ */
+ public void endPrefixMapping(final String prefix)
+ throws SAXException
+ {
+ }
+
+ /**
+ * Start an element.
+ * @param uri The uri.
+ * @param localName The local name.
+ * @param qName The qualified name.
+ * @param attributes The element attributes.
+ * @throws SAXException for any errors.
+ */
+ public void startElement(final String uri, final String localName, final String qName,
+ final Attributes attributes)
+ throws SAXException
+ {
+ checkEndStartTag() ;
+
+ namespaceStack.push(activeNamespaces) ;
+ final Iterator newNamespacesIter = newNamespaces.iterator() ;
+ final String namespaces ;
+ if (newNamespacesIter.hasNext())
+ {
+ final HashMap newActiveNamespaces = new HashMap(activeNamespaces) ;
+ final StringBuffer namespacesValue = new StringBuffer() ;
+ do
+ {
+ final NamespaceInfo namespaceInfo = (NamespaceInfo)newNamespacesIter.next() ;
+ final String namespacePrefix = namespaceInfo.getPrefix() ;
+ final String namespaceURI = namespaceInfo.getURI() ;
+ newActiveNamespaces.put(namespaceURI, namespacePrefix) ;
+
+ namespacesValue.append(" xmlns") ;
+ if ((namespacePrefix != null) && (namespacePrefix.length() > 0))
+ {
+ namespacesValue.append(':') ;
+ namespacesValue.append(namespacePrefix) ;
+ }
+ namespacesValue.append("=\"") ;
+ namespacesValue.append(namespaceURI) ;
+ namespacesValue.append('"') ;
+ }
+ while(newNamespacesIter.hasNext()) ;
+ newNamespaces.clear() ;
+ activeNamespaces = newActiveNamespaces ;
+ namespaces = namespacesValue.toString() ;
+ }
+ else
+ {
+ namespaces = null ;
+ }
+
+ printWriter.write('<') ;
+ printWriter.write(getQName(uri, localName, qName)) ;
+ if (namespaces != null)
+ {
+ printWriter.write(namespaces) ;
+ }
+
+ final int numAttributes = attributes.getLength() ;
+ if (numAttributes > 0)
+ {
+ for(int count = 0 ; count < numAttributes ; count++)
+ {
+ printWriter.write(' ') ;
+ final String attributeQName = getQName(attributes.getURI(count), attributes.getLocalName(count), attributes.getQName(count)) ;
+ printWriter.write(attributeQName) ;
+ printWriter.write("=\"") ;
+ final String value = attributes.getValue(count) ;
+ escapeTextContent(value.toCharArray(), 0, value.length()) ;
+ printWriter.write('"') ;
+ }
+ }
+
+ endStartTag = true ;
+ }
+
+ /**
+ * End an element.
+ * @param uri The uri.
+ * @param localName The local name.
+ * @param qName The qualified name.
+ * @throws SAXException for any errors.
+ */
+ public void endElement(final String uri, final String localName, final String qName)
+ throws SAXException
+ {
+ characterContent.setLength(0) ;
+ if (endStartTag)
+ {
+ printWriter.write("/>") ;
+ }
+ else
+ {
+ printWriter.write("</") ;
+ printWriter.write(qName) ;
+ printWriter.write('>') ;
+ }
+ activeNamespaces = (Map)namespaceStack.pop() ;
+ endStartTag = false ;
+ }
+
+ /**
+ * Process character text.
+ * @param chars The character array.
+ * @param start The start index.
+ * @param length The length of this section.
+ * @throws SAXException for any errors.
+ */
+ public void characters(char[] chars, int start, int length)
+ throws SAXException
+ {
+ checkEndStartTag() ;
+ escapeTextContent(chars, start, length) ;
+ }
+
+ /**
+ * Process ignorable white space.
+ * @param chars The character array.
+ * @param start The start index.
+ * @param length The length of this section.
+ * @throws SAXException for any errors.
+ */
+ public void ignorableWhitespace(char[] chars, int start, int length)
+ throws SAXException
+ {
+ checkEndStartTag() ;
+ printWriter.write(chars, start, length) ;
+ }
+
+ /**
+ * Skip an entity.
+ * @throws SAXException for any errors.
+ */
+ public void skippedEntity(final String name)
+ throws SAXException
+ {
+ }
+
+ /**
+ * Get the qualified name of the element/attribute.
+ * @param uri The qualifed namespace uri or empty string.
+ * @param localName The qualified local name.
+ * @param qName The qualified name.
+ * @return The qualified name of the element/attribute.
+ */
+ private String getQName(final String uri, final String localName, final String qName)
+ {
+ if (uri.length() > 0)
+ {
+ final String prefix = (String)activeNamespaces.get(uri) ;
+ if (prefix.length() > 0)
+ {
+ return prefix + ":" + localName ;
+ }
+ else
+ {
+ return localName ;
+ }
+ }
+ else
+ {
+ return qName ;
+ }
+ }
+
+ /**
+ * Check to see if the end of the start tag has been processed.
+ */
+ private void checkEndStartTag()
+ {
+ if (endStartTag)
+ {
+ printWriter.write('>') ;
+ endStartTag = false ;
+ }
+ }
+
+ /**
+ * Escape the contents of a text element.
+ * @param chars The character array.
+ * @param start The start index.
+ * @param length The length of this section.
+ */
+ private void escapeTextContent(final char[] chars, final int start, final int length)
+ {
+ final int end = start + length ;
+ for(int count = start ; count < end ; count++)
+ {
+ final char ch = chars[count] ;
+ switch(ch)
+ {
+ case '<':
+ printWriter.print("<") ;
+ break ;
+ case '>':
+ printWriter.print(">") ;
+ break ;
+ case '&':
+ printWriter.print("&") ;
+ break ;
+ case '"':
+ printWriter.print(""") ;
+ break ;
+ default:
+ printWriter.print(ch) ;
+ break ;
+ }
+ }
+ }
+
+ /**
+ * Return the to address from the processing.
+ * @return The to address.
+ */
+ public String getToAddress()
+ {
+ return toAddress ;
+ }
+
+ /**
+ * Return the identifier from the processing.
+ * @return The identifier.
+ */
+ public String getIdentifier()
+ {
+ return identifier ;
+ }
+
+ private static final class NamespaceInfo
+ {
+ /**
+ * The namespace prefix.
+ */
+ private final String prefix ;
+ /**
+ * The namespace uri.
+ */
+ private final String uri ;
+
+ /**
+ * Construct the namespace information.
+ * @param prefix The namespace prefix.
+ * @param uri The namespace uri.
+ */
+ NamespaceInfo(final String prefix, final String uri)
+ {
+ this.prefix = prefix ;
+ this.uri = uri ;
+ }
+
+ /**
+ * Get the namespace prefix.
+ * @return The namespace prefix.
+ */
+ String getPrefix()
+ {
+ return prefix ;
+ }
+
+ /**
+ * Get the namespace URI.
+ * @return The namespace URI.
+ */
+ String getURI()
+ {
+ return uri ;
+ }
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/proxy/WriterSAXHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/TestConstants.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/TestConstants.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/TestConstants.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,293 @@
+package com.jboss.transaction.txinterop.test ;
+
+import java.util.Map;
+import java.util.TreeMap;
+
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+
+/**
+ * This class contains constants used to map the front end onto
+ * the WS-TX interop tests.
+ * @author kevin
+ */
+public class TestConstants
+{
+ /**
+ * The name of the Service URI parameter.
+ */
+ public static final String PARAM_SERVICE_URI = "serviceuri" ;
+ /**
+ * The name of the test parameter.
+ */
+ public static final String PARAM_TEST = "test" ;
+ /**
+ * The name of the test timeout parameter.
+ */
+ public static final String PARAM_TEST_TIMEOUT = "testTimeout" ;
+ /**
+ * The name of the asynchronous test flag parameter.
+ */
+ public static final String PARAM_ASYNC_TEST = "asyncTest" ;
+
+ /**
+ * The name of the test results attribute.
+ */
+ public static final String ATTRIBUTE_TEST_RESULT = "testResult" ;
+ /**
+ * The name of the test validation attribute.
+ */
+ public static final String ATTRIBUTE_TEST_VALIDATION = "testValidation" ;
+ /**
+ * The name of the log count attribute.
+ */
+ public static final String ATTRIBUTE_LOG_COUNT = "logCount" ;
+ /**
+ * The name of the log name attribute.
+ */
+ public static final String ATTRIBUTE_LOG_NAME = "logName" ;
+
+ /**
+ * test name for all tests
+ */
+ public static final String NAME_ALL_TESTS = "allTests" ;
+ /**
+ * test name for all AT tests
+ */
+ public static final String NAME_ALL_AT_TESTS = "allATTests" ;
+ /**
+ * test name for all BA tests
+ */
+ public static final String NAME_ALL_BA_TESTS = "allBATests" ;
+ /**
+ * The prefix for all AT tests.
+ */
+ public static final String PREFIX_AT_TESTS = "testAT" ;
+ /**
+ * The prefix for all BA tests.
+ */
+ public static final String PREFIX_BA_TESTS = "testBA" ;
+
+ /**
+ * test name for AT Scenario 1.1
+ */
+ public static final String NAME_TEST_AT_1_1 = PREFIX_AT_TESTS + "1_1" ;
+ /**
+ * test description for AT Scenario 1.1
+ */
+ public static final String DESCRIPTION_TEST_AT_1_1 = "1.1 - " + ATInteropConstants.INTEROP_ELEMENT_COMPLETION_COMMIT ;
+ /**
+ * test name for AT Scenario 1.2
+ */
+ public static final String NAME_TEST_AT_1_2 = PREFIX_AT_TESTS + "1_2" ;
+ /**
+ * test description for AT Scenario 1.2
+ */
+ public static final String DESCRIPTION_TEST_AT_1_2 = "1.2 - " + ATInteropConstants.INTEROP_ELEMENT_COMPLETION_ROLLBACK ;
+ /**
+ * test name for AT Scenario 2.1
+ */
+ public static final String NAME_TEST_AT_2_1 = PREFIX_AT_TESTS + "2_1" ;
+ /**
+ * test description for AT Scenario 2.1
+ */
+ public static final String DESCRIPTION_TEST_AT_2_1 = "2.1 - " + ATInteropConstants.INTEROP_ELEMENT_COMMIT ;
+ /**
+ * test name for AT Scenario 2.2
+ */
+ public static final String NAME_TEST_AT_2_2 = PREFIX_AT_TESTS + "2_2" ;
+ /**
+ * test description for AT Scenario 2.2
+ */
+ public static final String DESCRIPTION_TEST_AT_2_2 = "2.2 - " + ATInteropConstants.INTEROP_ELEMENT_ROLLBACK ;
+ /**
+ * test name for AT Scenario 3.1
+ */
+ public static final String NAME_TEST_AT_3_1 = PREFIX_AT_TESTS + "3_1" ;
+ /**
+ * test description for AT Scenario 3.1
+ */
+ public static final String DESCRIPTION_TEST_AT_3_1 = "3.1 - " + ATInteropConstants.INTEROP_ELEMENT_PHASE_2_ROLLBACK ;
+ /**
+ * test name for AT Scenario 3.2
+ */
+ public static final String NAME_TEST_AT_3_2 = PREFIX_AT_TESTS + "3_2" ;
+ /**
+ * test description for AT Scenario 3.2
+ */
+ public static final String DESCRIPTION_TEST_AT_3_2 = "3.2 - " + ATInteropConstants.INTEROP_ELEMENT_READONLY ;
+ /**
+ * test name for AT Scenario 3.3
+ */
+ public static final String NAME_TEST_AT_3_3 = PREFIX_AT_TESTS + "3_3" ;
+ /**
+ * test description for AT Scenario 3.3
+ */
+ public static final String DESCRIPTION_TEST_AT_3_3 = "3.3 - " + ATInteropConstants.INTEROP_ELEMENT_VOLATILE_AND_DURABLE ;
+ /**
+ * test name for AT Scenario 4.1
+ */
+ public static final String NAME_TEST_AT_4_1 = PREFIX_AT_TESTS + "4_1" ;
+ /**
+ * test description for AT Scenario 4.1
+ */
+ public static final String DESCRIPTION_TEST_AT_4_1 = "4.1 - " + ATInteropConstants.INTEROP_ELEMENT_EARLY_READONLY ;
+ /**
+ * test name for AT Scenario 4.2
+ */
+ public static final String NAME_TEST_AT_4_2 = PREFIX_AT_TESTS + "4_2" ;
+ /**
+ * test description for AT Scenario 4.2
+ */
+ public static final String DESCRIPTION_TEST_AT_4_2 = "4.2 - " + ATInteropConstants.INTEROP_ELEMENT_EARLY_ABORTED ;
+ /**
+ * test name for AT Scenario 5.1
+ */
+ public static final String NAME_TEST_AT_5_1 = PREFIX_AT_TESTS + "5_1" ;
+ /**
+ * test description for AT Scenario 5.1
+ */
+ public static final String DESCRIPTION_TEST_AT_5_1 = "5.1 - " + ATInteropConstants.INTEROP_ELEMENT_REPLAY_ABORT ;
+ /**
+ * test name for AT Scenario 5.2
+ */
+ public static final String NAME_TEST_AT_5_2 = PREFIX_AT_TESTS + "5_2" ;
+ /**
+ * test description for AT Scenario 5.2
+ */
+ public static final String DESCRIPTION_TEST_AT_5_2 = "5.2 - " + ATInteropConstants.INTEROP_ELEMENT_REPLAY_COMMIT ;
+ /**
+ * test name for AT Scenario 5.3
+ */
+ public static final String NAME_TEST_AT_5_3 = PREFIX_AT_TESTS + "5_3" ;
+ /**
+ * test description for AT Scenario 5.3
+ */
+ public static final String DESCRIPTION_TEST_AT_5_3 = "5.3 - " + ATInteropConstants.INTEROP_ELEMENT_RETRY_PREPARED_COMMIT ;
+ /**
+ * test name for AT Scenario 5.4
+ */
+ public static final String NAME_TEST_AT_5_4 = PREFIX_AT_TESTS + "5_4" ;
+ /**
+ * test description for AT Scenario 5.4
+ */
+ public static final String DESCRIPTION_TEST_AT_5_4 = "5.4 - " + ATInteropConstants.INTEROP_ELEMENT_RETRY_PREPARED_ABORT ;
+ /**
+ * test name for AT Scenario 5.5
+ */
+ public static final String NAME_TEST_AT_5_5 = PREFIX_AT_TESTS + "5_5" ;
+ /**
+ * test description for AT Scenario 5.5
+ */
+ public static final String DESCRIPTION_TEST_AT_5_5 = "5.5 - " + ATInteropConstants.INTEROP_ELEMENT_RETRY_COMMIT ;
+ /**
+ * test name for AT Scenario 5.6
+ */
+ public static final String NAME_TEST_AT_5_6 = PREFIX_AT_TESTS + "5_6" ;
+ /**
+ * test description for AT Scenario 5.6
+ */
+ public static final String DESCRIPTION_TEST_AT_5_6 = "5.6 - " + ATInteropConstants.INTEROP_ELEMENT_RETRY_REPLAY ;
+ /**
+ * test name for AT Scenario 5.7
+ */
+ public static final String NAME_TEST_AT_5_7 = PREFIX_AT_TESTS + "5_7" ;
+ /**
+ * test description for AT Scenario 5.7
+ */
+ public static final String DESCRIPTION_TEST_AT_5_7 = "5.7 - " + ATInteropConstants.INTEROP_ELEMENT_PREPARED_AFTER_TIMEOUT ;
+ /**
+ * test name for AT Scenario 5.8
+ */
+ public static final String NAME_TEST_AT_5_8 = PREFIX_AT_TESTS + "5_8" ;
+ /**
+ * test description for AT Scenario 5.8
+ */
+ public static final String DESCRIPTION_TEST_AT_5_8 = "5.8 - " + ATInteropConstants.INTEROP_ELEMENT_LOST_COMMITTED ;
+
+ /**
+ * test name for BA Scenario 1.1
+ */
+ public static final String NAME_TEST_BA_1_1 = PREFIX_BA_TESTS + "1_1" ;
+ /**
+ * test description for BA Scenario 1.1
+ */
+ public static final String DESCRIPTION_TEST_BA_1_1 = "1.1 - " + BAInteropConstants.INTEROP_ELEMENT_PARTICIPANT_CLOSED ;
+ /**
+ * test name for BA Scenario 1.2
+ */
+ public static final String NAME_TEST_BA_1_2 = PREFIX_BA_TESTS + "1_2" ;
+ /**
+ * test description for BA Scenario 1.2
+ */
+ public static final String DESCRIPTION_TEST_BA_1_2 = "1.2 - " + BAInteropConstants.INTEROP_ELEMENT_PARTICIPANT_COMPENSATED ;
+ /**
+ * test name for BA Scenario 1.3
+ */
+ public static final String NAME_TEST_BA_1_3 = PREFIX_BA_TESTS + "1_3" ;
+ /**
+ * test description for BA Scenario 1.3
+ */
+ public static final String DESCRIPTION_TEST_BA_1_3 = "1.3 - " + BAInteropConstants.INTEROP_ELEMENT_PARTICIPANT_CANCELED ;
+ /**
+ * test name for BA Scenario 1.4
+ */
+ public static final String NAME_TEST_BA_1_4 = PREFIX_BA_TESTS + "1_4" ;
+ /**
+ * test description for BA Scenario 1.4
+ */
+ public static final String DESCRIPTION_TEST_BA_1_4 = "1.4 - " + BAInteropConstants.INTEROP_ELEMENT_PARTICIPANT_EXIT ;
+ /**
+ * test name for BA Scenario 1.5
+ */
+ public static final String NAME_TEST_BA_1_5 = PREFIX_BA_TESTS + "1_5" ;
+ /**
+ * test description for BA Scenario 1.5
+ */
+ public static final String DESCRIPTION_TEST_BA_1_5 = "1.5 - " + BAInteropConstants.INTEROP_ELEMENT_PARTICIPANT_FAULT ;
+ /**
+ * test name for BA Scenario 1.6
+ */
+ public static final String NAME_TEST_BA_1_6 = PREFIX_BA_TESTS + "1_6" ;
+ /**
+ * test description for BA Scenario 1.6
+ */
+ public static final String DESCRIPTION_TEST_BA_1_6 = "1.6 - " + BAInteropConstants.INTEROP_ELEMENT_PARTICIPANT_COMPENSATION_FAULT ;
+
+ /**
+ * The name to description map.
+ */
+ public static final Map DESCRIPTIONS ;
+
+ static
+ {
+ final TreeMap descriptions = new TreeMap() ;
+
+ descriptions.put(NAME_TEST_AT_1_1, DESCRIPTION_TEST_AT_1_1) ;
+ descriptions.put(NAME_TEST_AT_1_2, DESCRIPTION_TEST_AT_1_2) ;
+ descriptions.put(NAME_TEST_AT_2_1, DESCRIPTION_TEST_AT_2_1) ;
+ descriptions.put(NAME_TEST_AT_2_2, DESCRIPTION_TEST_AT_2_2) ;
+ descriptions.put(NAME_TEST_AT_3_1, DESCRIPTION_TEST_AT_3_1) ;
+ descriptions.put(NAME_TEST_AT_3_2, DESCRIPTION_TEST_AT_3_2) ;
+ descriptions.put(NAME_TEST_AT_3_3, DESCRIPTION_TEST_AT_3_3) ;
+ descriptions.put(NAME_TEST_AT_4_1, DESCRIPTION_TEST_AT_4_1) ;
+ descriptions.put(NAME_TEST_AT_4_2, DESCRIPTION_TEST_AT_4_2) ;
+ descriptions.put(NAME_TEST_AT_5_1, DESCRIPTION_TEST_AT_5_1) ;
+ descriptions.put(NAME_TEST_AT_5_2, DESCRIPTION_TEST_AT_5_2) ;
+ descriptions.put(NAME_TEST_AT_5_3, DESCRIPTION_TEST_AT_5_3) ;
+ descriptions.put(NAME_TEST_AT_5_4, DESCRIPTION_TEST_AT_5_4) ;
+ descriptions.put(NAME_TEST_AT_5_5, DESCRIPTION_TEST_AT_5_5) ;
+ descriptions.put(NAME_TEST_AT_5_6, DESCRIPTION_TEST_AT_5_6) ;
+ descriptions.put(NAME_TEST_AT_5_7, DESCRIPTION_TEST_AT_5_7) ;
+ descriptions.put(NAME_TEST_AT_5_8, DESCRIPTION_TEST_AT_5_8) ;
+
+ descriptions.put(NAME_TEST_BA_1_1, DESCRIPTION_TEST_BA_1_1) ;
+ descriptions.put(NAME_TEST_BA_1_2, DESCRIPTION_TEST_BA_1_2) ;
+ descriptions.put(NAME_TEST_BA_1_3, DESCRIPTION_TEST_BA_1_3) ;
+ descriptions.put(NAME_TEST_BA_1_4, DESCRIPTION_TEST_BA_1_4) ;
+ descriptions.put(NAME_TEST_BA_1_5, DESCRIPTION_TEST_BA_1_5) ;
+ descriptions.put(NAME_TEST_BA_1_6, DESCRIPTION_TEST_BA_1_6) ;
+
+ DESCRIPTIONS = descriptions ;
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/TestConstants.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/TestLogController.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/TestLogController.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/TestLogController.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,84 @@
+package com.jboss.transaction.txinterop.test;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+
+/**
+ * The test log controller.
+ * @author kevin
+ */
+public class TestLogController
+{
+ /**
+ * The base directory for logs, hardcoded for now.
+ */
+ private static File baseDir ;
+
+ static
+ {
+ final String userHome = System.getProperty("user.home") ;
+ baseDir = new File(userHome, "logs") ;
+ if (!baseDir.exists())
+ {
+ baseDir.mkdir() ;
+ }
+ }
+
+ /**
+ * Read the contents of the specified log.
+ * @param logName The log to retrieve.
+ * @return The log contents.
+ * @throws IOException for reading errors.
+ */
+ public static String readLog(final String logName)
+ throws IOException
+ {
+ final File logFile = new File(baseDir, logName) ;
+ if (logFile.exists() && logFile.canRead())
+ {
+ final FileReader reader = new FileReader(logFile) ;
+ try
+ {
+ final StringBuffer buffer = new StringBuffer() ;
+ final char[] charBuffer = new char[256] ;
+ while(reader.ready())
+ {
+ final int count = reader.read(charBuffer) ;
+ if (count > 0)
+ {
+ buffer.append(charBuffer, 0, count) ;
+ }
+ }
+ return buffer.toString() ;
+ }
+ finally
+ {
+ reader.close() ;
+ }
+ }
+ throw new IOException("Cannot read log file: " + logName) ;
+ }
+
+ /**
+ * Write the contents of the specified log.
+ * @param logName The log to write.
+ * @param contents The log contents.
+ * @throws IOException for reading errors.
+ */
+ public static void writeLog(final String logName, final String contents)
+ throws IOException
+ {
+ final File logFile = new File(baseDir, logName) ;
+ final FileWriter writer = new FileWriter(logFile) ;
+ try
+ {
+ writer.write(contents) ;
+ }
+ finally
+ {
+ writer.close() ;
+ }
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/TestLogController.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/TestLogServlet.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/TestLogServlet.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/TestLogServlet.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,96 @@
+package com.jboss.transaction.txinterop.test;
+
+import java.io.IOException;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.arjuna.webservices.util.ClassLoaderHelper;
+
+/**
+ * The test servlet.
+ * @author kevin
+ */
+public class TestLogServlet extends HttpServlet
+{
+ /**
+ * The servlet serial version UID.
+ */
+ private static final long serialVersionUID = 2566877081747112520L ;
+
+ /**
+ * The not found HTML page.
+ */
+ private String notFoundResponse ;
+ /**
+ * The directory contents HTML page.
+ */
+ private String directoryContents ;
+
+ /**
+ * Initialise the servlet.
+ * @param servletConfig The servlet configuration.
+ */
+ public void init(final ServletConfig servletConfig)
+ throws ServletException
+ {
+ super.init(servletConfig) ;
+ try
+ {
+ notFoundResponse = ClassLoaderHelper.getResourceAsString(TestLogServlet.class, "notFoundResponse.html") ;
+ directoryContents = ClassLoaderHelper.getResourceAsString(TestLogServlet.class, "directoryContents.html") ;
+ }
+ catch (final IOException ioe)
+ {
+ throw new ServletException("Failed to load HTML pages", ioe) ;
+ }
+ }
+
+ /**
+ * Return the specified logs
+ * @param request The HTTP servlet request.
+ * @param response The HTTP servlet response.
+ */
+ protected void doGet(final HttpServletRequest request, final HttpServletResponse response)
+ throws ServletException, IOException
+ {
+ final String logName = request.getPathInfo() ;
+ if ((logName == null) || (logName.length() == 0))
+ {
+ response.sendRedirect("logs/") ;
+ return ;
+ }
+ else if ("/".equals(logName))
+ {
+ response.setContentType("text/html") ;
+ response.setStatus(HttpServletResponse.SC_OK) ;
+ response.setContentLength(directoryContents.length()) ;
+ response.getOutputStream().print(directoryContents) ;
+ }
+ else
+ {
+ final String contents ;
+ try
+ {
+ contents = TestLogController.readLog(logName) ;
+ }
+ catch (final Throwable th)
+ {
+ log("Error reading log file", th) ;
+ response.setContentType("text/html") ;
+ response.setStatus(HttpServletResponse.SC_NOT_FOUND) ;
+ response.setContentLength(notFoundResponse.length()) ;
+ response.getOutputStream().print(notFoundResponse) ;
+ return ;
+ }
+
+ response.setContentType("text/xml") ;
+ response.setStatus(HttpServletResponse.SC_OK) ;
+ response.setContentLength(contents.length()) ;
+ response.getOutputStream().print(contents) ;
+ }
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/TestLogServlet.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/TestRunner.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/TestRunner.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/TestRunner.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,136 @@
+package com.jboss.transaction.txinterop.test;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestResult;
+import junit.framework.TestSuite;
+
+import com.jboss.transaction.txinterop.interop.ATTestCase;
+import com.jboss.transaction.txinterop.interop.BATestCase;
+import com.jboss.transaction.txinterop.interop.InteropTestCase;
+import com.jboss.transaction.txinterop.interop.InteropTestSuite;
+import com.jboss.transaction.txinterop.interop.MessageLogging;
+
+/**
+ * Class responsible for executing the appropriate JUnit test.
+ * @author kevin
+ */
+public class TestRunner
+{
+ /**
+ * The log message prefix.
+ */
+ private static final String LOG_MESSAGE_PREFIX = "<log:log xmlns:log=\"http://docs.oasis-open.org/ws-tx/logs/\">" ;
+ /**
+ * The log message suffix.
+ */
+ private static final String LOG_MESSAGE_SUFFIX = "</log:log>";
+
+ /**
+ * The AT test class.
+ */
+ private static final Class AT_TEST_CLASS = ATTestCase.class ;
+ /**
+ * The BA test class.
+ */
+ private static final Class BA_TEST_CLASS = BATestCase.class ;
+
+ /**
+ * Execute the specific test against the specified participant.
+ * @param participantURI The URI of the participant.
+ * @param testTimeout The test timeout.
+ * @param asyncTest The asynchronous test flag.
+ * @param testName The name of the test to execute.
+ * @return The test result.
+ */
+ public static TestResult execute(final String participantURI, final long testTimeout, final boolean asyncTest, final String testName)
+ {
+ MessageLogging.clearThreadLog() ;
+ final Test test ;
+ if (TestConstants.NAME_ALL_TESTS.equals(testName))
+ {
+ final TestSuite testSuite = new TestSuite() ;
+ testSuite.addTest(new InteropTestSuite(participantURI, testTimeout, asyncTest, AT_TEST_CLASS)) ;
+ testSuite.addTest(new InteropTestSuite(participantURI, testTimeout, asyncTest, BA_TEST_CLASS)) ;
+ test = testSuite ;
+ }
+ else if (TestConstants.NAME_ALL_AT_TESTS.equals(testName))
+ {
+ test = new InteropTestSuite(participantURI, testTimeout, asyncTest, AT_TEST_CLASS) ;
+ }
+ else if (TestConstants.NAME_ALL_BA_TESTS.equals(testName))
+ {
+ test = new InteropTestSuite(participantURI, testTimeout, asyncTest, BA_TEST_CLASS) ;
+ }
+ else if (testName.startsWith(TestConstants.PREFIX_AT_TESTS))
+ {
+ final Class testClass = AT_TEST_CLASS ;
+ try
+ {
+ test = createTest(testClass, participantURI, testTimeout, asyncTest, testName) ;
+ }
+ catch (final Throwable th)
+ {
+ System.err.println("Unexpected error instantiating test class: " + th) ;
+ return null ;
+ }
+ }
+ else if (testName.startsWith(TestConstants.PREFIX_BA_TESTS))
+ {
+ final Class testClass = BA_TEST_CLASS ;
+ try
+ {
+ test = createTest(testClass, participantURI, testTimeout, asyncTest, testName) ;
+ }
+ catch (final Throwable th)
+ {
+ System.err.println("Unexpected error instantiating test class: " + th) ;
+ return null ;
+ }
+ }
+ else
+ {
+ System.err.println("Unidentified test name: " + testName) ;
+ return null ;
+ }
+ MessageLogging.appendThreadLog(LOG_MESSAGE_PREFIX) ;
+ final TestResult testResult = new TestResult() ;
+ test.run(testResult) ;
+ MessageLogging.appendThreadLog(LOG_MESSAGE_SUFFIX) ;
+ return testResult ;
+ }
+
+ /**
+ * Create the test instance.
+ * @param testClass The test class name.
+ * @param participantURI The participant URI.
+ * @param testTimeout The test timeout.
+ * @param asyncTest The asynchronous test flag.
+ * @param testName The test name.
+ * @return The test instance.
+ * @throws IllegalAccessException For access exception instantiating the test class.
+ * @throws InstantiationException For errors instantiating the test class.
+ * @throws IllegalArgumentException For an invalid test class.
+ */
+ private static TestCase createTest(final Class testClass, final String participantURI, final long testTimeout, final boolean asyncTest, final String testName)
+ throws IllegalAccessException, InstantiationException, IllegalArgumentException
+ {
+ final Object testObject = testClass.newInstance() ;
+ if (testObject instanceof InteropTestCase)
+ {
+ final InteropTestCase interopTestCase = (InteropTestCase)testObject ;
+ interopTestCase.setParticipantURI(participantURI) ;
+ interopTestCase.setTestTimeout(testTimeout) ;
+ interopTestCase.setAsyncTest(asyncTest) ;
+ interopTestCase.setName(testName) ;
+ return interopTestCase ;
+ }
+ else if (testObject instanceof TestCase)
+ {
+ final TestCase test = (TestCase)testObject ;
+ test.setName(testName) ;
+ return test ;
+ }
+ throw new IllegalArgumentException("Invalid class: " + testClass.getName()) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/TestRunner.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/TestServlet.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/TestServlet.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/TestServlet.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,199 @@
+package com.jboss.transaction.txinterop.test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Templates;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import junit.framework.TestResult;
+
+import com.arjuna.webservices.util.ClassLoaderHelper;
+import com.jboss.transaction.txinterop.interop.MessageLogging;
+
+/**
+ * The test servlet.
+ * @author kevin
+ */
+public class TestServlet extends HttpServlet
+{
+ /**
+ * The servlet serial version UID.
+ */
+ private static final long serialVersionUID = 6764303043215036856L ;
+
+ /**
+ * The validation templates.
+ */
+ private Templates validationTemplates ;
+
+ /**
+ * Initialise the servlet.
+ * @param config The servlet configuration.
+ */
+ public void init(final ServletConfig config)
+ throws ServletException
+ {
+ super.init(config) ;
+
+ final InputStream is = ClassLoaderHelper.getResourceAsStream(getClass(), "processor.xsl") ;
+ if (is == null)
+ {
+ throw new ServletException("Cannot locate transformation stylesheet") ;
+ }
+ final TransformerFactory factory = TransformerFactory.newInstance() ;
+ try
+ {
+ validationTemplates = factory.newTemplates(new StreamSource(is)) ;
+ }
+ catch (final TransformerConfigurationException tce)
+ {
+ throw new ServletException("Error creating transformation template!", tce) ;
+ }
+ }
+
+ /**
+ * Execute the test
+ * @param request The HTTP servlet request.
+ * @param response The HTTP servlet response.
+ */
+ protected void doPost(final HttpServletRequest request, final HttpServletResponse response)
+ throws ServletException, IOException
+ {
+ final String serviceURI = request.getParameter(TestConstants.PARAM_SERVICE_URI) ;
+ final String test = request.getParameter(TestConstants.PARAM_TEST) ;
+ final String testTimeoutValue = request.getParameter(TestConstants.PARAM_TEST_TIMEOUT) ;
+ final String asyncTestValue = request.getParameter(TestConstants.PARAM_ASYNC_TEST) ;
+
+ final int serviceURILength = (serviceURI == null ? 0 : serviceURI.length()) ;
+ final int testLength = (test == null ? 0 : test.length()) ;
+
+ long testTimeout = 0 ;
+
+ boolean testTimeoutValid = false ;
+ if ((testTimeoutValue != null) && (testTimeoutValue.length() > 0))
+ {
+ try
+ {
+ testTimeout = Long.parseLong(testTimeoutValue) ;
+ testTimeoutValid = true ;
+ }
+ catch (final NumberFormatException nfe) {} // ignore
+ }
+
+ final boolean asyncTest = (asyncTestValue != null) ;
+
+ if ((serviceURILength == 0) || (testLength == 0) || !testTimeoutValid)
+ {
+ final RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/invalidParameters.html") ;
+ dispatcher.forward(request, response) ;
+ return ;
+ }
+
+ final HttpSession session = request.getSession() ;
+ final String id = session.getId() ;
+ final int logCount = getLogCount(session) ;
+ final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss") ;
+ final String date = format.format(new Date()) ;
+ final String logName = date + "-" + id + "-" + logCount ;
+
+ session.setAttribute(TestConstants.ATTRIBUTE_TEST_RESULT, null) ;
+ session.setAttribute(TestConstants.ATTRIBUTE_TEST_VALIDATION, null) ;
+ session.setAttribute(TestConstants.ATTRIBUTE_LOG_NAME, null) ;
+
+ final String threadLog ;
+ try
+ {
+ final TestResult result = TestRunner.execute(serviceURI, testTimeout, asyncTest, test) ;
+ if (result != null)
+ {
+ session.setAttribute(TestConstants.ATTRIBUTE_TEST_RESULT, result) ;
+
+ threadLog = MessageLogging.getThreadLog() ;
+
+ try
+ {
+ TestLogController.writeLog(logName, threadLog) ;
+ session.setAttribute(TestConstants.ATTRIBUTE_LOG_NAME, logName) ;
+ }
+ catch (final IOException ioe)
+ {
+ log("Unexpected IOException writing message log", ioe) ;
+ }
+ }
+ else
+ {
+ threadLog = null ;
+ }
+ }
+ finally
+ {
+ MessageLogging.clearThreadLog() ;
+ }
+
+ if ((threadLog != null) && (threadLog.length() > 0))
+ {
+ try
+ {
+ final String testValidation = transform(threadLog) ;
+ session.setAttribute(TestConstants.ATTRIBUTE_TEST_VALIDATION, testValidation) ;
+ }
+ catch (final Throwable th)
+ {
+ log("Unexpected throwable transforming message log", th) ;
+ }
+ }
+
+ final RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/results.jsp") ;
+ dispatcher.forward(request, response) ;
+ }
+
+ /**
+ * Get the log count from the session, incrementing afterwards.
+ * @param session The current HTTP session.
+ * @return The log count.
+ */
+ private int getLogCount(final HttpSession session)
+ {
+ final Object logCountObject = session.getAttribute(TestConstants.ATTRIBUTE_LOG_COUNT) ;
+ final int logCount = (logCountObject == null ? 1 : ((Integer)logCountObject).intValue() + 1) ;
+ session.setAttribute(TestConstants.ATTRIBUTE_LOG_COUNT, new Integer(logCount)) ;
+ return logCount ;
+ }
+
+ /**
+ * Transform the specified message log.
+ * @param messageLog The specified message log.
+ * @return The transformed result.
+ * @throws TransformerConfigurationException For transformer configuration errors.
+ * @throws TransformerException The transformation errors.
+ */
+ private String transform(final String messageLog)
+ throws TransformerConfigurationException, TransformerException
+ {
+ final Source source = new StreamSource(new StringReader(messageLog)) ;
+ final Transformer transformer = validationTemplates.newTransformer() ;
+ final StringWriter writer = new StringWriter() ;
+ final Result result = new StreamResult(writer) ;
+ transformer.transform(source, result) ;
+ return writer.toString() ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/TestServlet.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/directoryContents.html
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/directoryContents.html (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/directoryContents.html 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,25 @@
+<html>
+ <head>
+ <title>JBoss Transaction WS-TX interop results</title>
+ </head>
+ <body>
+ <h1>WS-TX Interop results</h1>
+ <!--
+ <p>These log files are the results of executing the JBoss Transaction WS-TX Interop client against public endpoints</p>
+ <table>
+ <thead>
+ <tr><td>Endpoint</td><td>Log file</td></tr>
+ </thead>
+ <tbody>
+ <tr><td>JBoss</td><td><a href="jboss-jboss.xml">jboss-jboss.xml</a></td></tr>
+ <tr><td>IBM</td><td><a href="jboss-ibm.xml">jboss-ibm.xml</a></td></tr>
+ <tr><td>Sun</td><td><a href="jboss-sun.xml">jboss-sun.xml</a></td></tr>
+ <tr><td>Microsoft</td><td><a href="jboss-msft.xml">jboss-msft.xml</a></td></tr>
+ <tr><td>Apache</td><td><a href="jboss-apache.xml">jboss-apache.xml</a></td></tr>
+ <tr><td>WSO2</td><td><a href="jboss-wso2.xml">jboss-wso2.xml</a></td></tr>
+ </tbody>
+ </table>
+ -->
+ <p>Please send any queries to the <a href="mailto:kevin.conner at jboss.com?subject=Log%20results%20query">interop test contact</a></p>
+ </body>
+</html>
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/directoryContents.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/notFoundResponse.html
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/notFoundResponse.html (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/notFoundResponse.html 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,9 @@
+<html>
+ <head>
+ <title>Log file not found</title>
+ </head>
+ <body>
+ <h1>Log file not found</h1>
+ Requested log file could not be found
+ </body>
+</html>
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/notFoundResponse.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/processor.xsl
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/processor.xsl (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/processor.xsl 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/ws-addressing/testsuite/observer/processor.xsl
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/test/processor.xsl
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/InteropConstants.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/InteropConstants.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/InteropConstants.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,12 @@
+package com.jboss.transaction.txinterop.webservices;
+
+/**
+ * Interface containing WS-TX Interop constants.
+ */
+public interface InteropConstants
+{
+ /**
+ * The interop test participant service name.
+ */
+ public String SERVICE_PARTICIPANT = "TXParticipant" ;
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/InteropConstants.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ATInteropConstants.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ATInteropConstants.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ATInteropConstants.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,266 @@
+package com.jboss.transaction.txinterop.webservices.atinterop;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Interface containing WS-TX AT Interop constants.
+ */
+public interface ATInteropConstants
+{
+ /**
+ * The interop test initiator service name.
+ */
+ public String SERVICE_INITIATOR = "TX10ATInitiator" ;
+
+ /**
+ * The interop Namespace.
+ */
+ public String INTEROP_NAMESPACE = "http://fabrikam123.com" ;
+ /**
+ * The interop namespace prefix.
+ */
+ public String INTEROP_PREFIX = "atinterop" ;
+
+ /**
+ * The participant action prefix.
+ */
+ public String INTEROP_ACTION_PARTICIPANT_PREFIX = INTEROP_NAMESPACE + "/ParticipantPortType/" ;
+ /**
+ * The initiator action prefix.
+ */
+ public String INTEROP_ACTION_INITIATOR_PREFIX = INTEROP_NAMESPACE + "/InitiatorPortType/" ;
+
+ /**
+ * The completion commit element.
+ */
+ public String INTEROP_ELEMENT_COMPLETION_COMMIT = "CompletionCommit" ;
+ /**
+ * The completion commit QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_COMPLETION_COMMIT = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_COMPLETION_COMMIT, INTEROP_PREFIX) ;
+ /**
+ * The completion commit Action.
+ */
+ public String INTEROP_ACTION_COMPLETION_COMMIT = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_COMPLETION_COMMIT ;
+
+ /**
+ * The completion rollback element.
+ */
+ public String INTEROP_ELEMENT_COMPLETION_ROLLBACK = "CompletionRollback" ;
+ /**
+ * The completion rollback QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_COMPLETION_ROLLBACK = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_COMPLETION_ROLLBACK, INTEROP_PREFIX) ;
+ /**
+ * The completion rollback Action.
+ */
+ public String INTEROP_ACTION_COMPLETION_ROLLBACK = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_COMPLETION_ROLLBACK ;
+
+ /**
+ * The commit element.
+ */
+ public String INTEROP_ELEMENT_COMMIT = "Commit" ;
+ /**
+ * The commit QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_COMMIT = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_COMMIT, INTEROP_PREFIX) ;
+ /**
+ * The commit Action.
+ */
+ public String INTEROP_ACTION_COMMIT = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_COMMIT ;
+
+ /**
+ * The rollback element.
+ */
+ public String INTEROP_ELEMENT_ROLLBACK = "Rollback" ;
+ /**
+ * The rollback QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_ROLLBACK = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_ROLLBACK, INTEROP_PREFIX) ;
+ /**
+ * The rollback Action.
+ */
+ public String INTEROP_ACTION_ROLLBACK = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_ROLLBACK ;
+
+ /**
+ * The phase 2 rollback element.
+ */
+ public String INTEROP_ELEMENT_PHASE_2_ROLLBACK = "Phase2Rollback" ;
+ /**
+ * The phase 2 rollback QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_PHASE_2_ROLLBACK = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_PHASE_2_ROLLBACK, INTEROP_PREFIX) ;
+ /**
+ * The phase 2 rollback Action.
+ */
+ public String INTEROP_ACTION_PHASE_2_ROLLBACK = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_PHASE_2_ROLLBACK ;
+
+ /**
+ * The readonly element.
+ */
+ public String INTEROP_ELEMENT_READONLY = "Readonly" ;
+ /**
+ * The readonly QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_READONLY = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_READONLY, INTEROP_PREFIX) ;
+ /**
+ * The readonly Action.
+ */
+ public String INTEROP_ACTION_READONLY = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_READONLY ;
+
+ /**
+ * The volatile and durable element.
+ */
+ public String INTEROP_ELEMENT_VOLATILE_AND_DURABLE = "VolatileAndDurable" ;
+ /**
+ * The volatile and durable QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_VOLATILE_AND_DURABLE = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_VOLATILE_AND_DURABLE, INTEROP_PREFIX) ;
+ /**
+ * The volatile and durable Action.
+ */
+ public String INTEROP_ACTION_VOLATILE_AND_DURABLE = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_VOLATILE_AND_DURABLE ;
+
+ /**
+ * The early readonly element.
+ */
+ public String INTEROP_ELEMENT_EARLY_READONLY = "EarlyReadonly" ;
+ /**
+ * The early readonly QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_EARLY_READONLY = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_EARLY_READONLY, INTEROP_PREFIX) ;
+ /**
+ * The early readonly Action.
+ */
+ public String INTEROP_ACTION_EARLY_READONLY = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_EARLY_READONLY ;
+
+ /**
+ * The early aborted element.
+ */
+ public String INTEROP_ELEMENT_EARLY_ABORTED = "EarlyAborted" ;
+ /**
+ * The early aborted QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_EARLY_ABORTED = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_EARLY_ABORTED, INTEROP_PREFIX) ;
+ /**
+ * The early aborted Action.
+ */
+ public String INTEROP_ACTION_EARLY_ABORTED = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_EARLY_ABORTED ;
+
+ /**
+ * The replay abort element.
+ */
+ public String INTEROP_ELEMENT_REPLAY_ABORT = "ReplayAbort" ;
+ /**
+ * The replay abort QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_REPLAY_ABORT = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_REPLAY_ABORT, INTEROP_PREFIX) ;
+ /**
+ * The replay abort Action.
+ */
+ public String INTEROP_ACTION_REPLAY_ABORT = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_REPLAY_ABORT ;
+
+ /**
+ * The replay commit element.
+ */
+ public String INTEROP_ELEMENT_REPLAY_COMMIT = "ReplayCommit" ;
+ /**
+ * The replay commit QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_REPLAY_COMMIT = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_REPLAY_COMMIT, INTEROP_PREFIX) ;
+ /**
+ * The replay commit Action.
+ */
+ public String INTEROP_ACTION_REPLAY_COMMIT = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_REPLAY_COMMIT ;
+
+ /**
+ * The retry prepared commit element.
+ */
+ public String INTEROP_ELEMENT_RETRY_PREPARED_COMMIT = "RetryPreparedCommit" ;
+ /**
+ * The retry prepared commit QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_RETRY_PREPARED_COMMIT = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_RETRY_PREPARED_COMMIT, INTEROP_PREFIX) ;
+ /**
+ * The retry prepared commit Action.
+ */
+ public String INTEROP_ACTION_RETRY_PREPARED_COMMIT = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_RETRY_PREPARED_COMMIT ;
+
+ /**
+ * The retry prepared abort element.
+ */
+ public String INTEROP_ELEMENT_RETRY_PREPARED_ABORT = "RetryPreparedAbort" ;
+ /**
+ * The retry prepared abort QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_RETRY_PREPARED_ABORT = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_RETRY_PREPARED_ABORT, INTEROP_PREFIX) ;
+ /**
+ * The retry prepared abort Action.
+ */
+ public String INTEROP_ACTION_RETRY_PREPARED_ABORT = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_RETRY_PREPARED_ABORT ;
+
+ /**
+ * The retry commit element.
+ */
+ public String INTEROP_ELEMENT_RETRY_COMMIT = "RetryCommit" ;
+ /**
+ * The retry commit QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_RETRY_COMMIT = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_RETRY_COMMIT, INTEROP_PREFIX) ;
+ /**
+ * The retry commit Action.
+ */
+ public String INTEROP_ACTION_RETRY_COMMIT = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_RETRY_COMMIT ;
+
+ /**
+ * The retry replay element.
+ */
+ public String INTEROP_ELEMENT_RETRY_REPLAY = "RetryReplay" ;
+ /**
+ * The retry replay QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_RETRY_REPLAY = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_RETRY_REPLAY, INTEROP_PREFIX) ;
+ /**
+ * The retry replay Action.
+ */
+ public String INTEROP_ACTION_RETRY_REPLAY = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_RETRY_REPLAY ;
+
+ /**
+ * The prepared after timeout element.
+ */
+ public String INTEROP_ELEMENT_PREPARED_AFTER_TIMEOUT = "PreparedAfterTimeout" ;
+ /**
+ * The prepared after timeout QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_PREPARED_AFTER_TIMEOUT = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_PREPARED_AFTER_TIMEOUT, INTEROP_PREFIX) ;
+ /**
+ * The prepared after timeout Action.
+ */
+ public String INTEROP_ACTION_PREPARED_AFTER_TIMEOUT = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_PREPARED_AFTER_TIMEOUT ;
+
+ /**
+ * The lost committed element.
+ */
+ public String INTEROP_ELEMENT_LOST_COMMITTED = "LostCommitted" ;
+ /**
+ * The lost committed QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_LOST_COMMITTED = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_LOST_COMMITTED, INTEROP_PREFIX) ;
+ /**
+ * The lost committed Action.
+ */
+ public String INTEROP_ACTION_LOST_COMMITTED = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_LOST_COMMITTED ;
+
+ /**
+ * The response element.
+ */
+ public String INTEROP_ELEMENT_RESPONSE = "Response" ;
+ /**
+ * The response QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_RESPONSE = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_RESPONSE, INTEROP_PREFIX) ;
+ /**
+ * The response Action.
+ */
+ public String INTEROP_ACTION_RESPONSE = INTEROP_ACTION_INITIATOR_PREFIX + INTEROP_ELEMENT_RESPONSE ;
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ATInteropConstants.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ATInteropUtil.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ATInteropUtil.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ATInteropUtil.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,145 @@
+package com.jboss.transaction.txinterop.webservices.atinterop;
+
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.wsaddr.AttributedURIType;
+import com.arjuna.webservices.wsaddr.EndpointReferenceType;
+import com.arjuna.webservices.wsat.AtomicTransactionConstants;
+import com.arjuna.webservices.wsat.processors.ParticipantProcessor;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.arjuna.webservices.wsarj.InstanceIdentifier;
+import com.arjuna.wsc.ActivationCoordinator;
+import com.arjuna.wsc.RegistrationCoordinator;
+import com.arjuna.wsc.messaging.MessageId;
+import com.arjuna.wst.CompletionCoordinatorParticipant;
+import com.arjuna.wst.Durable2PCParticipant;
+import com.arjuna.wst.Participant;
+import com.arjuna.wst.Volatile2PCParticipant;
+import com.arjuna.wst.messaging.engines.ParticipantEngine;
+import com.arjuna.wst.stub.CompletionStub;
+
+/**
+ * Utility methods
+ */
+public class ATInteropUtil
+{
+ /**
+ * Get a coordination context.
+ * @param coordinatorURI The coordinator URI.
+ * @return The coordination context.
+ * @throws Exception for errors.
+ */
+ public static CoordinationContextType createCoordinationContext(final String coordinatorURI)
+ throws Exception
+ {
+ return ActivationCoordinator.createCoordinationContext(coordinatorURI, MessageId.getMessageId(), AtomicTransactionConstants.WSAT_PROTOCOL, null, null) ;
+ }
+
+ /**
+ * Register for completion.
+ * @param context The coordination context.
+ * @return The endpoint for communicating with the coordinator.
+ * @throws Exception for errors.
+ */
+ public static CompletionCoordinatorParticipant registerCompletion(final CoordinationContextType context, final String id)
+ throws Exception
+ {
+ final EndpointReferenceType completionCoordinator = register(context, getCompletionParticipant(id), AtomicTransactionConstants.WSAT_SUB_PROTOCOL_COMPLETION) ;
+ return new CompletionStub(id, completionCoordinator);
+ }
+
+ /**
+ * Register a durable participant in the specified coordination context.
+ * @param context The coordination context.
+ * @param participant The durable 2PC participant
+ * @param id The participant id.
+ * @return The participant engine.
+ * @throws Exception for errors.
+ */
+ public static ParticipantEngine registerDurable2PC(final CoordinationContextType context, final Durable2PCParticipant participant, final String id)
+ throws Exception
+ {
+ return registerParticipant(context, participant, id, AtomicTransactionConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC) ;
+ }
+
+ /**
+ * Register a volatile participant in the specified coordination context.
+ * @param context The coordination context.
+ * @param participant The volatile 2PC participant
+ * @param id The participant id.
+ * @return The participant engine.
+ * @throws Exception for errors.
+ */
+ public static ParticipantEngine registerVolatile2PC(final CoordinationContextType context, final Volatile2PCParticipant participant, final String id)
+ throws Exception
+ {
+ return registerParticipant(context, participant, id, AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC) ;
+ }
+
+ /**
+ * Register the participant in the specified coordination context.
+ * @param context The coordination context.
+ * @param participant The participant.
+ * @param id The participant id.
+ * @param protocol The sub protocol to register for.
+ * @return The participant engine.
+ * @throws Exception for errors.
+ */
+ private static ParticipantEngine registerParticipant(final CoordinationContextType context, final Participant participant, final String id, final String protocol)
+ throws Exception
+ {
+ final EndpointReferenceType coordinator = RegistrationCoordinator.register(context, MessageId.getMessageId(),
+ getParticipant(id), protocol) ;
+ final ParticipantEngine engine = new ParticipantEngine(participant, id, coordinator) ;
+ ParticipantProcessor.getProcessor().activateParticipant(engine, id) ;
+ return engine ;
+ }
+
+ /**
+ * Register for a sub protocol.
+ * @param context The coordination context.
+ * @param participant The participant EPR.
+ * @param protocol The protocol.
+ * @return The coordinator endpoint.
+ * @throws Exception for errors.
+ */
+ private static EndpointReferenceType register(final CoordinationContextType context, final EndpointReferenceType participant, final String protocol)
+ throws Exception
+ {
+ return RegistrationCoordinator.register(context, MessageId.getMessageId(), participant, protocol) ;
+ }
+
+ /**
+ * Get the endpoint reference for completion.
+ * @param id The completion id.
+ * @return The endpoint reference.
+ */
+ private static EndpointReferenceType getCompletionParticipant(final String id)
+ {
+ return getEndpointReference(AtomicTransactionConstants.SERVICE_COMPLETION_INITIATOR, id) ;
+ }
+
+ /**
+ * Get the endpoint reference for a participant.
+ * @param id The participant id.
+ * @return The endpoint reference.
+ */
+ private static EndpointReferenceType getParticipant(final String id)
+ {
+ return getEndpointReference(AtomicTransactionConstants.SERVICE_PARTICIPANT, id) ;
+ }
+
+ /**
+ * Get the endpoint reference for a service.
+ * @param service The service.
+ * @param id The service id.
+ * @return The endpoint reference.
+ */
+ private static EndpointReferenceType getEndpointReference(final String service, final String id)
+ {
+ final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+ final String serviceURI = soapRegistry.getServiceURI(service) ;
+ final EndpointReferenceType participant = new EndpointReferenceType(new AttributedURIType(serviceURI)) ;
+ InstanceIdentifier.setEndpointInstanceIdentifier(participant, id) ;
+ return participant ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ATInteropUtil.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/AsyncParticipantStub.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/AsyncParticipantStub.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/AsyncParticipantStub.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,608 @@
+package com.jboss.transaction.txinterop.webservices.atinterop;
+
+import java.io.IOException;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.soap.Soap11Details;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.arjuna.wsc.messaging.MessageId;
+import com.jboss.transaction.txinterop.webservices.atinterop.client.AsyncParticipantClient;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATInitiatorCallback;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATInitiatorProcessor;
+
+/**
+ * The participant stub.
+ */
+public class AsyncParticipantStub implements ParticipantStub
+{
+ /**
+ * The SOAP 1.1 details.
+ */
+ private static final SoapDetails SOAP_DETAILS = new Soap11Details() ;
+
+ /***
+ * The participant stub singletong.
+ */
+ private static final ParticipantStub PARTICIPANT_STUB = new AsyncParticipantStub() ;
+
+ /**
+ * Get the participant stub singleton.
+ * @return The participant stub singleton.
+ */
+ public static ParticipantStub getParticipantStub()
+ {
+ return PARTICIPANT_STUB ;
+ }
+
+ /**
+ * Send a completion commit request.
+ * @param serviceURI The target service URI.
+ * @param coordinatorURI The coordinator URI.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void completionCommit(final String serviceURI, final String coordinatorURI)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendCompletionCommit(addressingContext, SOAP_DETAILS, coordinatorURI) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a completion rollback request.
+ * @param serviceURI The target service URI.
+ * @param coordinatorURI The coordinator URI.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void completionRollback(final String serviceURI, final String coordinatorURI)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendCompletionRollback(addressingContext, SOAP_DETAILS, coordinatorURI) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a commit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void commit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendCommit(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a rollback request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void rollback(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendRollback(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a phase2Rollback request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void phase2Rollback(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendPhase2Rollback(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a readonly request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void readonly(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendReadonly(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a volatileAndDurable request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void volatileAndDurable(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendVolatileAndDurable(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send an earlyReadonly request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void earlyReadonly(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendEarlyReadonly(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a earlyAborted request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void earlyAborted(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendEarlyAborted(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a replayAbort request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void replayAbort(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendReplayAbort(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a replayCommit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void replayCommit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendReplayCommit(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a retryPreparedCommit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void retryPreparedCommit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendRetryPreparedCommit(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a retryPreparedAbort request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void retryPreparedAbort(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendRetryPreparedAbort(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a retryCommit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void retryCommit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendRetryCommit(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a retryReplay request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void retryReplay(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendRetryReplay(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a preparedAfterTimeout request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void preparedAfterTimeout(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendPreparedAfterTimeout(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a lostCommitted request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void lostCommitted(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendLostCommitted(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Handle the callback.
+ * @param callback The callback.
+ * @throws SoapFault for errors.
+ */
+ private static void handleCallback(final RequestCallback callback)
+ throws SoapFault
+ {
+ if (callback.hasFailed())
+ {
+ throw new SoapFault(SoapFaultType.FAULT_RECEIVER, null, "Callback execution failed") ;
+ }
+ else if (!callback.hasTriggered())
+ {
+ throw new SoapFault(SoapFaultType.FAULT_RECEIVER, null, "Callback wasn't triggered") ;
+ }
+ else if (!callback.isResponse())
+ {
+ throw callback.getSoapFault() ;
+ }
+ }
+
+ /**
+ * The request callback class.
+ */
+ private static final class RequestCallback extends ATInitiatorCallback
+ {
+ /**
+ * The response flag.
+ */
+ private boolean response ;
+ /**
+ * The SOAP fault response.
+ */
+ private SoapFault soapFault ;
+
+ /**
+ * A response.
+ * @param response The response.
+ * @param addressingContext The current addressing context.
+ */
+ public void response(final TestMessageType response,
+ final AddressingContext addressingContext)
+ {
+ this.response = true ;
+ }
+
+ /**
+ * 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 ;
+ }
+
+ /**
+ * Was a response received?
+ * @return true if a response was received, false otherwise.
+ */
+ boolean isResponse()
+ {
+ return response ;
+ }
+
+ /**
+ * Get the SOAP fault.
+ * @return The SOAP fault or null.
+ */
+ SoapFault getSoapFault()
+ {
+ return soapFault ;
+ }
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/AsyncParticipantStub.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ParticipantStub.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ParticipantStub.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ParticipantStub.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,182 @@
+package com.jboss.transaction.txinterop.webservices.atinterop;
+
+import java.io.IOException;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+
+/**
+ * The interface for the participant stub.
+ */
+public interface ParticipantStub
+{
+ /**
+ * Send a completion commit request.
+ * @param serviceURI The target service URI.
+ * @param coordinatorURI The coordinator URI.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void completionCommit(final String serviceURI, final String coordinatorURI)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a completion rollback request.
+ * @param serviceURI The target service URI.
+ * @param coordinatorURI The coordinator URI.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void completionRollback(final String serviceURI, final String coordinatorURI)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a commit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void commit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a rollback request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void rollback(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a phase2Rollback request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void phase2Rollback(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a readonly request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void readonly(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a volatileAndDurable request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void volatileAndDurable(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send an earlyReadonly request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void earlyReadonly(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a earlyAborted request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void earlyAborted(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a replayAbort request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void replayAbort(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a replayCommit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void replayCommit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a retryPreparedCommit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void retryPreparedCommit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a retryPreparedAbort request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void retryPreparedAbort(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a retryCommit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void retryCommit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a retryReplay request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void retryReplay(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a preparedAfterTimeout request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void preparedAfterTimeout(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a lostCommitted request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void lostCommitted(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ParticipantStub.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/SyncParticipantStub.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/SyncParticipantStub.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/SyncParticipantStub.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,308 @@
+package com.jboss.transaction.txinterop.webservices.atinterop;
+
+import java.io.IOException;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.Soap11Details;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.arjuna.wsc.messaging.MessageId;
+import com.jboss.transaction.txinterop.webservices.atinterop.client.SyncParticipantClient;
+
+/**
+ * The participant stub.
+ */
+public class SyncParticipantStub implements ParticipantStub
+{
+ /**
+ * The SOAP 1.1 details.
+ */
+ private static final SoapDetails SOAP_DETAILS = new Soap11Details() ;
+
+ /***
+ * The participant stub singletong.
+ */
+ private static final ParticipantStub PARTICIPANT_STUB = new SyncParticipantStub() ;
+
+ /**
+ * Get the participant stub singleton.
+ * @return The participant stub singleton.
+ */
+ public static ParticipantStub getParticipantStub()
+ {
+ return PARTICIPANT_STUB ;
+ }
+
+ /**
+ * Send a completion commit request.
+ * @param serviceURI The target service URI.
+ * @param coordinatorURI The coordinator URI.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void completionCommit(final String serviceURI, final String coordinatorURI)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendCompletionCommit(addressingContext, SOAP_DETAILS, coordinatorURI) ;
+ }
+
+ /**
+ * Send a completion rollback request.
+ * @param serviceURI The target service URI.
+ * @param coordinatorURI The coordinator URI.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void completionRollback(final String serviceURI, final String coordinatorURI)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendCompletionRollback(addressingContext, SOAP_DETAILS, coordinatorURI) ;
+ }
+
+ /**
+ * Send a commit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void commit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendCommit(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a rollback request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void rollback(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendRollback(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a phase2Rollback request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void phase2Rollback(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendPhase2Rollback(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a readonly request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void readonly(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendReadonly(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a volatileAndDurable request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void volatileAndDurable(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendVolatileAndDurable(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send an earlyReadonly request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void earlyReadonly(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendEarlyReadonly(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a earlyAborted request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void earlyAborted(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendEarlyAborted(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a replayAbort request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void replayAbort(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendReplayAbort(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a replayCommit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void replayCommit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendReplayCommit(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a retryPreparedCommit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void retryPreparedCommit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendRetryPreparedCommit(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a retryPreparedAbort request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void retryPreparedAbort(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendRetryPreparedAbort(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a retryCommit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void retryCommit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendRetryCommit(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a retryReplay request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void retryReplay(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendRetryReplay(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a preparedAfterTimeout request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void preparedAfterTimeout(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendPreparedAfterTimeout(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a lostCommitted request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void lostCommitted(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendLostCommitted(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/SyncParticipantStub.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/TestMessageType.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/TestMessageType.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/TestMessageType.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,70 @@
+/*
+ * 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.jboss.transaction.txinterop.webservices.atinterop;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.stax.ElementContent;
+
+/*
+ * <xsd:complexType name="TestMessageType">
+ * <xsd:sequence/>
+ * </xsd:complexType>
+ */
+/**
+ * Representation of the Test Message type.
+ * @author kevin
+ */
+public class TestMessageType extends ElementContent
+{
+ /**
+ * Default constructor.
+ */
+ public TestMessageType()
+ {
+ }
+
+ /**
+ * Construct a register response from the input stream.
+ *
+ * @param in The input stream.
+ * @throws XMLStreamException For errors during parsing.
+ */
+ public TestMessageType(final XMLStreamReader in)
+ throws XMLStreamException
+ {
+ parse(in) ;
+ }
+
+ /**
+ * Add the element.
+ * @param in The current input stream.
+ * @param elementName The qualified element name.
+ */
+ protected void putElement(final XMLStreamReader in,
+ final QName elementName)
+ throws XMLStreamException
+ {
+ throw new XMLStreamException("Unexpected element name: " + elementName) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/TestMessageType.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/AsyncParticipantClient.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/AsyncParticipantClient.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/AsyncParticipantClient.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,531 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.client;
+
+import java.io.IOException;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.SoapService;
+import com.arjuna.webservices.base.policy.ClientPolicy;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.TextElement;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wsaddr.AttributedURIType;
+import com.arjuna.webservices.wsaddr.EndpointReferenceType;
+import com.arjuna.webservices.wsaddr.client.BaseWSAddrClient;
+import com.arjuna.webservices.wsaddr.policy.AddressingPolicy;
+import com.arjuna.webservices.wscoor.CoordinationContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.arjuna.webservices.wscoor.policy.CoordinationContextPolicy;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+
+/**
+ * The participant client.
+ * @author kevin
+ */
+public class AsyncParticipantClient extends BaseWSAddrClient
+{
+ /**
+ * The client singleton.
+ */
+ private static final AsyncParticipantClient CLIENT = new AsyncParticipantClient() ;
+
+ /**
+ * The completion commit action.
+ */
+ private final String completionCommitAction = ATInteropConstants.INTEROP_ACTION_COMPLETION_COMMIT ;
+ /**
+ * The completion rollback Action.
+ */
+ private final String completionRollbackAction = ATInteropConstants.INTEROP_ACTION_COMPLETION_ROLLBACK ;
+ /**
+ * The commit Action.
+ */
+ private final String commitAction = ATInteropConstants.INTEROP_ACTION_COMMIT ;
+ /**
+ * The rollback Action.
+ */
+ private final String rollbackAction = ATInteropConstants.INTEROP_ACTION_ROLLBACK ;
+ /**
+ * The phase 2 rollback Action.
+ */
+ private final String phase2RollbackAction = ATInteropConstants.INTEROP_ACTION_PHASE_2_ROLLBACK ;
+ /**
+ * The readonly Action.
+ */
+ private final String readonlyAction = ATInteropConstants.INTEROP_ACTION_READONLY ;
+ /**
+ * The volatile and durable Action.
+ */
+ private final String volatileAndDurableAction = ATInteropConstants.INTEROP_ACTION_VOLATILE_AND_DURABLE ;
+ /**
+ * The early readonly Action.
+ */
+ private final String earlyReadonlyAction = ATInteropConstants.INTEROP_ACTION_EARLY_READONLY ;
+ /**
+ * The early aborted Action.
+ */
+ private final String earlyAbortedAction = ATInteropConstants.INTEROP_ACTION_EARLY_ABORTED ;
+ /**
+ * The replay abort Action.
+ */
+ private final String replayAbortAction = ATInteropConstants.INTEROP_ACTION_REPLAY_ABORT ;
+ /**
+ * The replay commit Action.
+ */
+ private final String replayCommitAction = ATInteropConstants.INTEROP_ACTION_REPLAY_COMMIT ;
+ /**
+ * The retry prepared commit Action.
+ */
+ private final String retryPreparedCommitAction = ATInteropConstants.INTEROP_ACTION_RETRY_PREPARED_COMMIT ;
+ /**
+ * The retry prepared abort Action.
+ */
+ private final String retryPreparedAbortAction = ATInteropConstants.INTEROP_ACTION_RETRY_PREPARED_ABORT ;
+ /**
+ * The retry commit Action.
+ */
+ private final String retryCommitAction = ATInteropConstants.INTEROP_ACTION_RETRY_COMMIT ;
+ /**
+ * The retry replay Action.
+ */
+ private final String retryReplayAction = ATInteropConstants.INTEROP_ACTION_RETRY_REPLAY ;
+ /**
+ * The prepared after timeout Action.
+ */
+ private final String preparedAfterTimeoutAction = ATInteropConstants.INTEROP_ACTION_PREPARED_AFTER_TIMEOUT ;
+ /**
+ * The lost committed Action.
+ */
+ private final String lostCommittedAction = ATInteropConstants.INTEROP_ACTION_LOST_COMMITTED ;
+
+ /**
+ * The SOAP service representing the client.
+ */
+ private final SoapService soapService ;
+ /**
+ * The initiator URI for replies.
+ */
+ private final EndpointReferenceType initiator ;
+
+ /**
+ * Construct the interop synch client.
+ */
+ private AsyncParticipantClient()
+ {
+ final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+ // Add WS-Addressing
+ AddressingPolicy.register(handlerRegistry) ;
+ // Add coordination context
+ CoordinationContextPolicy.register(handlerRegistry) ;
+ // Add client policies
+ ClientPolicy.register(handlerRegistry) ;
+
+ soapService = new SoapService(handlerRegistry) ;
+ final String initiatorURI = SoapRegistry.getRegistry().getServiceURI(ATInteropConstants.SERVICE_INITIATOR) ;
+ initiator = new EndpointReferenceType(new AttributedURIType(initiatorURI)) ;
+ }
+
+ /**
+ * Send a completion commit request.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @param coordinatorURI The coordinator URI.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendCompletionCommit(final AddressingContext addressingContext, final SoapDetails soapDetails, final String coordinatorURI)
+ throws SoapFault, IOException
+ {
+ final TextElement completionCommit = new TextElement(coordinatorURI) ;
+ sendOneWay(completionCommit, addressingContext, soapService, initiator, initiator,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_COMPLETION_COMMIT,
+ new AttributedURIType(completionCommitAction)) ;
+ }
+
+ /**
+ * Send a completion rollback request.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @param coordinatorURI The coordinator URI.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendCompletionRollback(final AddressingContext addressingContext, final SoapDetails soapDetails, final String coordinatorURI)
+ throws SoapFault, IOException
+ {
+ final TextElement completionRollback = new TextElement(coordinatorURI) ;
+ sendOneWay(completionRollback, addressingContext, soapService, initiator, initiator,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_COMPLETION_ROLLBACK,
+ new AttributedURIType(completionRollbackAction)) ;
+ }
+
+ /**
+ * Send a commit request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendCommit(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ sendOneWay(new TestMessageType(), addressingContext, soapService, initiator, initiator,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_COMMIT, new AttributedURIType(commitAction)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a rollback request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendRollback(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ sendOneWay(new TestMessageType(), addressingContext, soapService, initiator, initiator,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_ROLLBACK, new AttributedURIType(rollbackAction)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a phase2Rollback request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendPhase2Rollback(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ sendOneWay(new TestMessageType(), addressingContext, soapService, initiator, initiator,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_PHASE_2_ROLLBACK,
+ new AttributedURIType(phase2RollbackAction)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a readonly request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendReadonly(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ sendOneWay(new TestMessageType(), addressingContext, soapService, initiator, initiator,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_READONLY,
+ new AttributedURIType(readonlyAction)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a volatileAndDurable request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendVolatileAndDurable(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ sendOneWay(new TestMessageType(), addressingContext, soapService, initiator, initiator,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_VOLATILE_AND_DURABLE,
+ new AttributedURIType(volatileAndDurableAction)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send an earlyReadonly request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendEarlyReadonly(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ sendOneWay(new TestMessageType(), addressingContext, soapService, initiator, initiator,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_EARLY_READONLY,
+ new AttributedURIType(earlyReadonlyAction)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a earlyAborted request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendEarlyAborted(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ sendOneWay(new TestMessageType(), addressingContext, soapService, initiator, initiator,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_EARLY_ABORTED,
+ new AttributedURIType(earlyAbortedAction)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a replayAbort request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendReplayAbort(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ sendOneWay(new TestMessageType(), addressingContext, soapService, initiator, initiator,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_REPLAY_ABORT,
+ new AttributedURIType(replayAbortAction)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a replayCommit request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendReplayCommit(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ sendOneWay(new TestMessageType(), addressingContext, soapService, initiator, initiator,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_REPLAY_COMMIT,
+ new AttributedURIType(replayCommitAction)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a retryPreparedCommit request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendRetryPreparedCommit(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ sendOneWay(new TestMessageType(), addressingContext, soapService, initiator, initiator,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_PREPARED_COMMIT,
+ new AttributedURIType(retryPreparedCommitAction)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a retryPreparedAbort request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendRetryPreparedAbort(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ sendOneWay(new TestMessageType(), addressingContext, soapService, initiator, initiator,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_PREPARED_ABORT,
+ new AttributedURIType(retryPreparedAbortAction)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a retryCommit request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendRetryCommit(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ sendOneWay(new TestMessageType(), addressingContext, soapService, initiator, initiator,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_COMMIT,
+ new AttributedURIType(retryCommitAction)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a retryReplay request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendRetryReplay(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ sendOneWay(new TestMessageType(), addressingContext, soapService, initiator, initiator,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_REPLAY,
+ new AttributedURIType(retryReplayAction)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a preparedAfterTimeout request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendPreparedAfterTimeout(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ sendOneWay(new TestMessageType(), addressingContext, soapService, initiator, initiator,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_PREPARED_AFTER_TIMEOUT,
+ new AttributedURIType(preparedAfterTimeoutAction)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a lostCommitted request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendLostCommitted(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ sendOneWay(new TestMessageType(), addressingContext, soapService, initiator, initiator,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_LOST_COMMITTED,
+ new AttributedURIType(lostCommittedAction)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Get the Interop client singleton.
+ * @return The Interop client singleton.
+ */
+ public static AsyncParticipantClient getClient()
+ {
+ return CLIENT ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/AsyncParticipantClient.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/InitiatorClient.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/InitiatorClient.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/InitiatorClient.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,93 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.client;
+
+import java.io.IOException;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapService;
+import com.arjuna.webservices.base.policy.ClientPolicy;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wsaddr.AttributedURIType;
+import com.arjuna.webservices.wsaddr.client.BaseWSAddrClient;
+import com.arjuna.webservices.wsaddr.policy.AddressingPolicy;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+
+/**
+ * The initiator client.
+ * @author kevin
+ */
+public class InitiatorClient extends BaseWSAddrClient
+{
+ /**
+ * The client singleton.
+ */
+ private static final InitiatorClient CLIENT = new InitiatorClient() ;
+
+ /**
+ * The response action.
+ */
+ private final String responseAction = ATInteropConstants.INTEROP_ACTION_RESPONSE ;
+
+ /**
+ * The SOAP service representing the client.
+ */
+ private final SoapService soapService ;
+
+ /**
+ * Construct the interop synch client.
+ */
+ private InitiatorClient()
+ {
+ final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+ // Add WS-Addressing
+ AddressingPolicy.register(handlerRegistry) ;
+ // Add client policies
+ ClientPolicy.register(handlerRegistry) ;
+
+ soapService = new SoapService(handlerRegistry) ;
+ }
+
+ /**
+ * Send a response.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendResponse(final AddressingContext addressingContext)
+ throws SoapFault, IOException
+ {
+ sendOneWay(new TestMessageType(), addressingContext, soapService, null, null,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE,
+ new AttributedURIType(responseAction)) ;
+ }
+
+ /**
+ * Send a fault.
+ * @param addressingContext The addressing context.
+ * @param soapFault The SOAP fault.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendSoapFault(final AddressingContext addressingContext, final SoapFault soapFault)
+ throws SoapFault, IOException
+ {
+ final String soapFaultAction = soapFault.getAction() ;
+ final AttributedURIType action = (soapFaultAction == null ? null : new AttributedURIType(soapFaultAction)) ;
+ if (action != null)
+ {
+ addressingContext.setAction(action) ;
+ }
+ sendSoapFault(soapFault, addressingContext, soapService, null, action) ;
+ }
+
+ /**
+ * Get the Interop client singleton.
+ * @return The Interop client singleton.
+ */
+ public static InitiatorClient getClient()
+ {
+ return CLIENT ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/InitiatorClient.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/SyncParticipantClient.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/SyncParticipantClient.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/SyncParticipantClient.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,567 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.client;
+
+import java.io.IOException;
+
+import javax.xml.namespace.QName;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.SoapMessage;
+import com.arjuna.webservices.SoapService;
+import com.arjuna.webservices.base.policy.ClientPolicy;
+import com.arjuna.webservices.soap.SoapBodyMessage;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.soap.SoapFaultMessage;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.stax.TextElement;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wsaddr.AttributedURIType;
+import com.arjuna.webservices.wsaddr.client.BaseWSAddrClient;
+import com.arjuna.webservices.wsaddr.policy.AddressingPolicy;
+import com.arjuna.webservices.wscoor.CoordinationContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.arjuna.webservices.wscoor.policy.CoordinationContextPolicy;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.policy.ATInitiatorPolicy;
+
+/**
+ * The participant client.
+ * @author kevin
+ */
+public class SyncParticipantClient extends BaseWSAddrClient
+{
+ /**
+ * The client singleton.
+ */
+ private static final SyncParticipantClient CLIENT = new SyncParticipantClient() ;
+
+ /**
+ * The completion commit action.
+ */
+ private final String completionCommitAction = ATInteropConstants.INTEROP_ACTION_COMPLETION_COMMIT ;
+ /**
+ * The completion rollback Action.
+ */
+ private final String completionRollbackAction = ATInteropConstants.INTEROP_ACTION_COMPLETION_ROLLBACK ;
+ /**
+ * The commit Action.
+ */
+ private final String commitAction = ATInteropConstants.INTEROP_ACTION_COMMIT ;
+ /**
+ * The rollback Action.
+ */
+ private final String rollbackAction = ATInteropConstants.INTEROP_ACTION_ROLLBACK ;
+ /**
+ * The phase 2 rollback Action.
+ */
+ private final String phase2RollbackAction = ATInteropConstants.INTEROP_ACTION_PHASE_2_ROLLBACK ;
+ /**
+ * The readonly Action.
+ */
+ private final String readonlyAction = ATInteropConstants.INTEROP_ACTION_READONLY ;
+ /**
+ * The volatile and durable Action.
+ */
+ private final String volatileAndDurableAction = ATInteropConstants.INTEROP_ACTION_VOLATILE_AND_DURABLE ;
+ /**
+ * The early readonly Action.
+ */
+ private final String earlyReadonlyAction = ATInteropConstants.INTEROP_ACTION_EARLY_READONLY ;
+ /**
+ * The early aborted Action.
+ */
+ private final String earlyAbortedAction = ATInteropConstants.INTEROP_ACTION_EARLY_ABORTED ;
+ /**
+ * The replay commit Action.
+ */
+ private final String replayCommitAction = ATInteropConstants.INTEROP_ACTION_REPLAY_COMMIT ;
+ /**
+ * The replay abort Action.
+ */
+ private final String replayAbortAction = ATInteropConstants.INTEROP_ACTION_REPLAY_ABORT ;
+ /**
+ * The retry prepared commit Action.
+ */
+ private final String retryPreparedCommitAction = ATInteropConstants.INTEROP_ACTION_RETRY_PREPARED_COMMIT ;
+ /**
+ * The retry prepared abort Action.
+ */
+ private final String retryPreparedAbortAction = ATInteropConstants.INTEROP_ACTION_RETRY_PREPARED_ABORT ;
+ /**
+ * The retry commit Action.
+ */
+ private final String retryCommitAction = ATInteropConstants.INTEROP_ACTION_RETRY_COMMIT ;
+ /**
+ * The retry replay Action.
+ */
+ private final String retryReplayAction = ATInteropConstants.INTEROP_ACTION_RETRY_REPLAY ;
+ /**
+ * The prepared after timeout Action.
+ */
+ private final String preparedAfterTimeoutAction = ATInteropConstants.INTEROP_ACTION_PREPARED_AFTER_TIMEOUT ;
+ /**
+ * The lost committed Action.
+ */
+ private final String lostCommittedAction = ATInteropConstants.INTEROP_ACTION_LOST_COMMITTED ;
+
+ /**
+ * The SOAP service representing the client.
+ */
+ private final SoapService soapService ;
+
+ /**
+ * Construct the interop synch client.
+ */
+ private SyncParticipantClient()
+ {
+ final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+ // Add WS-Addressing
+ AddressingPolicy.register(handlerRegistry) ;
+ // Add coordination context
+ CoordinationContextPolicy.register(handlerRegistry) ;
+ // Add the initiator policy
+ ATInitiatorPolicy.register(handlerRegistry) ;
+ // Add client policies
+ ClientPolicy.register(handlerRegistry) ;
+
+ soapService = new SoapService(handlerRegistry) ;
+ }
+
+ /**
+ * Send a completion commit request.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @param coordinatorURI The coordinator URI.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendCompletionCommit(final AddressingContext addressingContext, final SoapDetails soapDetails, final String coordinatorURI)
+ throws SoapFault, IOException
+ {
+ final TextElement completionCommit = new TextElement(coordinatorURI) ;
+ return processResponse(send(completionCommit, addressingContext, soapService, null, null,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_COMPLETION_COMMIT,
+ new AttributedURIType(completionCommitAction))) ;
+ }
+
+ /**
+ * Send a completion rollback request.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @param coordinatorURI The coordinator URI.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendCompletionRollback(final AddressingContext addressingContext, final SoapDetails soapDetails, final String coordinatorURI)
+ throws SoapFault, IOException
+ {
+ final TextElement completionRollback = new TextElement(coordinatorURI) ;
+ return processResponse(send(completionRollback, addressingContext, soapService, null, null,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_COMPLETION_ROLLBACK,
+ new AttributedURIType(completionRollbackAction))) ;
+ }
+
+ /**
+ * Send a commit request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendCommit(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(send(new TestMessageType(), addressingContext, soapService, null, null,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_COMMIT, new AttributedURIType(commitAction))) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a rollback request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendRollback(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(send(new TestMessageType(), addressingContext, soapService, null, null,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_ROLLBACK, new AttributedURIType(rollbackAction))) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a phase2Rollback request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendPhase2Rollback(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(send(new TestMessageType(), addressingContext, soapService, null, null,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_PHASE_2_ROLLBACK, new AttributedURIType(phase2RollbackAction))) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a readonly request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendReadonly(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(send(new TestMessageType(), addressingContext, soapService, null, null,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_READONLY, new AttributedURIType(readonlyAction))) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a volatileAndDurable request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendVolatileAndDurable(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(send(new TestMessageType(), addressingContext, soapService, null, null,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_VOLATILE_AND_DURABLE, new AttributedURIType(volatileAndDurableAction))) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send an earlyReadonly request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendEarlyReadonly(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(send(new TestMessageType(), addressingContext, soapService, null, null,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_EARLY_READONLY, new AttributedURIType(earlyReadonlyAction))) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a earlyAborted request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendEarlyAborted(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(send(new TestMessageType(), addressingContext, soapService, null, null,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_EARLY_ABORTED, new AttributedURIType(earlyAbortedAction))) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a replayAbort request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendReplayAbort(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(send(new TestMessageType(), addressingContext, soapService, null, null,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_REPLAY_ABORT, new AttributedURIType(replayAbortAction))) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a replayCommit request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendReplayCommit(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(send(new TestMessageType(), addressingContext, soapService, null, null,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_REPLAY_COMMIT, new AttributedURIType(replayCommitAction))) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a retryPreparedCommit request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendRetryPreparedCommit(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(send(new TestMessageType(), addressingContext, soapService, null, null,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_PREPARED_COMMIT, new AttributedURIType(retryPreparedCommitAction))) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a retryPreparedAbort request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendRetryPreparedAbort(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(send(new TestMessageType(), addressingContext, soapService, null, null,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_PREPARED_ABORT, new AttributedURIType(retryPreparedAbortAction))) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a retryCommit request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendRetryCommit(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(send(new TestMessageType(), addressingContext, soapService, null, null,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_COMMIT, new AttributedURIType(retryCommitAction))) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a retryReplay request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendRetryReplay(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(send(new TestMessageType(), addressingContext, soapService, null, null,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_REPLAY, new AttributedURIType(retryReplayAction))) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a preparedAfterTimeout request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendPreparedAfterTimeout(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(send(new TestMessageType(), addressingContext, soapService, null, null,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_PREPARED_AFTER_TIMEOUT, new AttributedURIType(preparedAfterTimeoutAction))) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a lostCommitted request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendLostCommitted(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(send(new TestMessageType(), addressingContext, soapService, null, null,
+ ATInteropConstants.INTEROP_ELEMENT_QNAME_LOST_COMMITTED, new AttributedURIType(lostCommittedAction))) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Process the response.
+ * @param soapMessage The soap message.
+ * @return The response.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ private TestMessageType processResponse(final SoapMessage soapMessage)
+ throws SoapFault, IOException
+ {
+ if (soapMessage != null)
+ {
+ if (soapMessage.isFault())
+ {
+ final SoapFaultMessage soapFaultMessage = (SoapFaultMessage)soapMessage ;
+ throw soapFaultMessage.getSoapFault() ;
+ }
+ else
+ {
+ final SoapBodyMessage soapBodyMessage = (SoapBodyMessage)soapMessage ;
+ final SoapBody soapBody = soapBodyMessage.getSoapBody() ;
+ final NamedElement responseElement = (soapBody == null ? null : soapBody.getContents()) ;
+ if (responseElement != null)
+ {
+ final QName responseName = responseElement.getName() ;
+ if (ATInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE.equals(responseName))
+ {
+ try
+ {
+ return (TestMessageType)responseElement.getElementContent() ;
+ }
+ catch (final ClassCastException cce)
+ {
+ throw new SoapFault(SoapFaultType.FAULT_RECEIVER, null, "Expected test message response type for element: " + responseName) ;
+ }
+ }
+ else
+ {
+ throw new SoapFault(SoapFaultType.FAULT_RECEIVER, null, "Unexpected response element: " + responseName) ;
+ }
+ }
+ }
+ }
+ return null ;
+ }
+
+ /**
+ * Get the Interop client singleton.
+ * @return The Interop client singleton.
+ */
+ public static SyncParticipantClient getClient()
+ {
+ return CLIENT ;
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/SyncParticipantClient.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/InitiatorResponseHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/InitiatorResponseHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/InitiatorResponseHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,42 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATInitiatorProcessor;
+
+/**
+ * The response handler.
+ * @author kevin
+ */
+public class InitiatorResponseHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+
+ ATInitiatorProcessor.getInitiator().handleResponse(message, addressingContext) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/InitiatorResponseHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/InitiatorSoapFaultHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/InitiatorSoapFaultHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/InitiatorSoapFaultHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,46 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATInitiatorProcessor;
+
+/**
+ * The SOAP fault handler.
+ * @author kevin
+ */
+public class InitiatorSoapFaultHandler implements 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
+ {
+ final SoapFault soapFault = soapDetails.parseSoapFault(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ ATInitiatorProcessor.getInitiator().handleSoapFault(soapFault, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/InitiatorSoapFaultHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCommitHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCommitHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCommitHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,51 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The commit handler.
+ * @author kevin
+ */
+public class ParticipantCommitHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ ATParticipantProcessor.getParticipant().commit(message, coordinationContext, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCommitHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCompletionCommitHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCompletionCommitHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCompletionCommitHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.TextElement;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The completion commit handler.
+ * @author kevin
+ */
+public class ParticipantCompletionCommitHandler implements 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
+ {
+ final TextElement message = new TextElement(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ ATParticipantProcessor.getParticipant().completionCommit(message, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCompletionCommitHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCompletionRollbackHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCompletionRollbackHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCompletionRollbackHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.TextElement;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The completion rollback handler.
+ * @author kevin
+ */
+public class ParticipantCompletionRollbackHandler implements 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
+ {
+ final TextElement message = new TextElement(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ ATParticipantProcessor.getParticipant().completionRollback(message, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCompletionRollbackHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantEarlyAbortedHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantEarlyAbortedHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantEarlyAbortedHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,51 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The early aborted handler.
+ * @author kevin
+ */
+public class ParticipantEarlyAbortedHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ ATParticipantProcessor.getParticipant().earlyAborted(message, coordinationContext, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantEarlyAbortedHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantEarlyReadonlyHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantEarlyReadonlyHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantEarlyReadonlyHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,51 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The early readonly handler.
+ * @author kevin
+ */
+public class ParticipantEarlyReadonlyHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ ATParticipantProcessor.getParticipant().earlyReadonly(message, coordinationContext, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantEarlyReadonlyHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantLostCommittedHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantLostCommittedHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantLostCommittedHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,51 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The lost committed handler.
+ * @author kevin
+ */
+public class ParticipantLostCommittedHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ ATParticipantProcessor.getParticipant().lostCommitted(message, coordinationContext, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantLostCommittedHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantPhase2RollbackHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantPhase2RollbackHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantPhase2RollbackHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,51 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The phase 2 rollback handler.
+ * @author kevin
+ */
+public class ParticipantPhase2RollbackHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ ATParticipantProcessor.getParticipant().phase2Rollback(message, coordinationContext, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantPhase2RollbackHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantPreparedAfterTimeoutHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantPreparedAfterTimeoutHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantPreparedAfterTimeoutHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,51 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The prepared after timeout handler.
+ * @author kevin
+ */
+public class ParticipantPreparedAfterTimeoutHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ ATParticipantProcessor.getParticipant().preparedAfterTimeout(message, coordinationContext, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantPreparedAfterTimeoutHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantReadonlyHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantReadonlyHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantReadonlyHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,51 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The readonly handler.
+ * @author kevin
+ */
+public class ParticipantReadonlyHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ ATParticipantProcessor.getParticipant().readonly(message, coordinationContext, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantReadonlyHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantReplayAbortHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantReplayAbortHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantReplayAbortHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,51 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The replay commit handler.
+ * @author kevin
+ */
+public class ParticipantReplayAbortHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ ATParticipantProcessor.getParticipant().replayAbort(message, coordinationContext, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantReplayAbortHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantReplayCommitHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantReplayCommitHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantReplayCommitHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,51 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The replay commit handler.
+ * @author kevin
+ */
+public class ParticipantReplayCommitHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ ATParticipantProcessor.getParticipant().replayCommit(message, coordinationContext, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantReplayCommitHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryCommitHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryCommitHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryCommitHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,51 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The retry commit handler.
+ * @author kevin
+ */
+public class ParticipantRetryCommitHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ ATParticipantProcessor.getParticipant().retryCommit(message, coordinationContext, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryCommitHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryPreparedAbortHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryPreparedAbortHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryPreparedAbortHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,51 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The retry prepared abort handler.
+ * @author kevin
+ */
+public class ParticipantRetryPreparedAbortHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ ATParticipantProcessor.getParticipant().retryPreparedAbort(message, coordinationContext, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryPreparedAbortHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryPreparedCommitHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryPreparedCommitHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryPreparedCommitHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,51 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The retry prepared commit handler.
+ * @author kevin
+ */
+public class ParticipantRetryPreparedCommitHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ ATParticipantProcessor.getParticipant().retryPreparedCommit(message, coordinationContext, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryPreparedCommitHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryReplayHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryReplayHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryReplayHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,51 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The retry commit handler.
+ * @author kevin
+ */
+public class ParticipantRetryReplayHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ ATParticipantProcessor.getParticipant().retryReplay(message, coordinationContext, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryReplayHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRollbackHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRollbackHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRollbackHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,51 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The rollback handler.
+ * @author kevin
+ */
+public class ParticipantRollbackHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ ATParticipantProcessor.getParticipant().rollback(message, coordinationContext, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRollbackHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantVolatileAndDurableHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantVolatileAndDurableHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantVolatileAndDurableHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,51 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The volatile and durable handler.
+ * @author kevin
+ */
+public class ParticipantVolatileAndDurableHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ ATParticipantProcessor.getParticipant().volatileAndDurable(message, coordinationContext, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantVolatileAndDurableHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitDurable2PCParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitDurable2PCParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitDurable2PCParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,22 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.participant;
+
+import com.arjuna.wst.Durable2PCParticipant;
+import com.arjuna.wst.Prepared;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.Vote;
+import com.arjuna.wst.WrongStateException;
+
+/**
+ * The commit durable 2PC participant
+ */
+public class CommitDurable2PCParticipant extends ParticipantAdapter implements Durable2PCParticipant
+{
+ /**
+ * Vote to prepare.
+ */
+ public Vote prepare()
+ throws WrongStateException, SystemException
+ {
+ return new Prepared() ;
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitDurable2PCParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitFailureDurable2PCParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitFailureDurable2PCParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitFailureDurable2PCParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,37 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.participant;
+
+import com.arjuna.wst.Durable2PCParticipant;
+import com.arjuna.wst.Prepared;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.Vote;
+import com.arjuna.wst.WrongStateException;
+
+/**
+ * The durable 2PC participant which fails the first call to commit.
+ */
+public class CommitFailureDurable2PCParticipant extends ParticipantAdapter implements Durable2PCParticipant
+{
+ /**
+ * The drop commit flag.
+ */
+ private boolean dropCommit ;
+
+ /**
+ * Vote to prepare.
+ */
+ public Vote prepare()
+ throws WrongStateException, SystemException
+ {
+ return new Prepared() ;
+ }
+
+ public void commit()
+ throws WrongStateException, SystemException
+ {
+ if (!dropCommit)
+ {
+ dropCommit = true ;
+ throw new IllegalStateException("Forced failure of commit") ;
+ }
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitFailureDurable2PCParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitFailureRecoveryDurable2PCParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitFailureRecoveryDurable2PCParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitFailureRecoveryDurable2PCParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,69 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.participant;
+
+import java.util.TimerTask;
+
+import com.arjuna.webservices.util.TransportTimer;
+import com.arjuna.wst.Durable2PCParticipant;
+import com.arjuna.wst.Prepared;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.Vote;
+import com.arjuna.wst.WrongStateException;
+import com.arjuna.wst.messaging.engines.ParticipantEngine;
+
+/**
+ * The durable 2PC participant which fails the first call to commit and recovers.
+ */
+public class CommitFailureRecoveryDurable2PCParticipant extends ParticipantAdapter implements Durable2PCParticipant
+{
+ /**
+ * The participant engine.
+ */
+ private ParticipantEngine engine ;
+ /**
+ * The set recovery flag.
+ */
+ private boolean setRecovery ;
+ /**
+ * The recovering flag.
+ */
+ private volatile boolean recovering ;
+
+ /**
+ * Set the participant engine.
+ * @param engine The participant engine.
+ */
+ public void setEngine(final ParticipantEngine engine)
+ {
+ this.engine = engine ;
+ }
+
+ /**
+ * Vote to prepare.
+ */
+ public Vote prepare()
+ throws WrongStateException, SystemException
+ {
+ return new Prepared() ;
+ }
+
+ public void commit()
+ throws WrongStateException, SystemException
+ {
+ if (!setRecovery)
+ {
+ setRecovery = true ;
+ final TimerTask timerTask = new TimerTask() {
+ public void run() {
+ recovering = true ;
+ engine.recovery() ;
+ }
+ } ;
+ TransportTimer.getTimer().schedule(timerTask, 2000) ;
+ }
+
+ if (!recovering)
+ {
+ throw new IllegalStateException("Forced failure of commit") ;
+ }
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitFailureRecoveryDurable2PCParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitVolatile2PCParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitVolatile2PCParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitVolatile2PCParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,22 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.participant;
+
+import com.arjuna.wst.Prepared;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.Volatile2PCParticipant;
+import com.arjuna.wst.Vote;
+import com.arjuna.wst.WrongStateException;
+
+/**
+ * The commit volatile 2PC participant
+ */
+public class CommitVolatile2PCParticipant extends ParticipantAdapter implements Volatile2PCParticipant
+{
+ /**
+ * Vote to prepare.
+ */
+ public Vote prepare()
+ throws WrongStateException, SystemException
+ {
+ return new Prepared() ;
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitVolatile2PCParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/ParticipantAdapter.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/ParticipantAdapter.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/ParticipantAdapter.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,44 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.participant;
+
+import com.arjuna.wst.Participant;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.WrongStateException;
+
+/**
+ * The base participant adapter.
+ */
+public abstract class ParticipantAdapter implements Participant
+{
+ /**
+ * Commit the participant.
+ */
+ public void commit()
+ throws WrongStateException, SystemException
+ {
+ }
+
+ /**
+ * Rollback the participant.
+ */
+ public void rollback()
+ throws WrongStateException, SystemException
+ {
+ }
+
+ /**
+ * Handle an error on the participant.
+ */
+ public void error()
+ throws SystemException
+ {
+ }
+
+ /**
+ * Handle an unknown on the participant.
+ */
+ public void unknown()
+ throws SystemException
+ {
+ }
+
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/ParticipantAdapter.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/ReadonlyDurable2PCParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/ReadonlyDurable2PCParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/ReadonlyDurable2PCParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,22 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.participant;
+
+import com.arjuna.wst.Durable2PCParticipant;
+import com.arjuna.wst.ReadOnly;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.Vote;
+import com.arjuna.wst.WrongStateException;
+
+/**
+ * The readonly durable 2PC participant
+ */
+public class ReadonlyDurable2PCParticipant extends ParticipantAdapter implements Durable2PCParticipant
+{
+ /**
+ * Vote readonly.
+ */
+ public Vote prepare()
+ throws WrongStateException, SystemException
+ {
+ return new ReadOnly() ;
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/ReadonlyDurable2PCParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/ReplayAbortDurable2PCParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/ReplayAbortDurable2PCParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/ReplayAbortDurable2PCParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,53 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.participant;
+
+import java.util.TimerTask;
+
+import com.arjuna.webservices.util.TransportTimer;
+import com.arjuna.wst.Durable2PCParticipant;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.Vote;
+import com.arjuna.wst.WrongStateException;
+import com.arjuna.wst.messaging.engines.ParticipantEngine;
+
+/**
+ * The durable 2PC participant which replays after failure to prepare.
+ */
+public class ReplayAbortDurable2PCParticipant extends ParticipantAdapter implements Durable2PCParticipant
+{
+ /**
+ * The participant engine.
+ */
+ private ParticipantEngine engine ;
+ /**
+ * The prepared flag.
+ */
+ private volatile boolean prepared ;
+
+ /**
+ * Set the participant engine.
+ * @param engine The participant engine.
+ */
+ public void setEngine(final ParticipantEngine engine)
+ {
+ this.engine = engine ;
+ }
+
+ /**
+ * Vote to prepare.
+ */
+ public Vote prepare()
+ throws WrongStateException, SystemException
+ {
+ if (!prepared)
+ {
+ prepared = true ;
+ final TimerTask timerTask = new TimerTask() {
+ public void run() {
+ engine.recovery() ;
+ }
+ } ;
+ TransportTimer.getTimer().schedule(timerTask, 2000) ;
+ }
+ throw new SystemException("Forced failure of prepare") ;
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/ReplayAbortDurable2PCParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/RetryReplayDurable2PCParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/RetryReplayDurable2PCParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/RetryReplayDurable2PCParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,95 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.participant;
+
+import java.util.TimerTask;
+
+import com.arjuna.webservices.util.TransportTimer;
+import com.arjuna.wst.Durable2PCParticipant;
+import com.arjuna.wst.Prepared;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.Vote;
+import com.arjuna.wst.WrongStateException;
+import com.arjuna.wst.messaging.engines.ParticipantEngine;
+
+/**
+ * The durable 2PC participant which retries a replay.
+ */
+public class RetryReplayDurable2PCParticipant extends ParticipantAdapter implements Durable2PCParticipant
+{
+ /**
+ * The participant engine.
+ */
+ private ParticipantEngine engine ;
+ /**
+ * The preparing flag.
+ */
+ private boolean preparing ;
+ /**
+ * The rollback flag.
+ */
+ private transient boolean rollback ;
+ /**
+ * The timer task.
+ */
+ private TimerTask timerTask ;
+
+ /**
+ * Set the participant engine.
+ * @param engine The participant engine.
+ */
+ public void setEngine(final ParticipantEngine engine)
+ {
+ this.engine = engine ;
+ }
+
+ /**
+ * Vote to prepare.
+ */
+ public Vote prepare()
+ throws WrongStateException, SystemException
+ {
+ if (!preparing)
+ {
+ preparing = true ;
+
+ initTimeout() ;
+ }
+ return new Prepared() ;
+ }
+
+ public void rollback()
+ throws WrongStateException, SystemException
+ {
+ if (!rollback)
+ {
+ rollback = true ;
+ cancelTimer() ;
+ }
+ }
+
+ private void timeout()
+ {
+ engine.recovery() ;
+ if (!rollback)
+ {
+ initTimeout() ;
+ }
+ }
+
+ private synchronized void initTimeout()
+ {
+ timerTask = new TimerTask() {
+ public void run() {
+ timeout() ;
+ }
+ } ;
+ TransportTimer.getTimer().schedule(timerTask, 2000) ;
+ }
+
+ private synchronized void cancelTimer()
+ {
+ if (timerTask != null)
+ {
+ timerTask.cancel() ;
+ }
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/RetryReplayDurable2PCParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/RollbackDurable2PCParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/RollbackDurable2PCParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/RollbackDurable2PCParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,22 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.participant;
+
+import com.arjuna.wst.Aborted;
+import com.arjuna.wst.Durable2PCParticipant;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.Vote;
+import com.arjuna.wst.WrongStateException;
+
+/**
+ * The rollback durable 2PC participant
+ */
+public class RollbackDurable2PCParticipant extends ParticipantAdapter implements Durable2PCParticipant
+{
+ /**
+ * Vote to abort.
+ */
+ public Vote prepare()
+ throws WrongStateException, SystemException
+ {
+ return new Aborted() ;
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/RollbackDurable2PCParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/VolatileAndDurableDurable2PCParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/VolatileAndDurableDurable2PCParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/VolatileAndDurableDurable2PCParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,22 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.participant;
+
+import com.arjuna.wst.Durable2PCParticipant;
+import com.arjuna.wst.Prepared;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.Vote;
+import com.arjuna.wst.WrongStateException;
+
+/**
+ * The VolatileAndDurable durable 2PC participant
+ */
+public class VolatileAndDurableDurable2PCParticipant extends ParticipantAdapter implements Durable2PCParticipant
+{
+ /**
+ * Vote to prepare.
+ */
+ public Vote prepare()
+ throws WrongStateException, SystemException
+ {
+ return new Prepared() ;
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/VolatileAndDurableDurable2PCParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/VolatileAndDurableVolatile2PCParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/VolatileAndDurableVolatile2PCParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/VolatileAndDurableVolatile2PCParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,47 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.participant;
+
+import com.arjuna.ats.arjuna.common.Uid;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.arjuna.wst.ReadOnly;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.Volatile2PCParticipant;
+import com.arjuna.wst.Vote;
+import com.arjuna.wst.WrongStateException;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropUtil;
+
+/**
+ * The VolatileAndDurable volatile 2PC participant
+ */
+public class VolatileAndDurableVolatile2PCParticipant extends ParticipantAdapter implements Volatile2PCParticipant
+{
+ /**
+ * The current coordination context.
+ */
+ private final CoordinationContextType coordinationContext ;
+
+ /**
+ * Construct the participant.
+ * @param coordinationContext The coordination context.
+ */
+ public VolatileAndDurableVolatile2PCParticipant(final CoordinationContextType coordinationContext)
+ {
+ this.coordinationContext = coordinationContext ;
+ }
+
+ /**
+ * Vote to prepare.
+ */
+ public Vote prepare()
+ throws WrongStateException, SystemException
+ {
+ try
+ {
+ ATInteropUtil.registerDurable2PC(coordinationContext, new VolatileAndDurableDurable2PCParticipant(), new Uid().toString()) ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SystemException(th.getMessage()) ;
+ }
+ return new ReadOnly() ;
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/VolatileAndDurableVolatile2PCParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/policy/ATInitiatorPolicy.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/policy/ATInitiatorPolicy.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/policy/ATInitiatorPolicy.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,34 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.policy;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.InitiatorResponseHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.InitiatorSoapFaultHandler;
+
+/**
+ * Policy responsible for binding in the WS-TX AT Interop participant server handlers.
+ * @author kevin
+ */
+public class ATInitiatorPolicy
+{
+ /**
+ * Add this policy to the registry.
+ * @param registry The registry containing the policy.
+ */
+ public static void register(final HandlerRegistry registry)
+ {
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, new InitiatorResponseHandler()) ;
+
+ registry.registerFaultHandler(new InitiatorSoapFaultHandler()) ;
+ }
+
+ /**
+ * Remove this policy from the registry.
+ * @param registry The registry containing the policy.
+ */
+ public static void remove(final HandlerRegistry registry)
+ {
+ registry.registerFaultHandler(null) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/policy/ATInitiatorPolicy.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/policy/ATParticipantPolicy.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/policy/ATParticipantPolicy.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/policy/ATParticipantPolicy.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,81 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.policy;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.arjuna.webservices.base.handlers.LoggingFaultHandler;
+import com.jboss.transaction.txinterop.webservices.InteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantCommitHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantCompletionCommitHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantCompletionRollbackHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantEarlyAbortedHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantEarlyReadonlyHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantLostCommittedHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantPhase2RollbackHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantPreparedAfterTimeoutHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantReadonlyHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantReplayAbortHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantReplayCommitHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantRetryCommitHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantRetryPreparedAbortHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantRetryPreparedCommitHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantRetryReplayHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantRollbackHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantVolatileAndDurableHandler;
+
+/**
+ * Policy responsible for binding in the WS-TX AT Interop participant server handlers.
+ * @author kevin
+ */
+public class ATParticipantPolicy
+{
+ /**
+ * Add this policy to the registry.
+ * @param registry The registry containing the policy.
+ */
+ public static void register(final HandlerRegistry registry)
+ {
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_COMPLETION_COMMIT, new ParticipantCompletionCommitHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_COMPLETION_ROLLBACK, new ParticipantCompletionRollbackHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_COMMIT, new ParticipantCommitHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_ROLLBACK, new ParticipantRollbackHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_PHASE_2_ROLLBACK, new ParticipantPhase2RollbackHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_READONLY, new ParticipantReadonlyHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_VOLATILE_AND_DURABLE, new ParticipantVolatileAndDurableHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_EARLY_READONLY, new ParticipantEarlyReadonlyHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_EARLY_ABORTED, new ParticipantEarlyAbortedHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_REPLAY_ABORT, new ParticipantReplayAbortHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_REPLAY_COMMIT, new ParticipantReplayCommitHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_PREPARED_COMMIT, new ParticipantRetryPreparedCommitHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_PREPARED_ABORT, new ParticipantRetryPreparedAbortHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_COMMIT, new ParticipantRetryCommitHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_REPLAY, new ParticipantRetryReplayHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_PREPARED_AFTER_TIMEOUT, new ParticipantPreparedAfterTimeoutHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_LOST_COMMITTED, new ParticipantLostCommittedHandler()) ;
+
+ registry.registerFaultHandler(new LoggingFaultHandler(InteropConstants.SERVICE_PARTICIPANT)) ;
+ }
+
+ /**
+ * Remove this policy from the registry.
+ * @param registry The registry containing the policy.
+ */
+ public static void remove(final HandlerRegistry registry)
+ {
+ registry.registerFaultHandler(null) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_LOST_COMMITTED) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_PREPARED_AFTER_TIMEOUT) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_COMMIT) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_PREPARED_ABORT) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_PREPARED_COMMIT) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_REPLAY_COMMIT) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_EARLY_ABORTED) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_EARLY_READONLY) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_VOLATILE_AND_DURABLE) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_READONLY) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_PHASE_2_ROLLBACK) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_ROLLBACK) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_COMMIT) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_COMPLETION_ROLLBACK) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_COMPLETION_COMMIT) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/policy/ATParticipantPolicy.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATInitiatorCallback.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATInitiatorCallback.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATInitiatorCallback.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+/*
+ * 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.jboss.transaction.txinterop.webservices.atinterop.processors;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.base.processors.Callback;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+
+/**
+ * The callback for the initiator client.
+ * @author kevin
+ */
+public abstract class ATInitiatorCallback extends Callback
+{
+ /**
+ * A response.
+ * @param response The response.
+ * @param addressingContext The current addressing context.
+ */
+ public abstract void response(final TestMessageType response,
+ final AddressingContext addressingContext) ;
+
+ /**
+ * A SOAP fault response.
+ * @param soapFault The SOAP fault response.
+ * @param addressingContext The current addressing context.
+ */
+ public abstract void soapFault(final SoapFault soapFault, final AddressingContext addressingContext) ;
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATInitiatorCallback.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATInitiatorProcessor.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATInitiatorProcessor.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATInitiatorProcessor.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,86 @@
+/*
+ * 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.jboss.transaction.txinterop.webservices.atinterop.processors;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.base.processors.Callback;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wsaddr.processor.BaseWSAddrResponseProcessor;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+
+/**
+ * The Initiator processor.
+ * @author kevin
+ */
+public class ATInitiatorProcessor extends BaseWSAddrResponseProcessor
+{
+ /**
+ * The initiator singleton.
+ */
+ private static final ATInitiatorProcessor INITIATOR = new ATInitiatorProcessor() ;
+
+ /**
+ * Get the initiator singleton.
+ * @return The singleton.
+ */
+ public static ATInitiatorProcessor getInitiator()
+ {
+ return INITIATOR ;
+ }
+
+ /**
+ * Handle a response response.
+ * @param response The response.
+ * @param addressingContext The current addressing context.
+ */
+ public void handleResponse(final TestMessageType response, final AddressingContext addressingContext)
+ {
+ handleCallbacks(new CallbackExecutorAdapter() {
+ public void execute(final Callback callback) {
+ ((ATInitiatorCallback)callback).response(response, addressingContext) ;
+ }
+ }, getIDs(addressingContext)) ;
+ }
+
+ /**
+ * Register a SOAP fault response.
+ * @param soapFault The SOAP fault response.
+ * @param addressingContext The current addressing context.
+ */
+ public void handleSoapFault(final SoapFault soapFault, final AddressingContext addressingContext)
+ {
+ handleCallbacks(new CallbackExecutorAdapter() {
+ public void execute(final Callback callback) {
+ ((ATInitiatorCallback)callback).soapFault(soapFault, addressingContext) ;
+ }
+ }, getIDs(addressingContext)) ;
+ }
+
+ /**
+ * Register a callback for the specific message id.
+ * @param messageID The message ID.
+ * @param callback The callback for the response.
+ */
+ public void registerCallback(final String messageID, final ATInitiatorCallback callback)
+ {
+ register(messageID, callback) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATInitiatorProcessor.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATParticipantProcessor.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATParticipantProcessor.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATParticipantProcessor.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,424 @@
+/*
+ * 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.jboss.transaction.txinterop.webservices.atinterop.processors;
+
+import com.arjuna.ats.arjuna.common.Uid;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.stax.TextElement;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.arjuna.wsc.messaging.MessageId;
+import com.arjuna.wst.CompletionCoordinatorParticipant;
+import com.arjuna.wst.messaging.engines.ParticipantEngine;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropUtil;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.client.InitiatorClient;
+import com.jboss.transaction.txinterop.webservices.atinterop.participant.CommitDurable2PCParticipant;
+import com.jboss.transaction.txinterop.webservices.atinterop.participant.CommitFailureDurable2PCParticipant;
+import com.jboss.transaction.txinterop.webservices.atinterop.participant.CommitFailureRecoveryDurable2PCParticipant;
+import com.jboss.transaction.txinterop.webservices.atinterop.participant.CommitVolatile2PCParticipant;
+import com.jboss.transaction.txinterop.webservices.atinterop.participant.ReadonlyDurable2PCParticipant;
+import com.jboss.transaction.txinterop.webservices.atinterop.participant.ReplayAbortDurable2PCParticipant;
+import com.jboss.transaction.txinterop.webservices.atinterop.participant.RetryReplayDurable2PCParticipant;
+import com.jboss.transaction.txinterop.webservices.atinterop.participant.RollbackDurable2PCParticipant;
+import com.jboss.transaction.txinterop.webservices.atinterop.participant.VolatileAndDurableVolatile2PCParticipant;
+
+/**
+ * The Participant processor.
+ * @author kevin
+ */
+public class ATParticipantProcessor
+{
+ /**
+ * The participant.
+ */
+ private static ATParticipantProcessor PARTICIPANT = new ATParticipantProcessor() ;
+
+ /**
+ * Get the participant.
+ * @return The participant.
+ */
+ public static ATParticipantProcessor getParticipant()
+ {
+ return PARTICIPANT ;
+ }
+
+ /**
+ * Execute the CompletionCommit
+ * @param completionCommit The completion commit request.
+ * @param addressingContext The current addressing context.
+ */
+ public void completionCommit(final TextElement completionCommit, final AddressingContext addressingContext)
+ {
+ final String coordinatorURI = completionCommit.getText() ;
+ try
+ {
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(coordinatorURI) ;
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+ }
+ catch (final Throwable th)
+ {
+ sendFault(addressingContext, new SoapFault(th)) ;
+ }
+ sendResponse(addressingContext) ;
+ }
+
+ /**
+ * Execute the CompletionRollback
+ * @param completionRollback The completion rollback request.
+ * @param addressingContext The current addressing context.
+ */
+ public void completionRollback(final TextElement completionRollback, final AddressingContext addressingContext)
+ {
+ final String coordinatorURI = completionRollback.getText() ;
+ try
+ {
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(coordinatorURI) ;
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.rollback() ;
+ }
+ catch (final Throwable th)
+ {
+ sendFault(addressingContext, new SoapFault(th)) ;
+ }
+ sendResponse(addressingContext) ;
+ }
+
+ /**
+ * Execute the Commit
+ * @param commit The commit request.
+ * @param addressingContext The current addressing context.
+ */
+ public void commit(final TestMessageType commit, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ {
+ try
+ {
+ ATInteropUtil.registerDurable2PC(coordinationContext, new CommitDurable2PCParticipant(), new Uid().toString()) ;
+ }
+ catch (final Throwable th)
+ {
+ sendFault(addressingContext, new SoapFault(th)) ;
+ }
+ sendResponse(addressingContext) ;
+ }
+
+ /**
+ * Execute the Rollback
+ * @param rollback The rollback request.
+ * @param addressingContext The current addressing context.
+ */
+ public void rollback(final TestMessageType rollback, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ {
+ try
+ {
+ ATInteropUtil.registerDurable2PC(coordinationContext, new RollbackDurable2PCParticipant(), new Uid().toString()) ;
+ }
+ catch (final Throwable th)
+ {
+ sendFault(addressingContext, new SoapFault(th)) ;
+ }
+ sendResponse(addressingContext) ;
+ }
+
+ /**
+ * Execute the Phase2Rollback
+ * @param phase2Rollback The phase 2 rollback request.
+ * @param addressingContext The current addressing context.
+ */
+ public void phase2Rollback(final TestMessageType phase2Rollback, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ {
+ try
+ {
+ ATInteropUtil.registerVolatile2PC(coordinationContext, new CommitVolatile2PCParticipant(), new Uid().toString()) ;
+ ATInteropUtil.registerDurable2PC(coordinationContext, new RollbackDurable2PCParticipant(), new Uid().toString()) ;
+ }
+ catch (final Throwable th)
+ {
+ sendFault(addressingContext, new SoapFault(th)) ;
+ }
+ sendResponse(addressingContext) ;
+ }
+
+ /**
+ * Execute the Readonly
+ * @param readonly The readonly request.
+ * @param addressingContext The current addressing context.
+ */
+ public void readonly(final TestMessageType readonly, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ {
+ try
+ {
+ ATInteropUtil.registerDurable2PC(coordinationContext, new ReadonlyDurable2PCParticipant(), new Uid().toString()) ;
+ ATInteropUtil.registerDurable2PC(coordinationContext, new CommitDurable2PCParticipant(), new Uid().toString()) ;
+ }
+ catch (final Throwable th)
+ {
+ sendFault(addressingContext, new SoapFault(th)) ;
+ }
+ sendResponse(addressingContext) ;
+ }
+
+ /**
+ * Execute the VolatileAndDurable
+ * @param volatileAndDurable The volatile and durable request.
+ * @param addressingContext The current addressing context.
+ */
+ public void volatileAndDurable(final TestMessageType volatileAndDurable, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ {
+ try
+ {
+ ATInteropUtil.registerVolatile2PC(coordinationContext, new VolatileAndDurableVolatile2PCParticipant(coordinationContext), new Uid().toString()) ;
+ }
+ catch (final Throwable th)
+ {
+ sendFault(addressingContext, new SoapFault(th)) ;
+ }
+ sendResponse(addressingContext) ;
+ }
+
+ /**
+ * Execute the EarlyReadonly
+ * @param earlyReadonly The early readonly request.
+ * @param addressingContext The current addressing context.
+ */
+ public void earlyReadonly(final TestMessageType earlyReadonly, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ {
+ try
+ {
+ final ParticipantEngine engine = ATInteropUtil.registerVolatile2PC(coordinationContext, new CommitVolatile2PCParticipant(), new Uid().toString()) ;
+ ATInteropUtil.registerDurable2PC(coordinationContext, new CommitDurable2PCParticipant(), new Uid().toString()) ;
+ engine.earlyReadonly() ;
+ }
+ catch (final Throwable th)
+ {
+ sendFault(addressingContext, new SoapFault(th)) ;
+ }
+ sendResponse(addressingContext) ;
+ }
+
+ /**
+ * Execute the EarlyAborted
+ * @param earlyAborted The early aborted request.
+ * @param addressingContext The current addressing context.
+ */
+ public void earlyAborted(final TestMessageType earlyAborted, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ {
+ try
+ {
+ final ParticipantEngine engine = ATInteropUtil.registerVolatile2PC(coordinationContext, new CommitVolatile2PCParticipant(), new Uid().toString()) ;
+ ATInteropUtil.registerDurable2PC(coordinationContext, new CommitDurable2PCParticipant(), new Uid().toString()) ;
+ engine.earlyRollback() ;
+ }
+ catch (final Throwable th)
+ {
+ sendFault(addressingContext, new SoapFault(th)) ;
+ }
+ sendResponse(addressingContext) ;
+ }
+
+ /**
+ * Execute the ReplayAbort
+ * @param replayAbort The replay abort request.
+ * @param addressingContext The current addressing context.
+ */
+ public void replayAbort(final TestMessageType replayAbort, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ {
+ try
+ {
+ final ReplayAbortDurable2PCParticipant participant = new ReplayAbortDurable2PCParticipant() ;
+ final ParticipantEngine engine = ATInteropUtil.registerDurable2PC(coordinationContext, participant, new Uid().toString()) ;
+ participant.setEngine(engine) ;
+ }
+ catch (final Throwable th)
+ {
+ sendFault(addressingContext, new SoapFault(th)) ;
+ }
+ sendResponse(addressingContext) ;
+ }
+
+ /**
+ * Execute the ReplayCommit
+ * @param replayCommit The replay commit request.
+ * @param addressingContext The current addressing context.
+ */
+ public void replayCommit(final TestMessageType replayCommit, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ {
+ try
+ {
+ final CommitFailureRecoveryDurable2PCParticipant participant = new CommitFailureRecoveryDurable2PCParticipant() ;
+ final ParticipantEngine engine = ATInteropUtil.registerDurable2PC(coordinationContext, participant, new Uid().toString()) ;
+ participant.setEngine(engine) ;
+ }
+ catch (final Throwable th)
+ {
+ sendFault(addressingContext, new SoapFault(th)) ;
+ }
+ sendResponse(addressingContext) ;
+ }
+
+ /**
+ * Execute the RetryPreparedCommit
+ * @param retryPreparedCommit The retry prepared commit request.
+ * @param addressingContext The current addressing context.
+ */
+ public void retryPreparedCommit(final TestMessageType retryPreparedCommit, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ {
+ try
+ {
+ ATInteropUtil.registerDurable2PC(coordinationContext, new CommitDurable2PCParticipant(), new Uid().toString()) ;
+ }
+ catch (final Throwable th)
+ {
+ sendFault(addressingContext, new SoapFault(th)) ;
+ }
+ sendResponse(addressingContext) ;
+ }
+
+ /**
+ * Execute the RetryPreparedAbort
+ * @param retryPreparedAbort The retry prepared abort request.
+ * @param addressingContext The current addressing context.
+ */
+ public void retryPreparedAbort(final TestMessageType retryPreparedAbort, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ {
+ try
+ {
+ ATInteropUtil.registerDurable2PC(coordinationContext, new CommitDurable2PCParticipant(), new Uid().toString()) ;
+ }
+ catch (final Throwable th)
+ {
+ sendFault(addressingContext, new SoapFault(th)) ;
+ }
+ sendResponse(addressingContext) ;
+ }
+
+ /**
+ * Execute the RetryCommit
+ * @param retryCommit The retry commit request.
+ * @param addressingContext The current addressing context.
+ */
+ public void retryCommit(final TestMessageType retryCommit, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ {
+ try
+ {
+ ATInteropUtil.registerDurable2PC(coordinationContext, new CommitFailureDurable2PCParticipant(), new Uid().toString()) ;
+ }
+ catch (final Throwable th)
+ {
+ sendFault(addressingContext, new SoapFault(th)) ;
+ }
+ sendResponse(addressingContext) ;
+ }
+
+ /**
+ * Execute the RetryReplay
+ * @param retryReplay The retry replay request.
+ * @param addressingContext The current addressing context.
+ */
+ public void retryReplay(final TestMessageType retryReplay, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ {
+ try
+ {
+ final RetryReplayDurable2PCParticipant participant = new RetryReplayDurable2PCParticipant() ;
+ final ParticipantEngine engine = ATInteropUtil.registerDurable2PC(coordinationContext, participant, new Uid().toString()) ;
+ participant.setEngine(engine) ;
+ }
+ catch (final Throwable th)
+ {
+ sendFault(addressingContext, new SoapFault(th)) ;
+ }
+ sendResponse(addressingContext) ;
+ }
+
+ /**
+ * Execute the PreparedAfterTimeout
+ * @param preparedAfterTimeout The prepared after timeout request.
+ * @param addressingContext The current addressing context.
+ */
+ public void preparedAfterTimeout(final TestMessageType preparedAfterTimeout, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ {
+ try
+ {
+ ATInteropUtil.registerVolatile2PC(coordinationContext, new CommitVolatile2PCParticipant(), new Uid().toString()) ;
+ ATInteropUtil.registerDurable2PC(coordinationContext, new CommitDurable2PCParticipant(), new Uid().toString()) ;
+ }
+ catch (final Throwable th)
+ {
+ sendFault(addressingContext, new SoapFault(th)) ;
+ }
+ sendResponse(addressingContext) ;
+ }
+
+ /**
+ * Execute the LostCommitted
+ * @param lostCommitted The lost committed request.
+ * @param addressingContext The current addressing context.
+ */
+ public void lostCommitted(final TestMessageType lostCommitted, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ {
+ try
+ {
+ ATInteropUtil.registerDurable2PC(coordinationContext, new CommitFailureDurable2PCParticipant(), new Uid().toString()) ;
+ }
+ catch (final Throwable th)
+ {
+ sendFault(addressingContext, new SoapFault(th)) ;
+ }
+ sendResponse(addressingContext) ;
+ }
+
+ /**
+ * Send a response.
+ * @param addressingContext The addressing context.
+ */
+ private void sendResponse(final AddressingContext addressingContext)
+ {
+ final AddressingContext responseAddressingContext = AddressingContext.createResponseContext(addressingContext, MessageId.getMessageId()) ;
+
+ try
+ {
+ InitiatorClient.getClient().sendResponse(responseAddressingContext) ;
+ }
+ catch (Throwable throwable)
+ {
+ throwable.printStackTrace(System.err);
+ }
+ }
+
+ /**
+ * Send a SOAP fault response.
+ * @param addressingContext The addressing context.
+ * @param fault The SOAP fault.
+ */
+ private void sendFault(final AddressingContext addressingContext, final SoapFault fault)
+ {
+ final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, MessageId.getMessageId()) ;
+ try
+ {
+ InitiatorClient.getClient().sendSoapFault(faultAddressingContext, fault) ;
+ }
+ catch (Throwable throwable)
+ {
+ throwable.printStackTrace(System.err);
+ }
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATParticipantProcessor.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/server/ATInitiatorInitialisation.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/server/ATInitiatorInitialisation.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/server/ATInitiatorInitialisation.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,44 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.server;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.SoapService;
+import com.arjuna.webservices.wsaddr.policy.AddressingPolicy;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.policy.ATInitiatorPolicy;
+
+/**
+ * Initialise the interop initiator service.
+ * @author kevin
+ */
+public class ATInitiatorInitialisation implements ServletContextListener
+{
+ /**
+ * The context has been initialized.
+ * @param servletContextEvent The servlet context event.
+ */
+ public void contextInitialized(final ServletContextEvent servletContextEvent)
+ {
+ final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+ // Add WS-Addressing
+ AddressingPolicy.register(handlerRegistry) ;
+ // Add endpoint
+ ATInitiatorPolicy.register(handlerRegistry) ;
+
+ final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+ soapRegistry.registerSoapService(ATInteropConstants.SERVICE_INITIATOR,
+ new SoapService(handlerRegistry)) ;
+ }
+
+ /**
+ * The context is about to be destroyed.
+ * @param servletContextEvent The servlet context event.
+ */
+ public void contextDestroyed(final ServletContextEvent servletContextEvent)
+ {
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/server/ATInitiatorInitialisation.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/AsyncParticipantStub.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/AsyncParticipantStub.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/AsyncParticipantStub.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,289 @@
+package com.jboss.transaction.txinterop.webservices.bainterop;
+
+import java.io.IOException;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.soap.Soap11Details;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.arjuna.wsc.messaging.MessageId;
+import com.jboss.transaction.txinterop.webservices.bainterop.client.AsyncParticipantClient;
+import com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorCallback;
+import com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor;
+
+/**
+ * The participant stub.
+ */
+public class AsyncParticipantStub implements ParticipantStub
+{
+ /**
+ * The SOAP 1.1 details.
+ */
+ private static final SoapDetails SOAP_DETAILS = new Soap11Details() ;
+
+ /***
+ * The participant stub singletong.
+ */
+ private static final ParticipantStub PARTICIPANT_STUB = new AsyncParticipantStub() ;
+
+ /**
+ * Get the participant stub singleton.
+ * @return The participant stub singleton.
+ */
+ public static ParticipantStub getParticipantStub()
+ {
+ return PARTICIPANT_STUB ;
+ }
+
+ /**
+ * Send a participantClosed request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void participantClosed(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendParticipantClosed(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a participantCompensated request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void participantCompensated(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendParticipantCompensated(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a participantCanceled request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void participantCanceled(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendParticipantCanceled(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a participantExit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void participantExit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendParticipantExit(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a participantFault request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void participantFault(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendParticipantFault(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a participantCompensationFault request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void participantCompensationFault(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendParticipantCompensationFault(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Handle the callback.
+ * @param callback The callback.
+ * @throws SoapFault for errors.
+ */
+ private static void handleCallback(final RequestCallback callback)
+ throws SoapFault
+ {
+ if (callback.hasFailed())
+ {
+ throw new SoapFault(SoapFaultType.FAULT_RECEIVER, null, "Callback execution failed") ;
+ }
+ else if (!callback.hasTriggered())
+ {
+ throw new SoapFault(SoapFaultType.FAULT_RECEIVER, null, "Callback wasn't triggered") ;
+ }
+ else if (!callback.isResponse())
+ {
+ throw callback.getSoapFault() ;
+ }
+ }
+
+ /**
+ * The request callback class.
+ */
+ private static final class RequestCallback extends BAInitiatorCallback
+ {
+ /**
+ * The response flag.
+ */
+ private boolean response ;
+ /**
+ * The SOAP fault response.
+ */
+ private SoapFault soapFault ;
+
+ /**
+ * A response.
+ * @param response The response.
+ * @param addressingContext The current addressing context.
+ */
+ public void response(final TestMessageType response,
+ final AddressingContext addressingContext)
+ {
+ this.response = true ;
+ }
+
+ /**
+ * 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 ;
+ }
+
+ /**
+ * Was a response received?
+ * @return true if a response was received, false otherwise.
+ */
+ boolean isResponse()
+ {
+ return response ;
+ }
+
+ /**
+ * Get the SOAP fault.
+ * @return The SOAP fault or null.
+ */
+ SoapFault getSoapFault()
+ {
+ return soapFault ;
+ }
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/AsyncParticipantStub.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/BAInteropConstants.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/BAInteropConstants.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/BAInteropConstants.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,123 @@
+package com.jboss.transaction.txinterop.webservices.bainterop;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Interface containing WS-TX BA Interop constants.
+ */
+public interface BAInteropConstants
+{
+ /**
+ * The interop test initiator service name.
+ */
+ public String SERVICE_INITIATOR = "TX10BAInitiator" ;
+
+ /**
+ * The interop Namespace.
+ */
+ public String INTEROP_NAMESPACE = "http://fabrikam123.com/wsba" ;
+ /**
+ * The interop namespace prefix.
+ */
+ public String INTEROP_PREFIX = "bainterop" ;
+
+ /**
+ * The participant action prefix.
+ */
+ public String INTEROP_ACTION_PARTICIPANT_PREFIX = INTEROP_NAMESPACE + "/ParticipantPortType/" ;
+ /**
+ * The initiator action prefix.
+ */
+ public String INTEROP_ACTION_INITIATOR_PREFIX = INTEROP_NAMESPACE + "/InitiatorPortType/" ;
+
+ /**
+ * The ParticipantClosed element.
+ */
+ public String INTEROP_ELEMENT_PARTICIPANT_CLOSED = "ParticipantClosed" ;
+ /**
+ * The ParticipantClosed QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_PARTICIPANT_CLOSED = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_PARTICIPANT_CLOSED, INTEROP_PREFIX) ;
+ /**
+ * The ParticipantClosed Action.
+ */
+ public String INTEROP_ACTION_PARTICIPANT_CLOSED = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_PARTICIPANT_CLOSED ;
+
+ /**
+ * The ParticipantCompensated element.
+ */
+ public String INTEROP_ELEMENT_PARTICIPANT_COMPENSATED = "ParticipantCompensated" ;
+ /**
+ * The ParticipantCompensated QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_PARTICIPANT_COMPENSATED = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_PARTICIPANT_COMPENSATED, INTEROP_PREFIX) ;
+ /**
+ * The ParticipantCompensated Action.
+ */
+ public String INTEROP_ACTION_PARTICIPANT_COMPENSATED = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_PARTICIPANT_COMPENSATED ;
+
+ /**
+ * The ParticipantCanceled element.
+ */
+ public String INTEROP_ELEMENT_PARTICIPANT_CANCELED = "ParticipantCanceled" ;
+ /**
+ * The ParticipantCanceled QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_PARTICIPANT_CANCELED = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_PARTICIPANT_CANCELED, INTEROP_PREFIX) ;
+ /**
+ * The ParticipantCanceled Action.
+ */
+ public String INTEROP_ACTION_PARTICIPANT_CANCELED = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_PARTICIPANT_CANCELED ;
+
+ /**
+ * The ParticipantExit element.
+ */
+ public String INTEROP_ELEMENT_PARTICIPANT_EXIT = "ParticipantExit" ;
+ /**
+ * The ParticipantExit QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_PARTICIPANT_EXIT = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_PARTICIPANT_EXIT, INTEROP_PREFIX) ;
+ /**
+ * The ParticipantExit Action.
+ */
+ public String INTEROP_ACTION_PARTICIPANT_EXIT = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_PARTICIPANT_EXIT ;
+
+ /**
+ * The ParticipantFault element.
+ */
+ public String INTEROP_ELEMENT_PARTICIPANT_FAULT = "ParticipantFault" ;
+ /**
+ * The ParticipantFault QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_PARTICIPANT_FAULT = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_PARTICIPANT_FAULT, INTEROP_PREFIX) ;
+ /**
+ * The ParticipantFault Action.
+ */
+ public String INTEROP_ACTION_PARTICIPANT_FAULT = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_PARTICIPANT_FAULT ;
+
+ /**
+ * The ParticipantCompensationFault element.
+ */
+ public String INTEROP_ELEMENT_PARTICIPANT_COMPENSATION_FAULT = "ParticipantCompensationFault" ;
+ /**
+ * The ParticipantCompensationFault QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_PARTICIPANT_COMPENSATION_FAULT = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_PARTICIPANT_COMPENSATION_FAULT, INTEROP_PREFIX) ;
+ /**
+ * The ParticipantCompensationFault Action.
+ */
+ public String INTEROP_ACTION_PARTICIPANT_COMPENSATION_FAULT = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_PARTICIPANT_COMPENSATION_FAULT ;
+
+ /**
+ * The response element.
+ */
+ public String INTEROP_ELEMENT_RESPONSE = "Response" ;
+ /**
+ * The response QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_RESPONSE = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_RESPONSE, INTEROP_PREFIX) ;
+ /**
+ * The response Action.
+ */
+ public String INTEROP_ACTION_RESPONSE = INTEROP_ACTION_INITIATOR_PREFIX + INTEROP_ELEMENT_RESPONSE ;
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/BAInteropConstants.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/BAInteropUtil.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/BAInteropUtil.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/BAInteropUtil.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,174 @@
+package com.jboss.transaction.txinterop.webservices.bainterop;
+
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.wsaddr.AttributedURIType;
+import com.arjuna.webservices.wsaddr.EndpointReferenceType;
+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.webservices.wsarj.InstanceIdentifier;
+import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
+import com.arjuna.wsc.ActivationCoordinator;
+import com.arjuna.wsc.RegistrationCoordinator;
+import com.arjuna.wsc.messaging.MessageId;
+import com.arjuna.wst.BusinessActivityTerminator;
+import com.arjuna.wst.BusinessAgreementWithCoordinatorCompletionParticipant;
+import com.arjuna.wst.BusinessAgreementWithParticipantCompletionParticipant;
+import com.arjuna.wst.messaging.engines.CoordinatorCompletionParticipantEngine;
+import com.arjuna.wst.messaging.engines.ParticipantCompletionParticipantEngine;
+import com.arjuna.wst.stub.BusinessActivityTerminatorStub;
+
+/**
+ * Utility methods
+ */
+public class BAInteropUtil
+{
+ /**
+ * Get an atomic outcome coordination context.
+ * @param coordinatorURI The coordinator URI.
+ * @return The coordination context.
+ * @throws Exception for errors.
+ */
+ public static CoordinationContextType createAtomicOutcomeCoordinationContext(final String coordinatorURI)
+ throws Exception
+ {
+ return createCoordinationContext(coordinatorURI, BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME) ;
+ }
+
+ /**
+ * Get a mixed outcome coordination context.
+ * @param coordinatorURI The coordinator URI.
+ * @return The coordination context.
+ * @throws Exception for errors.
+ */
+ public static CoordinationContextType createMixedOutcomeCoordinationContext(final String coordinatorURI)
+ throws Exception
+ {
+ return createCoordinationContext(coordinatorURI, BusinessActivityConstants.WSBA_PROTOCOL_MIXED_OUTCOME) ;
+ }
+
+ /**
+ * Get a coordination context for the specified protocol.
+ * @param coordinatorURI The coordinator URI.
+ * @param protocol The coordination protocol.
+ * @return The coordination context.
+ * @throws Exception for errors.
+ */
+ private static CoordinationContextType createCoordinationContext(final String coordinatorURI, final String protocol)
+ throws Exception
+ {
+ return ActivationCoordinator.createCoordinationContext(coordinatorURI, MessageId.getMessageId(), protocol, null, null) ;
+ }
+
+ /**
+ * Register terminator.
+ * @param context The coordination context.
+ * @param id The id of the terminator.
+ * @return The endpoint for communicating with the coordinator.
+ * @throws Exception for errors.
+ */
+ public static BusinessActivityTerminator registerTerminator(final CoordinationContextType context, final String id)
+ throws Exception
+ {
+ final EndpointReferenceType completionCoordinator = register(context, getTerminatorParticipant(id), ArjunaTXConstants.WSARJTX_PROTOCOL_TERMINATION) ;
+ return new BusinessActivityTerminatorStub(id, completionCoordinator);
+ }
+
+ /**
+ * Register a participant completion participant in the specified coordination context.
+ * @param context The coordination context.
+ * @param participant The durable 2PC participant
+ * @param id The participant id.
+ * @return The participant engine.
+ * @throws Exception for errors.
+ */
+ public static ParticipantCompletionParticipantEngine registerParticipantCompletion(final CoordinationContextType context,
+ final BusinessAgreementWithParticipantCompletionParticipant participant, final String id)
+ throws Exception
+ {
+ final EndpointReferenceType coordinator = RegistrationCoordinator.register(context, MessageId.getMessageId(),
+ getParticipantCompletionParticipant(id), BusinessActivityConstants.WSBA_SUB_PROTOCOL_PARTICIPANT_COMPLETION) ;
+ final ParticipantCompletionParticipantEngine engine = new ParticipantCompletionParticipantEngine(id, coordinator, participant) ;
+ ParticipantCompletionParticipantProcessor.getProcessor().activateParticipant(engine, id) ;
+ return engine ;
+ }
+
+ /**
+ * Register a coordinator completion participant in the specified coordination context.
+ * @param context The coordination context.
+ * @param participant The durable 2PC participant
+ * @param id The participant id.
+ * @return The participant engine.
+ * @throws Exception for errors.
+ */
+ public static CoordinatorCompletionParticipantEngine registerCoordinatorCompletion(final CoordinationContextType context,
+ final BusinessAgreementWithCoordinatorCompletionParticipant participant, final String id)
+ throws Exception
+ {
+ final EndpointReferenceType coordinator = RegistrationCoordinator.register(context, MessageId.getMessageId(),
+ getCoordinatorCompletionParticipant(id), BusinessActivityConstants.WSBA_SUB_PROTOCOL_COORDINATOR_COMPLETION) ;
+ final CoordinatorCompletionParticipantEngine engine = new CoordinatorCompletionParticipantEngine(id, coordinator, participant) ;
+ CoordinatorCompletionParticipantProcessor.getProcessor().activateParticipant(engine, id) ;
+ return engine ;
+ }
+
+ /**
+ * Register for a sub protocol.
+ * @param context The coordination context.
+ * @param participant The participant EPR.
+ * @param protocol The protocol.
+ * @return The coordinator endpoint.
+ * @throws Exception for errors.
+ */
+ private static EndpointReferenceType register(final CoordinationContextType context, final EndpointReferenceType participant, final String protocol)
+ throws Exception
+ {
+ return RegistrationCoordinator.register(context, MessageId.getMessageId(), participant, protocol) ;
+ }
+
+ /**
+ * Get the endpoint reference for a terminator participant.
+ * @param id The participant id.
+ * @return The endpoint reference.
+ */
+ private static EndpointReferenceType getTerminatorParticipant(final String id)
+ {
+ return getEndpointReference(ArjunaTXConstants.SERVICE_TERMINATION_PARTICIPANT, id) ;
+ }
+
+ /**
+ * Get the endpoint reference for a participant completion participant.
+ * @param id The participant id.
+ * @return The endpoint reference.
+ */
+ private static EndpointReferenceType getParticipantCompletionParticipant(final String id)
+ {
+ return getEndpointReference(BusinessActivityConstants.SERVICE_PARTICIPANT_COMPLETION_PARTICIPANT, id) ;
+ }
+
+ /**
+ * Get the endpoint reference for a coordinator completion participant.
+ * @param id The participant id.
+ * @return The endpoint reference.
+ */
+ private static EndpointReferenceType getCoordinatorCompletionParticipant(final String id)
+ {
+ return getEndpointReference(BusinessActivityConstants.SERVICE_COORDINATOR_COMPLETION_PARTICIPANT, id) ;
+ }
+
+ /**
+ * Get the endpoint reference for a service.
+ * @param service The service.
+ * @param id The service id.
+ * @return The endpoint reference.
+ */
+ private static EndpointReferenceType getEndpointReference(final String service, final String id)
+ {
+ final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+ final String serviceURI = soapRegistry.getServiceURI(service) ;
+ final EndpointReferenceType participant = new EndpointReferenceType(new AttributedURIType(serviceURI)) ;
+ InstanceIdentifier.setEndpointInstanceIdentifier(participant, id) ;
+ return participant ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/BAInteropUtil.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/ParticipantStub.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/ParticipantStub.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/ParticipantStub.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,72 @@
+package com.jboss.transaction.txinterop.webservices.bainterop;
+
+import java.io.IOException;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+
+/**
+ * The interface for the participant stub.
+ */
+public interface ParticipantStub
+{
+ /**
+ * Send a participantClosed request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void participantClosed(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a participantCompensated request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void participantCompensated(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a participantCanceled request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void participantCanceled(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a participantExit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void participantExit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a participantFault request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void participantFault(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a participantCompensationFault request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void participantCompensationFault(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/ParticipantStub.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/SyncParticipantStub.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/SyncParticipantStub.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/SyncParticipantStub.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,132 @@
+package com.jboss.transaction.txinterop.webservices.bainterop;
+
+import java.io.IOException;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.Soap11Details;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.arjuna.wsc.messaging.MessageId;
+import com.jboss.transaction.txinterop.webservices.bainterop.client.SyncParticipantClient;
+
+/**
+ * The participant stub.
+ */
+public class SyncParticipantStub implements ParticipantStub
+{
+ /**
+ * The SOAP 1.1 details.
+ */
+ private static final SoapDetails SOAP_DETAILS = new Soap11Details() ;
+
+ /***
+ * The participant stub singletong.
+ */
+ private static final ParticipantStub PARTICIPANT_STUB = new SyncParticipantStub() ;
+
+ /**
+ * Get the participant stub singleton.
+ * @return The participant stub singleton.
+ */
+ public static ParticipantStub getParticipantStub()
+ {
+ return PARTICIPANT_STUB ;
+ }
+
+ /**
+ * Send a participantClosed request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void participantClosed(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendParticipantClosed(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a participantCompensated request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void participantCompensated(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendParticipantCompensated(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a participantCanceled request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void participantCanceled(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendParticipantCanceled(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a participantExit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void participantExit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendParticipantExit(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a participantFault request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void participantFault(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendParticipantFault(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a participantCompensationFault request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void participantCompensationFault(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendParticipantCompensationFault(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/SyncParticipantStub.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/TestMessageType.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/TestMessageType.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/TestMessageType.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,70 @@
+/*
+ * 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.jboss.transaction.txinterop.webservices.bainterop;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.stax.ElementContent;
+
+/*
+ * <xsd:complexType name="TestMessageType">
+ * <xsd:sequence/>
+ * </xsd:complexType>
+ */
+/**
+ * Representation of the Test Message type.
+ * @author kevin
+ */
+public class TestMessageType extends ElementContent
+{
+ /**
+ * Default constructor.
+ */
+ public TestMessageType()
+ {
+ }
+
+ /**
+ * Construct a register response from the input stream.
+ *
+ * @param in The input stream.
+ * @throws XMLStreamException For errors during parsing.
+ */
+ public TestMessageType(final XMLStreamReader in)
+ throws XMLStreamException
+ {
+ parse(in) ;
+ }
+
+ /**
+ * Add the element.
+ * @param in The current input stream.
+ * @param elementName The qualified element name.
+ */
+ protected void putElement(final XMLStreamReader in,
+ final QName elementName)
+ throws XMLStreamException
+ {
+ throw new XMLStreamException("Unexpected element name: " + elementName) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/TestMessageType.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/AsyncParticipantClient.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/AsyncParticipantClient.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/AsyncParticipantClient.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,238 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.client;
+
+import java.io.IOException;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.SoapService;
+import com.arjuna.webservices.base.policy.ClientPolicy;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wsaddr.AttributedURIType;
+import com.arjuna.webservices.wsaddr.EndpointReferenceType;
+import com.arjuna.webservices.wsaddr.client.BaseWSAddrClient;
+import com.arjuna.webservices.wsaddr.policy.AddressingPolicy;
+import com.arjuna.webservices.wscoor.CoordinationContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.arjuna.webservices.wscoor.policy.CoordinationContextPolicy;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+
+/**
+ * The participant client.
+ * @author kevin
+ */
+public class AsyncParticipantClient extends BaseWSAddrClient
+{
+ /**
+ * The client singleton.
+ */
+ private static final AsyncParticipantClient CLIENT = new AsyncParticipantClient() ;
+
+ /**
+ * The participantClosed action.
+ */
+ private final String participantClosedAction = BAInteropConstants.INTEROP_ACTION_PARTICIPANT_CLOSED ;
+ /**
+ * The participantCompensated action.
+ */
+ private final String participantCompensatedAction = BAInteropConstants.INTEROP_ACTION_PARTICIPANT_COMPENSATED ;
+ /**
+ * The participantCanceled action.
+ */
+ private final String participantCanceledAction = BAInteropConstants.INTEROP_ACTION_PARTICIPANT_CANCELED ;
+ /**
+ * The participantExit action.
+ */
+ private final String participantExitAction = BAInteropConstants.INTEROP_ACTION_PARTICIPANT_EXIT ;
+ /**
+ * The participantFault action.
+ */
+ private final String participantFaultAction = BAInteropConstants.INTEROP_ACTION_PARTICIPANT_FAULT ;
+ /**
+ * The participantCompensationFault action.
+ */
+ private final String participantCompensationFaultAction = BAInteropConstants.INTEROP_ACTION_PARTICIPANT_COMPENSATION_FAULT ;
+
+ /**
+ * The SOAP service representing the client.
+ */
+ private final SoapService soapService ;
+ /**
+ * The initiator URI for replies.
+ */
+ private final EndpointReferenceType initiator ;
+
+ /**
+ * Construct the interop synch client.
+ */
+ private AsyncParticipantClient()
+ {
+ final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+ // Add WS-Addressing
+ AddressingPolicy.register(handlerRegistry) ;
+ // Add coordination context
+ CoordinationContextPolicy.register(handlerRegistry) ;
+ // Add client policies
+ ClientPolicy.register(handlerRegistry) ;
+
+ soapService = new SoapService(handlerRegistry) ;
+ final String initiatorURI = SoapRegistry.getRegistry().getServiceURI(BAInteropConstants.SERVICE_INITIATOR) ;
+ initiator = new EndpointReferenceType(new AttributedURIType(initiatorURI)) ;
+ }
+
+ /**
+ * Send a participantClosed request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendParticipantClosed(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ sendOneWay(new TestMessageType(), addressingContext, soapService, initiator, initiator,
+ BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_CLOSED,
+ new AttributedURIType(participantClosedAction)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a participantCompensated request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendParticipantCompensated(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ sendOneWay(new TestMessageType(), addressingContext, soapService, initiator, initiator,
+ BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_COMPENSATED,
+ new AttributedURIType(participantCompensatedAction)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a participantCanceled request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendParticipantCanceled(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ sendOneWay(new TestMessageType(), addressingContext, soapService, initiator, initiator,
+ BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_CANCELED,
+ new AttributedURIType(participantCanceledAction)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a participantExit request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendParticipantExit(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ sendOneWay(new TestMessageType(), addressingContext, soapService, initiator, initiator,
+ BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_EXIT,
+ new AttributedURIType(participantExitAction)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a participantFault request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendParticipantFault(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ sendOneWay(new TestMessageType(), addressingContext, soapService, initiator, initiator,
+ BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_FAULT,
+ new AttributedURIType(participantFaultAction)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a participantCompensationFault request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendParticipantCompensationFault(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ sendOneWay(new TestMessageType(), addressingContext, soapService, initiator, initiator,
+ BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_COMPENSATION_FAULT,
+ new AttributedURIType(participantCompensationFaultAction)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Get the Interop client singleton.
+ * @return The Interop client singleton.
+ */
+ public static AsyncParticipantClient getClient()
+ {
+ return CLIENT ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/AsyncParticipantClient.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/InitiatorClient.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/InitiatorClient.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/InitiatorClient.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,93 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.client;
+
+import java.io.IOException;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapService;
+import com.arjuna.webservices.base.policy.ClientPolicy;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wsaddr.AttributedURIType;
+import com.arjuna.webservices.wsaddr.client.BaseWSAddrClient;
+import com.arjuna.webservices.wsaddr.policy.AddressingPolicy;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+
+/**
+ * The initiator client.
+ * @author kevin
+ */
+public class InitiatorClient extends BaseWSAddrClient
+{
+ /**
+ * The client singleton.
+ */
+ private static final InitiatorClient CLIENT = new InitiatorClient() ;
+
+ /**
+ * The response action.
+ */
+ private final String responseAction = BAInteropConstants.INTEROP_ACTION_RESPONSE ;
+
+ /**
+ * The SOAP service representing the client.
+ */
+ private final SoapService soapService ;
+
+ /**
+ * Construct the interop synch client.
+ */
+ private InitiatorClient()
+ {
+ final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+ // Add WS-Addressing
+ AddressingPolicy.register(handlerRegistry) ;
+ // Add client policies
+ ClientPolicy.register(handlerRegistry) ;
+
+ soapService = new SoapService(handlerRegistry) ;
+ }
+
+ /**
+ * Send a response.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendResponse(final AddressingContext addressingContext)
+ throws SoapFault, IOException
+ {
+ sendOneWay(new TestMessageType(), addressingContext, soapService, null, null,
+ BAInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE,
+ new AttributedURIType(responseAction)) ;
+ }
+
+ /**
+ * Send a fault.
+ * @param addressingContext The addressing context.
+ * @param soapFault The SOAP fault.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendSoapFault(final AddressingContext addressingContext, final SoapFault soapFault)
+ throws SoapFault, IOException
+ {
+ final String soapFaultAction = soapFault.getAction() ;
+ final AttributedURIType action = (soapFaultAction == null ? null : new AttributedURIType(soapFaultAction)) ;
+ if (action != null)
+ {
+ addressingContext.setAction(action) ;
+ }
+ sendSoapFault(soapFault, addressingContext, soapService, null, action) ;
+ }
+
+ /**
+ * Get the Interop client singleton.
+ * @return The Interop client singleton.
+ */
+ public static InitiatorClient getClient()
+ {
+ return CLIENT ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/InitiatorClient.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/SyncParticipantClient.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/SyncParticipantClient.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/SyncParticipantClient.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,281 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.client;
+
+import java.io.IOException;
+
+import javax.xml.namespace.QName;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.SoapMessage;
+import com.arjuna.webservices.SoapService;
+import com.arjuna.webservices.base.policy.ClientPolicy;
+import com.arjuna.webservices.soap.SoapBodyMessage;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.soap.SoapFaultMessage;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wsaddr.AttributedURIType;
+import com.arjuna.webservices.wsaddr.client.BaseWSAddrClient;
+import com.arjuna.webservices.wsaddr.policy.AddressingPolicy;
+import com.arjuna.webservices.wscoor.CoordinationContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.arjuna.webservices.wscoor.policy.CoordinationContextPolicy;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.bainterop.policy.BAInitiatorPolicy;
+
+/**
+ * The participant client.
+ * @author kevin
+ */
+public class SyncParticipantClient extends BaseWSAddrClient
+{
+ /**
+ * The client singleton.
+ */
+ private static final SyncParticipantClient CLIENT = new SyncParticipantClient() ;
+
+ /**
+ * The participantClosed action.
+ */
+ private final String participantClosedAction = BAInteropConstants.INTEROP_ACTION_PARTICIPANT_CLOSED ;
+ /**
+ * The participantCompensated action.
+ */
+ private final String participantCompensatedAction = BAInteropConstants.INTEROP_ACTION_PARTICIPANT_COMPENSATED ;
+ /**
+ * The participantCanceled action.
+ */
+ private final String participantCanceledAction = BAInteropConstants.INTEROP_ACTION_PARTICIPANT_CANCELED ;
+ /**
+ * The participantExit action.
+ */
+ private final String participantExitAction = BAInteropConstants.INTEROP_ACTION_PARTICIPANT_EXIT ;
+ /**
+ * The participantFault action.
+ */
+ private final String participantFaultAction = BAInteropConstants.INTEROP_ACTION_PARTICIPANT_FAULT ;
+ /**
+ * The participantCompensationFault action.
+ */
+ private final String participantCompensationFaultAction = BAInteropConstants.INTEROP_ACTION_PARTICIPANT_COMPENSATION_FAULT ;
+
+ /**
+ * The SOAP service representing the client.
+ */
+ private final SoapService soapService ;
+
+ /**
+ * Construct the interop synch client.
+ */
+ private SyncParticipantClient()
+ {
+ final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+ // Add WS-Addressing
+ AddressingPolicy.register(handlerRegistry) ;
+ // Add coordination context
+ CoordinationContextPolicy.register(handlerRegistry) ;
+ // Add the initiator policy
+ BAInitiatorPolicy.register(handlerRegistry) ;
+ // Add client policies
+ ClientPolicy.register(handlerRegistry) ;
+
+ soapService = new SoapService(handlerRegistry) ;
+ }
+
+ /**
+ * Send a participantClosed request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendParticipantClosed(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(send(new TestMessageType(), addressingContext, soapService, null, null,
+ BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_CLOSED, new AttributedURIType(participantClosedAction))) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a participantCompensated request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendParticipantCompensated(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(send(new TestMessageType(), addressingContext, soapService, null, null,
+ BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_COMPENSATED, new AttributedURIType(participantCompensatedAction))) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a participantCanceled request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendParticipantCanceled(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(send(new TestMessageType(), addressingContext, soapService, null, null,
+ BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_CANCELED, new AttributedURIType(participantCanceledAction))) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a participantExit request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendParticipantExit(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(send(new TestMessageType(), addressingContext, soapService, null, null,
+ BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_EXIT, new AttributedURIType(participantExitAction))) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a participantFault request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendParticipantFault(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(send(new TestMessageType(), addressingContext, soapService, null, null,
+ BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_FAULT, new AttributedURIType(participantFaultAction))) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a participantCompensationFault request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendParticipantCompensationFault(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(send(new TestMessageType(), addressingContext, soapService, null, null,
+ BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_COMPENSATION_FAULT, new AttributedURIType(participantCompensationFaultAction))) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Process the response.
+ * @param soapMessage The soap message.
+ * @return The response.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ private TestMessageType processResponse(final SoapMessage soapMessage)
+ throws SoapFault, IOException
+ {
+ if (soapMessage != null)
+ {
+ if (soapMessage.isFault())
+ {
+ final SoapFaultMessage soapFaultMessage = (SoapFaultMessage)soapMessage ;
+ throw soapFaultMessage.getSoapFault() ;
+ }
+ else
+ {
+ final SoapBodyMessage soapBodyMessage = (SoapBodyMessage)soapMessage ;
+ final SoapBody soapBody = soapBodyMessage.getSoapBody() ;
+ final NamedElement responseElement = (soapBody == null ? null : soapBody.getContents()) ;
+ if (responseElement != null)
+ {
+ final QName responseName = responseElement.getName() ;
+ if (BAInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE.equals(responseName))
+ {
+ try
+ {
+ return (TestMessageType)responseElement.getElementContent() ;
+ }
+ catch (final ClassCastException cce)
+ {
+ throw new SoapFault(SoapFaultType.FAULT_RECEIVER, null, "Expected test message response type for element: " + responseName) ;
+ }
+ }
+ else
+ {
+ throw new SoapFault(SoapFaultType.FAULT_RECEIVER, null, "Unexpected response element: " + responseName) ;
+ }
+ }
+ }
+ }
+ return null ;
+ }
+
+ /**
+ * Get the Interop client singleton.
+ * @return The Interop client singleton.
+ */
+ public static SyncParticipantClient getClient()
+ {
+ return CLIENT ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/SyncParticipantClient.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/InitiatorResponseHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/InitiatorResponseHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/InitiatorResponseHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,42 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor;
+
+/**
+ * The response handler.
+ * @author kevin
+ */
+public class InitiatorResponseHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+
+ BAInitiatorProcessor.getInitiator().handleResponse(message, addressingContext) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/InitiatorResponseHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/InitiatorSoapFaultHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/InitiatorSoapFaultHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/InitiatorSoapFaultHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,46 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATInitiatorProcessor;
+
+/**
+ * The rollback handler.
+ * @author kevin
+ */
+public class InitiatorSoapFaultHandler implements 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
+ {
+ final SoapFault soapFault = soapDetails.parseSoapFault(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ ATInitiatorProcessor.getInitiator().handleSoapFault(soapFault, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/InitiatorSoapFaultHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCanceledHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCanceledHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCanceledHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,51 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.bainterop.processors.BAParticipantProcessor;
+
+/**
+ * The participant canceled handler.
+ * @author kevin
+ */
+public class ParticipantCanceledHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ BAParticipantProcessor.getParticipant().participantCanceled(message, coordinationContext, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCanceledHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantClosedHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantClosedHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantClosedHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,51 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.bainterop.processors.BAParticipantProcessor;
+
+/**
+ * The closed handler.
+ * @author kevin
+ */
+public class ParticipantClosedHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ BAParticipantProcessor.getParticipant().participantClosed(message, coordinationContext, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantClosedHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCompensatedHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCompensatedHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCompensatedHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,51 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.bainterop.processors.BAParticipantProcessor;
+
+/**
+ * The compensated handler.
+ * @author kevin
+ */
+public class ParticipantCompensatedHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ BAParticipantProcessor.getParticipant().participantCompensated(message, coordinationContext, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCompensatedHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCompensationFaultHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCompensationFaultHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCompensationFaultHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,51 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.bainterop.processors.BAParticipantProcessor;
+
+/**
+ * The compensation fault handler.
+ * @author kevin
+ */
+public class ParticipantCompensationFaultHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ BAParticipantProcessor.getParticipant().participantCompensationFault(message, coordinationContext, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCompensationFaultHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantExitHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantExitHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantExitHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,51 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.bainterop.processors.BAParticipantProcessor;
+
+/**
+ * The exit handler.
+ * @author kevin
+ */
+public class ParticipantExitHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ BAParticipantProcessor.getParticipant().participantExit(message, coordinationContext, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantExitHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantFaultHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantFaultHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantFaultHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,51 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.bainterop.processors.BAParticipantProcessor;
+
+/**
+ * The fault handler.
+ * @author kevin
+ */
+public class ParticipantFaultHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ BAParticipantProcessor.getParticipant().participantFault(message, coordinationContext, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantFaultHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CancelParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CancelParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CancelParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,9 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.participant;
+
+
+/**
+ * The Cancel participant completion participant
+ */
+public class CancelParticipant extends ParticipantCompletionParticipantAdapter
+{
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CancelParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CompletedParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CompletedParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CompletedParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,26 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.participant;
+
+import java.util.TimerTask;
+
+import com.arjuna.webservices.util.TransportTimer;
+import com.arjuna.wst.messaging.engines.ParticipantCompletionParticipantEngine;
+
+public class CompletedParticipant extends ParticipantCompletionParticipantAdapter
+{
+ private ParticipantCompletionParticipantEngine engine ;
+
+ public void setEngine(final ParticipantCompletionParticipantEngine engine)
+ {
+ this.engine = engine ;
+ }
+
+ public void initialiseTimeout()
+ {
+ final TimerTask timerTask = new TimerTask() {
+ public void run() {
+ engine.completed() ;
+ }
+ } ;
+ TransportTimer.getTimer().schedule(timerTask, 2000) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CompletedParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/ExitParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/ExitParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/ExitParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,26 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.participant;
+
+import java.util.TimerTask;
+
+import com.arjuna.webservices.util.TransportTimer;
+import com.arjuna.wst.messaging.engines.ParticipantCompletionParticipantEngine;
+
+public class ExitParticipant extends ParticipantCompletionParticipantAdapter
+{
+ private ParticipantCompletionParticipantEngine engine ;
+
+ public void setEngine(final ParticipantCompletionParticipantEngine engine)
+ {
+ this.engine = engine ;
+ }
+
+ public void initialiseTimeout()
+ {
+ final TimerTask timerTask = new TimerTask() {
+ public void run() {
+ engine.exit() ;
+ }
+ } ;
+ TransportTimer.getTimer().schedule(timerTask, 2000) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/ExitParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/FaultParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/FaultParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/FaultParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,26 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.participant;
+
+import java.util.TimerTask;
+
+import com.arjuna.webservices.util.TransportTimer;
+import com.arjuna.wst.messaging.engines.ParticipantCompletionParticipantEngine;
+
+public class FaultParticipant extends ParticipantCompletionParticipantAdapter
+{
+ private ParticipantCompletionParticipantEngine engine ;
+
+ public void setEngine(final ParticipantCompletionParticipantEngine engine)
+ {
+ this.engine = engine ;
+ }
+
+ public void initialiseTimeout()
+ {
+ final TimerTask timerTask = new TimerTask() {
+ public void run() {
+ engine.fault() ;
+ }
+ } ;
+ TransportTimer.getTimer().schedule(timerTask, 2000) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/FaultParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/FaultedCompensateParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/FaultedCompensateParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/FaultedCompensateParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,14 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.participant;
+
+import com.arjuna.wst.FaultedException;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.WrongStateException;
+
+public class FaultedCompensateParticipant extends CompletedParticipant
+{
+ public void compensate()
+ throws FaultedException, WrongStateException, SystemException
+ {
+ throw new FaultedException() ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/FaultedCompensateParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/ParticipantCompletionParticipantAdapter.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/ParticipantCompletionParticipantAdapter.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/ParticipantCompletionParticipantAdapter.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,40 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.participant;
+
+import com.arjuna.wst.BusinessAgreementWithParticipantCompletionParticipant;
+import com.arjuna.wst.FaultedException;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.WrongStateException;
+
+class ParticipantCompletionParticipantAdapter implements BusinessAgreementWithParticipantCompletionParticipant
+{
+ public void cancel()
+ throws WrongStateException, SystemException
+ {
+ }
+
+ public void close()
+ throws WrongStateException, SystemException
+ {
+ }
+
+ public void compensate()
+ throws FaultedException, WrongStateException, SystemException
+ {
+ }
+
+ public void error()
+ throws SystemException
+ {
+ }
+
+ public String status()
+ throws SystemException
+ {
+ return null ;
+ }
+
+ public void unknown()
+ throws SystemException
+ {
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/ParticipantCompletionParticipantAdapter.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/policy/BAInitiatorPolicy.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/policy/BAInitiatorPolicy.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/policy/BAInitiatorPolicy.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,34 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.policy;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.handlers.InitiatorResponseHandler;
+import com.jboss.transaction.txinterop.webservices.bainterop.handlers.InitiatorSoapFaultHandler;
+
+/**
+ * Policy responsible for binding in the WS-TX BA Interop participant server handlers.
+ * @author kevin
+ */
+public class BAInitiatorPolicy
+{
+ /**
+ * Add this policy to the registry.
+ * @param registry The registry containing the policy.
+ */
+ public static void register(final HandlerRegistry registry)
+ {
+ registry.registerBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, new InitiatorResponseHandler()) ;
+
+ registry.registerFaultHandler(new InitiatorSoapFaultHandler()) ;
+ }
+
+ /**
+ * Remove this policy from the registry.
+ * @param registry The registry containing the policy.
+ */
+ public static void remove(final HandlerRegistry registry)
+ {
+ registry.registerFaultHandler(null) ;
+ registry.removeBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/policy/BAInitiatorPolicy.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/policy/BAParticipantPolicy.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/policy/BAParticipantPolicy.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/policy/BAParticipantPolicy.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,50 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.policy;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.arjuna.webservices.base.handlers.LoggingFaultHandler;
+import com.jboss.transaction.txinterop.webservices.InteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.handlers.ParticipantCanceledHandler;
+import com.jboss.transaction.txinterop.webservices.bainterop.handlers.ParticipantClosedHandler;
+import com.jboss.transaction.txinterop.webservices.bainterop.handlers.ParticipantCompensatedHandler;
+import com.jboss.transaction.txinterop.webservices.bainterop.handlers.ParticipantCompensationFaultHandler;
+import com.jboss.transaction.txinterop.webservices.bainterop.handlers.ParticipantExitHandler;
+import com.jboss.transaction.txinterop.webservices.bainterop.handlers.ParticipantFaultHandler;
+
+/**
+ * Policy responsible for binding in the WS-TX AT Interop participant server handlers.
+ * @author kevin
+ */
+public class BAParticipantPolicy
+{
+ /**
+ * Add this policy to the registry.
+ * @param registry The registry containing the policy.
+ */
+ public static void register(final HandlerRegistry registry)
+ {
+ registry.registerBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_CLOSED, new ParticipantClosedHandler()) ;
+ registry.registerBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_COMPENSATED, new ParticipantCompensatedHandler()) ;
+ registry.registerBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_CANCELED, new ParticipantCanceledHandler()) ;
+ registry.registerBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_EXIT, new ParticipantExitHandler()) ;
+ registry.registerBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_FAULT, new ParticipantFaultHandler()) ;
+ registry.registerBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_COMPENSATION_FAULT, new ParticipantCompensationFaultHandler()) ;
+
+ registry.registerFaultHandler(new LoggingFaultHandler(InteropConstants.SERVICE_PARTICIPANT)) ;
+ }
+
+ /**
+ * Remove this policy from the registry.
+ * @param registry The registry containing the policy.
+ */
+ public static void remove(final HandlerRegistry registry)
+ {
+ registry.registerFaultHandler(null) ;
+ registry.removeBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_COMPENSATION_FAULT) ;
+ registry.removeBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_FAULT) ;
+ registry.removeBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_EXIT) ;
+ registry.removeBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_CANCELED) ;
+ registry.removeBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_COMPENSATED) ;
+ registry.removeBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_CLOSED) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/policy/BAParticipantPolicy.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAInitiatorCallback.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAInitiatorCallback.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAInitiatorCallback.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+/*
+ * 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.jboss.transaction.txinterop.webservices.bainterop.processors;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.base.processors.Callback;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+
+/**
+ * The callback for the initiator client.
+ * @author kevin
+ */
+public abstract class BAInitiatorCallback extends Callback
+{
+ /**
+ * A response.
+ * @param response The response.
+ * @param addressingContext The current addressing context.
+ */
+ public abstract void response(final TestMessageType response,
+ final AddressingContext addressingContext) ;
+
+ /**
+ * A SOAP fault response.
+ * @param soapFault The SOAP fault response.
+ * @param addressingContext The current addressing context.
+ */
+ public abstract void soapFault(final SoapFault soapFault, final AddressingContext addressingContext) ;
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAInitiatorCallback.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAInitiatorProcessor.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAInitiatorProcessor.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAInitiatorProcessor.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,86 @@
+/*
+ * 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.jboss.transaction.txinterop.webservices.bainterop.processors;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.base.processors.Callback;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wsaddr.processor.BaseWSAddrResponseProcessor;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+
+/**
+ * The Initiator processor.
+ * @author kevin
+ */
+public class BAInitiatorProcessor extends BaseWSAddrResponseProcessor
+{
+ /**
+ * The initiator singleton.
+ */
+ private static final BAInitiatorProcessor INITIATOR = new BAInitiatorProcessor() ;
+
+ /**
+ * Get the initiator singleton.
+ * @return The singleton.
+ */
+ public static BAInitiatorProcessor getInitiator()
+ {
+ return INITIATOR ;
+ }
+
+ /**
+ * Handle a response response.
+ * @param response The response.
+ * @param addressingContext The current addressing context.
+ */
+ public void handleResponse(final TestMessageType response, final AddressingContext addressingContext)
+ {
+ handleCallbacks(new CallbackExecutorAdapter() {
+ public void execute(final Callback callback) {
+ ((BAInitiatorCallback)callback).response(response, addressingContext) ;
+ }
+ }, getIDs(addressingContext)) ;
+ }
+
+ /**
+ * Register a SOAP fault response.
+ * @param soapFault The SOAP fault response.
+ * @param addressingContext The current addressing context.
+ */
+ public void handleSoapFault(final SoapFault soapFault, final AddressingContext addressingContext)
+ {
+ handleCallbacks(new CallbackExecutorAdapter() {
+ public void execute(final Callback callback) {
+ ((BAInitiatorCallback)callback).soapFault(soapFault, addressingContext) ;
+ }
+ }, getIDs(addressingContext)) ;
+ }
+
+ /**
+ * Register a callback for the specific message id.
+ * @param messageID The message ID.
+ * @param callback The callback for the response.
+ */
+ public void registerCallback(final String messageID, final BAInitiatorCallback callback)
+ {
+ register(messageID, callback) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAInitiatorProcessor.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAParticipantProcessor.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAParticipantProcessor.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAParticipantProcessor.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,216 @@
+/*
+ * 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.jboss.transaction.txinterop.webservices.bainterop.processors;
+
+import com.arjuna.ats.arjuna.common.Uid;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.arjuna.wsc.messaging.MessageId;
+import com.arjuna.wst.messaging.engines.ParticipantCompletionParticipantEngine;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropUtil;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.bainterop.client.InitiatorClient;
+import com.jboss.transaction.txinterop.webservices.bainterop.participant.CancelParticipant;
+import com.jboss.transaction.txinterop.webservices.bainterop.participant.CompletedParticipant;
+import com.jboss.transaction.txinterop.webservices.bainterop.participant.ExitParticipant;
+import com.jboss.transaction.txinterop.webservices.bainterop.participant.FaultParticipant;
+import com.jboss.transaction.txinterop.webservices.bainterop.participant.FaultedCompensateParticipant;
+
+/**
+ * The Participant processor.
+ * @author kevin
+ */
+public class BAParticipantProcessor
+{
+ /**
+ * The participant.
+ */
+ private static BAParticipantProcessor PARTICIPANT = new BAParticipantProcessor() ;
+
+ /**
+ * Get the participant.
+ * @return The participant.
+ */
+ public static BAParticipantProcessor getParticipant()
+ {
+ return PARTICIPANT ;
+ }
+
+ /**
+ * Execute the ParticipantClosed
+ * @param participantClosed The participant closed request.
+ * @param addressingContext The current addressing context.
+ */
+ public void participantClosed(final TestMessageType participantClosed, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ {
+ try
+ {
+ final CompletedParticipant participant = new CompletedParticipant() ;
+ final ParticipantCompletionParticipantEngine engine = BAInteropUtil.registerParticipantCompletion(coordinationContext, participant, new Uid().toString()) ;
+ participant.setEngine(engine) ;
+ participant.initialiseTimeout() ;
+ }
+ catch (final Throwable th)
+ {
+ sendFault(addressingContext, new SoapFault(th)) ;
+ }
+ sendResponse(addressingContext) ;
+ }
+
+ /**
+ * Execute the ParticipantCompensated
+ * @param participantCompensated The participantCompensated request.
+ * @param addressingContext The current addressing context.
+ */
+ public void participantCompensated(final TestMessageType participantCompensated, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ {
+ try
+ {
+ final CompletedParticipant participant = new CompletedParticipant() ;
+ final ParticipantCompletionParticipantEngine engine = BAInteropUtil.registerParticipantCompletion(coordinationContext, participant, new Uid().toString()) ;
+ participant.setEngine(engine) ;
+ participant.initialiseTimeout() ;
+ }
+ catch (final Throwable th)
+ {
+ sendFault(addressingContext, new SoapFault(th)) ;
+ }
+ sendResponse(addressingContext) ;
+ }
+
+ /**
+ * Execute the ParticipantCanceled
+ * @param participantCanceled The participantCanceled request.
+ * @param addressingContext The current addressing context.
+ */
+ public void participantCanceled(final TestMessageType participantCanceled, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ {
+ try
+ {
+ BAInteropUtil.registerParticipantCompletion(coordinationContext, new CancelParticipant(), new Uid().toString()) ;
+ }
+ catch (final Throwable th)
+ {
+ sendFault(addressingContext, new SoapFault(th)) ;
+ }
+ sendResponse(addressingContext) ;
+ }
+
+ /**
+ * Execute the ParticipantExit
+ * @param participantExit The participantExit request.
+ * @param addressingContext The current addressing context.
+ */
+ public void participantExit(final TestMessageType participantExit, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ {
+ try
+ {
+ final ExitParticipant participant = new ExitParticipant() ;
+ final ParticipantCompletionParticipantEngine engine = BAInteropUtil.registerParticipantCompletion(coordinationContext, participant, new Uid().toString()) ;
+ participant.setEngine(engine) ;
+ participant.initialiseTimeout() ;
+ }
+ catch (final Throwable th)
+ {
+ sendFault(addressingContext, new SoapFault(th)) ;
+ }
+ sendResponse(addressingContext) ;
+ }
+
+ /**
+ * Execute the ParticipantFault
+ * @param participantFault The participantFault request.
+ * @param addressingContext The current addressing context.
+ */
+ public void participantFault(final TestMessageType participantFault, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ {
+ try
+ {
+ final FaultParticipant participant = new FaultParticipant() ;
+ final ParticipantCompletionParticipantEngine engine = BAInteropUtil.registerParticipantCompletion(coordinationContext, participant, new Uid().toString()) ;
+ participant.setEngine(engine) ;
+ participant.initialiseTimeout() ;
+ }
+ catch (final Throwable th)
+ {
+ sendFault(addressingContext, new SoapFault(th)) ;
+ }
+ sendResponse(addressingContext) ;
+ }
+
+ /**
+ * Execute the ParticipantCompensationFault
+ * @param participantCompensationFault The participant compensation fault request.
+ * @param addressingContext The current addressing context.
+ */
+ public void participantCompensationFault(final TestMessageType participantCompensationFault, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ {
+ try
+ {
+ final FaultedCompensateParticipant participant = new FaultedCompensateParticipant() ;
+ final ParticipantCompletionParticipantEngine engine = BAInteropUtil.registerParticipantCompletion(coordinationContext, participant, new Uid().toString()) ;
+ participant.setEngine(engine) ;
+ participant.initialiseTimeout() ;
+ }
+ catch (final Throwable th)
+ {
+ sendFault(addressingContext, new SoapFault(th)) ;
+ }
+ sendResponse(addressingContext) ;
+ }
+
+ /**
+ * Send a response.
+ * @param addressingContext The addressing context.
+ */
+ private void sendResponse(final AddressingContext addressingContext)
+ {
+ final AddressingContext responseAddressingContext = AddressingContext.createResponseContext(addressingContext, MessageId.getMessageId()) ;
+
+ try
+ {
+ InitiatorClient.getClient().sendResponse(responseAddressingContext) ;
+ }
+ catch (Throwable throwable)
+ {
+ throwable.printStackTrace(System.err);
+ }
+ }
+
+ /**
+ * Send a SOAP fault response.
+ * @param addressingContext The addressing context.
+ * @param fault The SOAP fault.
+ */
+ private void sendFault(final AddressingContext addressingContext, final SoapFault fault)
+ {
+ final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, MessageId.getMessageId()) ;
+ try
+ {
+ InitiatorClient.getClient().sendSoapFault(faultAddressingContext, fault) ;
+ }
+ catch (Throwable throwable)
+ {
+ throwable.printStackTrace(System.err);
+ }
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAParticipantProcessor.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/server/BAInitiatorInitialisation.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/server/BAInitiatorInitialisation.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/server/BAInitiatorInitialisation.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,44 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.server;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.SoapService;
+import com.arjuna.webservices.wsaddr.policy.AddressingPolicy;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.policy.BAInitiatorPolicy;
+
+/**
+ * Initialise the interop initiator service.
+ * @author kevin
+ */
+public class BAInitiatorInitialisation implements ServletContextListener
+{
+ /**
+ * The context has been initialized.
+ * @param servletContextEvent The servlet context event.
+ */
+ public void contextInitialized(final ServletContextEvent servletContextEvent)
+ {
+ final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+ // Add WS-Addressing
+ AddressingPolicy.register(handlerRegistry) ;
+ // Add endpoint
+ BAInitiatorPolicy.register(handlerRegistry) ;
+
+ final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+ soapRegistry.registerSoapService(BAInteropConstants.SERVICE_INITIATOR,
+ new SoapService(handlerRegistry)) ;
+ }
+
+ /**
+ * The context is about to be destroyed.
+ * @param servletContextEvent The servlet context event.
+ */
+ public void contextDestroyed(final ServletContextEvent servletContextEvent)
+ {
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/server/BAInitiatorInitialisation.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/server/ParticipantInitialisation.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/server/ParticipantInitialisation.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/server/ParticipantInitialisation.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,50 @@
+package com.jboss.transaction.txinterop.webservices.server;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.SoapService;
+import com.arjuna.webservices.wsaddr.policy.AddressingPolicy;
+import com.arjuna.webservices.wscoor.policy.CoordinationContextPolicy;
+import com.jboss.transaction.txinterop.webservices.InteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.policy.ATParticipantPolicy;
+import com.jboss.transaction.txinterop.webservices.bainterop.policy.BAParticipantPolicy;
+
+/**
+ * Initialise the interop 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)
+ {
+ final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+ // Add WS-Addressing
+ AddressingPolicy.register(handlerRegistry) ;
+ // Add coordination context
+ CoordinationContextPolicy.register(handlerRegistry) ;
+ // Add AT policy
+ ATParticipantPolicy.register(handlerRegistry) ;
+ // Add BA policy
+ BAParticipantPolicy.register(handlerRegistry) ;
+
+ final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+ soapRegistry.registerSoapService(InteropConstants.SERVICE_PARTICIPANT,
+ new SoapService(handlerRegistry)) ;
+ }
+
+ /**
+ * The context is about to be destroyed.
+ * @param servletContextEvent The servlet context event.
+ */
+ public void contextDestroyed(final ServletContextEvent servletContextEvent)
+ {
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/com/jboss/transaction/txinterop/webservices/server/ParticipantInitialisation.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/wscf.xml
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/wscf.xml (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/wscf.xml 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/conf/wscf.xml
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/wscf.xml
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/wst.xml
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/wst.xml (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/wst.xml 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/conf/wst.xml
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/wst.xml
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX10-interop/src/wstx.xml
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/src/wstx.xml (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/src/wstx.xml 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/conf/wstx.xml
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/src/wstx.xml
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX10-interop/web/details.jsp
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/web/details.jsp (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/web/details.jsp 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,90 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"%>
+<%@page import="com.jboss.transaction.txinterop.test.TestConstants"%>
+<%@page import="java.util.Enumeration"%>
+<%@page import="junit.framework.TestResult"%>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<%@page import="junit.framework.TestFailure"%>
+<%@page import="junit.framework.TestCase"%>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>JBoss Transactions WS-TX Interop detail page</title>
+</head>
+<body>
+<h1>Results</h1>
+<%
+ final TestResult testResult = (TestResult)session.getAttribute(TestConstants.ATTRIBUTE_TEST_RESULT) ;
+ if (testResult == null)
+ {
+%>
+No JUnit test results generated.
+<%
+ }
+ else
+ {
+ final String type = request.getParameter("type") ;
+
+ Enumeration detailEnum = null ;
+ if (type != null)
+ {
+ if ("error".equals(type))
+ {
+ detailEnum = testResult.errors() ;
+ }
+ else if ("failure".equals(type))
+ {
+ detailEnum = testResult.failures() ;
+ }
+ }
+
+ Integer indexInt = null ;
+ if (detailEnum != null)
+ {
+ final String indexVal = request.getParameter("index") ;
+ try
+ {
+ indexInt = Integer.valueOf(indexVal) ;
+ }
+ catch (final NumberFormatException nfe) {}
+ }
+
+ TestFailure testFailure = null ;
+ if (indexInt != null)
+ {
+ int index = indexInt.intValue() ;
+ if (index > 0)
+ {
+ while(detailEnum.hasMoreElements())
+ {
+ final Object current = detailEnum.nextElement() ;
+ if (--index == 0)
+ {
+ testFailure = (TestFailure)current ;
+ break ;
+ }
+ }
+ }
+ }
+
+ if (testFailure == null)
+ {
+%>
+<p>Invalid request parameters</p>
+<%
+ }
+ else
+ {
+ final TestCase failure = (TestCase)testFailure.failedTest() ;
+%>
+<p>Test: <%= failure.getName() %></p>
+<pre>
+<%= testFailure.trace() %>
+</pre>
+<%
+ }
+ }
+%>
+<p>Return to <a href="results.jsp">results page</a></p>
+</body>
+</html>
\ No newline at end of file
Added: labs/jbosstm/workspace/interop/WSTX10-interop/web/index.jsp
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/web/index.jsp (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/web/index.jsp 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,52 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"%>
+<%@page import="java.util.Iterator"%>
+<%@page import="java.util.Map"%>
+<%@page import="com.arjuna.webservices.SoapRegistry"%>
+<%@page import="com.jboss.transaction.txinterop.test.TestConstants"%>
+<%@page import="com.jboss.transaction.txinterop.webservices.InteropConstants"%>
+
+<%!
+private final static String SERVICE_URI = SoapRegistry.getRegistry().getServiceURI(InteropConstants.SERVICE_PARTICIPANT) ;%>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>JBoss Transactions WS-TX Interop</title>
+</head>
+<body>
+<h1>JBoss Transactions WS-TX Interop</h1>
+<h2>Introduction</h2>
+<p>This web application implements a set of interoperability tests specified by the <a href="http://www.oasis-open.org/apps/org/workgroup/ws-tx/">Oasis WS-TX Technical Committee</a> site.</p>
+<p>Please send any queries to the <a href="mailto:kevin.conner at jboss.com?subject=Interop%20query">interop test contact</a></p>
+<h2>Interop tests</h2>
+<form action="test" method="post">
+<p>Service URI: <input name="<%= TestConstants.PARAM_SERVICE_URI %>" maxlength="2000" size="100" value="<%= SERVICE_URI %>"/></p>
+<p>Test timeout: <input name="<%= TestConstants.PARAM_TEST_TIMEOUT %>" maxlength="10" size="10" value="120000"/></p>
+<p>Asynchronous Test application: <input name="<%= TestConstants.PARAM_ASYNC_TEST %>" type="checkbox" checked="checked"/></p>
+<select name="<%= TestConstants.PARAM_TEST %>">
+<option value="<%= TestConstants.NAME_ALL_TESTS %>">All tests</option>
+<option value="<%= TestConstants.NAME_ALL_AT_TESTS %>">All AT tests</option>
+<option value="<%= TestConstants.NAME_ALL_BA_TESTS %>">All BA tests</option>
+<%
+
+ final Map descriptions = TestConstants.DESCRIPTIONS ;
+ final Iterator entryIter = descriptions.entrySet().iterator() ;
+ while(entryIter.hasNext())
+ {
+ final Map.Entry entry = (Map.Entry)entryIter.next() ;
+ final String testName = (String)entry.getKey() ;
+ final String testDescription = (String)entry.getValue() ;
+%>
+<option value="<%= testName %>"><%=testName + " - " + testDescription%></option>
+<%
+
+}
+%>
+</select>
+<p>
+<input type="submit" value="Execute"/>
+</p>
+</form>
+</body>
+</html>
\ No newline at end of file
Added: labs/jbosstm/workspace/interop/WSTX10-interop/web/invalidParameters.html
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/web/invalidParameters.html (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/web/invalidParameters.html 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>JBoss Transactions WS-TX Interop invalid parameters page</title>
+</head>
+<body>
+Unfortunately the parameters specified are invalid, please resubmit the request. If the request repeatedly fails please contact the <a href="mailto:kevin.conner at jboss.com?subject=Interop%20invalid%20parameters">interop test contact</a>
+<p>Return to <a href="index.jsp">main page</a></p>
+</body>
+</html>
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/web/invalidParameters.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX10-interop/web/results.jsp
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/web/results.jsp (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/web/results.jsp 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,90 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"%>
+<%@page import="com.jboss.transaction.txinterop.test.TestConstants"%>
+<%@page import="java.util.Enumeration"%>
+<%@page import="junit.framework.TestCase"%>
+<%@page import="junit.framework.TestFailure"%>
+<%@page import="junit.framework.TestResult"%>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>JBoss Transactions WS-TX Interop results page</title>
+</head>
+<body>
+<h1>Results</h1>
+<h2>Processed results</h2>
+<%
+ final String logName = (String)session.getAttribute(TestConstants.ATTRIBUTE_LOG_NAME) ;
+ if (logName != null)
+ {
+%>
+<p>View <a href="logs/<%= logName %>">log file</a></p>
+<%
+ }
+%>
+<h2>JUnit results</h2>
+<%
+ final TestResult testResult = (TestResult)session.getAttribute(TestConstants.ATTRIBUTE_TEST_RESULT) ;
+ if (testResult == null)
+ {
+%>
+No JUnit test results generated.
+<%
+ }
+ else
+ {
+ final int runCount = testResult.runCount() ;
+ final int errorCount = testResult.errorCount() ;
+ final int failureCount = testResult.failureCount() ;
+%>
+<p>Run count: <%= runCount %></p>
+<p>Error count: <%= errorCount %></p>
+<p>Failure count: <%= failureCount %></p>
+<%
+ if ((errorCount > 0) || (failureCount > 0))
+ {
+ if (errorCount > 0)
+ {
+ final Enumeration enumeration = testResult.errors() ;
+%>
+<H3>Errors</H3>
+<%
+ int count = 0 ;
+ while(enumeration.hasMoreElements())
+ {
+ final TestFailure testFailure = (TestFailure)enumeration.nextElement() ;
+ count++ ;
+ final TestCase failedTest = (TestCase)testFailure.failedTest() ;
+ final String name = failedTest.getName() ;
+ final String description = (String)TestConstants.DESCRIPTIONS.get(name) ;
+%>
+<p><a href="details.jsp?type=error&index=<%= count %>"><%= name %></a> <%= description %></p>
+<%
+ }
+ }
+ if (failureCount > 0)
+ {
+ final Enumeration enumeration = testResult.failures() ;
+%>
+<H3>Failures</H3>
+<%
+ int count = 0 ;
+ while(enumeration.hasMoreElements())
+ {
+ final TestFailure testFailure = (TestFailure)enumeration.nextElement() ;
+ count++ ;
+ final TestCase failedTest = (TestCase)testFailure.failedTest() ;
+ final String name = failedTest.getName() ;
+ final String description = (String)TestConstants.DESCRIPTIONS.get(name) ;
+%>
+<p><a href="details.jsp?type=failure&index=<%= count %>"><%= name %></a> <%= description %></p>
+<%
+ }
+ }
+ }
+ }
+%>
+<p>Return to <a href="index.jsp">main page</a></p>
+</body>
+</html>
\ No newline at end of file
Added: labs/jbosstm/workspace/interop/WSTX10-interop/web.xml
===================================================================
--- labs/jbosstm/workspace/interop/WSTX10-interop/web.xml (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX10-interop/web.xml 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!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>JBoss WSTX1.0 interop</display-name>
+
+ <description>JBoss WSTX1.0 interop</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 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.
+ -->
+ <init-param>
+ <param-name>BaseHttpURI</param-name>
+ <param-value>http://@HOST@:@PORT@/interop/soap/</param-value>
+ </init-param>
+ <!--
+ <init-param>
+ <param-name>BaseHttpsURI</param-name>
+ <param-value>https://localhost:8080/arjuna/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>
+ </servlet>
+
+ <servlet>
+ <servlet-name>HTTP Proxy Servlet</servlet-name>
+ <servlet-class>com.jboss.transaction.txinterop.proxy.ProxyListenerService</servlet-class>
+ <!--
+ The base URI of the proxy servlet.
+ -->
+ <init-param>
+ <param-name>proxyServiceURI</param-name>
+ <param-value>http://@HOST@:@PORT@/interop/proxy</param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet>
+ <servlet-name>JUnit test servlet</servlet-name>
+ <servlet-class>com.jboss.transaction.txinterop.test.TestServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet>
+ <servlet-name>Log servlet</servlet-name>
+ <servlet-class>com.jboss.transaction.txinterop.test.TestLogServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <!-- servlet mappings -->
+ <servlet-mapping>
+ <servlet-name>HTTP SOAP Service Multiplexor Servlet</servlet-name>
+ <url-pattern>/soap/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>HTTP Proxy Servlet</servlet-name>
+ <url-pattern>/proxy/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>JUnit test servlet</servlet-name>
+ <url-pattern>/test</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>Log servlet</servlet-name>
+ <url-pattern>/logs/*</url-pattern>
+ </servlet-mapping>
+
+ <!-- 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 WS-AT services -->
+ <listener>
+ <listener-class>com.arjuna.webservices.wsat.server.CompletionCoordinatorInitialisation</listener-class>
+ </listener>
+ <listener>
+ <listener-class>com.arjuna.webservices.wsat.server.CompletionInitiatorInitialisation</listener-class>
+ </listener>
+ <listener>
+ <listener-class>com.arjuna.webservices.wsat.server.CoordinatorInitialisation</listener-class>
+ </listener>
+ <listener>
+ <listener-class>com.arjuna.webservices.wsat.server.ParticipantInitialisation</listener-class>
+ </listener>
+
+ <!-- Initialise WS-BA services -->
+ <listener>
+ <listener-class>com.arjuna.webservices.wsba.server.CoordinatorCompletionCoordinatorInitialisation</listener-class>
+ </listener>
+ <listener>
+ <listener-class>com.arjuna.webservices.wsba.server.CoordinatorCompletionParticipantInitialisation</listener-class>
+ </listener>
+ <listener>
+ <listener-class>com.arjuna.webservices.wsba.server.ParticipantCompletionCoordinatorInitialisation</listener-class>
+ </listener>
+ <listener>
+ <listener-class>com.arjuna.webservices.wsba.server.ParticipantCompletionParticipantInitialisation</listener-class>
+ </listener>
+
+ <!-- Initialise ArjunaTX services -->
+ <listener>
+ <listener-class>com.arjuna.webservices.wsarjtx.server.TerminationCoordinatorInitialisation</listener-class>
+ </listener>
+ <listener>
+ <listener-class>com.arjuna.webservices.wsarjtx.server.TerminationParticipantInitialisation</listener-class>
+ </listener>
+
+ <!-- Initialise WS-T -->
+ <listener>
+ <listener-class>com.arjuna.wst.messaging.deploy.TransactionInitialisation</listener-class>
+ </listener>
+
+ <!-- Initialise WSCF -->
+ <listener>
+ <listener-class>com.arjuna.mw.wsc.deploy.WSCFInitialisation</listener-class>
+ </listener>
+
+ <!-- Initialise WSTX -->
+ <listener>
+ <listener-class>com.arjuna.mw.wst.deploy.WSTXInitialisation</listener-class>
+ </listener>
+
+ <filter>
+ <filter-name>HTTP Content Type filter</filter-name>
+ <filter-class>com.arjuna.webservices.transport.http.HttpContentTypeFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>HTTP Content Type filter</filter-name>
+ <servlet-name>HTTP SOAP Service Multiplexor Servlet</servlet-name>
+ </filter-mapping>
+
+
+ <!-- Initialise interop services -->
+ <listener>
+ <listener-class>com.jboss.transaction.txinterop.webservices.server.ParticipantInitialisation</listener-class>
+ </listener>
+ <listener>
+ <listener-class>com.jboss.transaction.txinterop.webservices.atinterop.server.ATInitiatorInitialisation</listener-class>
+ </listener>
+ <listener>
+ <listener-class>com.jboss.transaction.txinterop.webservices.bainterop.server.BAInitiatorInitialisation</listener-class>
+ </listener>
+
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ </welcome-file-list>
+</web-app>
Property changes on: labs/jbosstm/workspace/interop/WSTX10-interop/web.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:keywords
+ Rev Date
Added: labs/jbosstm/workspace/interop/WSTX11-interop/build.xml
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/build.xml (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/build.xml 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,69 @@
+<?xml version="1.0"?>
+<project name="project" default="war">
+ <description>
+ JBoss Transactions WS-Addressing interop test
+ </description>
+
+ <property environment="env"/>
+
+ <property name="host" value="127.0.0.1"/>
+ <property name="port" value="8080"/>
+
+ <property name="jboss.deploy.dir" location="${env.HOME}/jboss-deploy"/>
+
+ <property name="build.dir" location="build"/>
+ <property name="build.classes.dir" location="${build.dir}/classes"/>
+ <property name="build.lib.dir" location="${build.dir}/lib"/>
+ <property name="build.war.file" location="${build.lib.dir}/interop.war"/>
+ <property name="build.webxml.file" location="${build.lib.dir}/web.xml"/>
+
+ <property name="src.dir" location="src"/>
+ <property name="webxml.file" location="web.xml"/>
+ <property name="lib.dir" location="lib"/>
+ <property name="web.dir" location="web"/>
+
+ <property name="dist.compile.libs" value="ws-c.jar ws-t.jar wscf.jar wstx.jar wsas.jar jbossjts.jar jbossts-common.jar stax-api-1.0.jar junit-3.8.1.jar saxon8.jar"/>
+ <property name="dist.dependency.libs" value="wstx-asl-2.0.3.jar"/>
+ <property name="dist.libs" value="${dist.compile.libs} ${dist.dependency.libs}"/>
+ <property name="compile.libs" value="${dist.compile.libs} servlet.jar"/>
+ <property name="compile.debug" value="true"/>
+
+ <path id="classpath">
+ <fileset dir="${lib.dir}" includes="${compile.libs}"/>
+ </path>
+ <property name="classpath" refid="classpath"/>
+
+ <target name="init">
+ <mkdir dir="${build.dir}"/>
+ <mkdir dir="${build.classes.dir}"/>
+ <mkdir dir="${build.lib.dir}"/>
+ </target>
+
+ <target name="compile" depends="init">
+ <javac classpathref="classpath" destdir="${build.classes.dir}" srcdir="${src.dir}" debug="${compile.debug}"/>
+ </target>
+
+ <target name="war" depends="compile">
+ <copy file="${webxml.file}" tofile="${build.webxml.file}" overwrite="yes">
+ <filterset>
+ <filter token="HOST" value="${host}"/>
+ <filter token="PORT" value="${port}"/>
+ </filterset>
+ </copy>
+ <war destfile="${build.war.file}" webxml="${build.webxml.file}">
+ <classes dir="${build.classes.dir}"/>
+ <classes dir="${src.dir}" excludes="**/*.java"/>
+ <lib dir="${lib.dir}" includes="${dist.libs}"/>
+ <fileset dir="${web.dir}"/>
+ </war>
+ </target>
+
+ <target name="deploy" depends="war">
+ <copy file="${build.war.file}" todir="${jboss.deploy.dir}"/>
+ </target>
+
+ <target name="clean">
+ <delete dir="${build.dir}"/>
+ </target>
+</project>
+
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/build.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/lib/jbossjts.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/lib/jbossjts.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/lib/jbossjts.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/lib/ext/jbossjts.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/lib/jbossjts.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX11-interop/lib/jbossts-common.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/lib/jbossts-common.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/lib/jbossts-common.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/lib/ext/jbossts-common.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/lib/jbossts-common.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX11-interop/lib/junit-3.8.1.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/lib/junit-3.8.1.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/lib/junit-3.8.1.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /usr/java/junit3.8.1/junit.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/lib/junit-3.8.1.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX11-interop/lib/saxon8.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/lib/saxon8.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/lib/saxon8.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /usr/java/saxonb8/saxon8.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/lib/saxon8.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX11-interop/lib/servlet.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/lib/servlet.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/lib/servlet.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/lib/ext/servlet.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/lib/servlet.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX11-interop/lib/stax-api-1.0.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/lib/stax-api-1.0.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/lib/stax-api-1.0.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/lib/ext/stax-api-1.0.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/lib/stax-api-1.0.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX11-interop/lib/ws-c.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/lib/ws-c.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/lib/ws-c.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/lib/ws-c.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/lib/ws-c.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX11-interop/lib/ws-t.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/lib/ws-t.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/lib/ws-t.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/lib/ws-t.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/lib/ws-t.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX11-interop/lib/wsas.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/lib/wsas.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/lib/wsas.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/lib/wsas.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/lib/wsas.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX11-interop/lib/wscf.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/lib/wscf.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/lib/wscf.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/lib/wscf.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/lib/wscf.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX11-interop/lib/wstx-asl-2.0.3.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/lib/wstx-asl-2.0.3.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/lib/wstx-asl-2.0.3.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/lib/ext/wstx-asl-2.0.3.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/lib/wstx-asl-2.0.3.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX11-interop/lib/wstx.jar
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/lib/wstx.jar (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/lib/wstx.jar 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/lib/wstx.jar
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/lib/wstx.jar
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/ATTestCase.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/ATTestCase.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/ATTestCase.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,520 @@
+package com.jboss.transaction.txinterop.interop;
+
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.wsat11.AtomicTransactionConstants;
+import com.arjuna.webservices.wscoor11.CoordinationConstants;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.arjuna.wst.CompletionCoordinatorParticipant;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.jboss.transaction.txinterop.interop.states.ATInteropPreparedAfterTimeoutState;
+import com.jboss.transaction.txinterop.interop.states.ATInteropRetryPreparedAbortState;
+import com.jboss.transaction.txinterop.interop.states.ATInteropRetryPreparedCommitState;
+import com.jboss.transaction.txinterop.interop.states.InteropWaitState;
+import com.jboss.transaction.txinterop.proxy.ProxyConversation;
+import com.jboss.transaction.txinterop.proxy.ProxyURIRewriting;
+import com.jboss.transaction.txinterop.webservices.InteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.AsyncParticipantStub;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropUtil;
+import com.jboss.transaction.txinterop.webservices.atinterop.ParticipantStub;
+import com.jboss.transaction.txinterop.webservices.atinterop.SyncParticipantStub;
+
+/**
+ * The AT endpoint test case
+ * @author kevin
+ */
+public class ATTestCase extends InteropTestCase
+{
+ /**
+ * The coordinator URI of the source.
+ */
+ private static final String SOURCE_COORDINATOR_URI ;
+ /**
+ * The service URI of the participant.
+ */
+ private static final String SOURCE_PARTICIPANT_URI ;
+
+ /**
+ * Construct the named test case.
+ */
+ public ATTestCase()
+ {
+ // Default the service to the local service.
+ setParticipantURI(getSourceParticipantURI()) ;
+ setTestTimeout(120000) ;
+ setAsyncTest(true) ;
+ }
+
+ /**
+ * testAT1_1 - 1.1 CompletionCommit
+ * Participant creates and commits a transaction using the initiator's coordinator.
+ * @throws Exception on failure.
+ */
+ public void testAT1_1()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_COMMITTED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final String coordinatorURI = ProxyURIRewriting.rewriteURI(ProxyConversation.getAlternateConversationId(conversationId), getSourceCoordinatorURI()) ;
+ getParticipantStub().completionCommit(serviceURI, coordinatorURI) ;
+ state.waitForCompletion(getTestTimeout()) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT1_2 - 1.2 CompletionRollback
+ * Participant creates and rolls back a transaction using the initiator's coordinator.
+ * @throws Exception on failure.
+ */
+ public void testAT1_2()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_ABORTED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final String coordinatorURI = ProxyURIRewriting.rewriteURI(ProxyConversation.getAlternateConversationId(conversationId), getSourceCoordinatorURI()) ;
+ getParticipantStub().completionRollback(serviceURI, coordinatorURI) ;
+ state.waitForCompletion(getTestTimeout()) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT2_1 - 2.1 Commit
+ * Participant registers for Durable2PC, initiator commits, transaction commits successfully.
+ * @throws Exception on failure.
+ */
+ public void testAT2_1()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_COMMITTED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().commit(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT2_2 - 2.2 Rollback
+ * Participant registers for Durable2PC, initiator rolls back.
+ * @throws Exception on failure.
+ */
+ public void testAT2_2()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_ABORTED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().rollback(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.rollback() ;
+
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT3_1 - 3.1 Phase2Rollback
+ * Coordinator aborts the transaction due to an Aborted vote during the prepare phase.
+ * @throws Exception on failure.
+ */
+ public void testAT3_1()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_ABORTED, 2) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().phase2Rollback(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+ fail("Transaction rollback expected") ;
+ }
+ catch (final TransactionRolledBackException trbe)
+ {
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT3_2 - 3.2 Readonly
+ * Tests coordinator committing a transaction with a read only participant.
+ * @throws Exception on failure.
+ */
+ public void testAT3_2()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_COMMITTED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().readonly(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT3_3 - 3.3 VolatileAndDurable
+ * Tests registration during the volatile prepare phase.
+ * @throws Exception on failure.
+ */
+ public void testAT3_3()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_COMMITTED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().volatileAndDurable(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT4_1 - 4.1 EarlyReadonly
+ * Tests the case of a participant initiated ReadOnly message occurring prior to the prepare phase.
+ * @throws Exception on failure.
+ */
+ public void testAT4_1()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_COMMITTED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().earlyReadonly(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT4_2 - 4.2 EarlyAborted
+ * Tests the case of a participant initiated Aborted message occurring prior to the prepare phase.
+ * @throws Exception on failure.
+ */
+ public void testAT4_2()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_ABORTED, 2) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().earlyAborted(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+ fail("Transaction rollback expected") ;
+ }
+ catch (final TransactionRolledBackException trbe)
+ {
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT5_1 - 5.1 ReplayCommit
+ * Participant registers for Durable2PC, initator initiates commit, participant fails after prepared, recovers and resends prepared. Transaction commits normally.
+ * @throws Exception on failure.
+ */
+ public void testAT5_1()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_COMMITTED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().replayCommit(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT5_2 - 5.2 RetryPreparedCommit
+ * Tests recovery from a communication failure during the prepare phase. Transaction commits normally.
+ * @throws Exception on failure.
+ */
+ public void testAT5_2()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final ATInteropRetryPreparedCommitState state = new ATInteropRetryPreparedCommitState() ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().retryPreparedCommit(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT5_3 - 5.3 RetryPreparedAbort
+ * Tests recovery from a communication failure during the prepare phase. Transaction times out.
+ * @throws Exception on failure.
+ */
+ public void testAT5_3()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final ATInteropRetryPreparedAbortState state = new ATInteropRetryPreparedAbortState() ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().retryPreparedAbort(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+ fail("Transaction rollback expected") ;
+ }
+ catch (final TransactionRolledBackException trbe)
+ {
+ state.waitForCompletion(getTestTimeout()) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT5_4 - 5.4 RetryCommit
+ * Tests recovery from a communication failure during the commit phase. Transaction commits normally.
+ * @throws Exception on failure.
+ */
+ public void testAT5_4()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_COMMITTED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().retryCommit(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT5_5 - 5.5 PreparedAfterTimeout
+ * Tests recovery from a communication failure during the prepare phase. Transaction times out. Two participants, volatile and durable.
+ * @throws Exception on failure.
+ */
+ public void testAT5_5()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final ATInteropPreparedAfterTimeoutState state = new ATInteropPreparedAfterTimeoutState() ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().preparedAfterTimeout(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+ fail("Transaction rollback expected") ;
+ }
+ catch (final SystemException se)
+ {
+ state.waitForCompletion(getTestTimeout()) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testAT5_6 - 5.6 LostCommitted
+ * Tests the effect of a lost Committed message.
+ * @throws Exception on failure.
+ */
+ public void testAT5_6()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(AtomicTransactionConstants.WSAT_ACTION_COMMITTED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().lostCommitted(serviceURI, context) ;
+
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * Get the source coordinator URI.
+ * @return The source coordinator uri.
+ */
+ protected static String getSourceCoordinatorURI()
+ {
+ return SOURCE_COORDINATOR_URI ;
+ }
+
+ /**
+ * Get the source participant URI.
+ * @return The source participant uri.
+ */
+ protected static String getSourceParticipantURI()
+ {
+ return SOURCE_PARTICIPANT_URI ;
+ }
+
+ /**
+ * Get the participant stub for the test.
+ * @return The participant stub.
+ */
+ private ParticipantStub getParticipantStub()
+ {
+ return (getAsyncTest() ? AsyncParticipantStub.getParticipantStub() : SyncParticipantStub.getParticipantStub()) ;
+ }
+
+ static
+ {
+ final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+ SOURCE_PARTICIPANT_URI = soapRegistry.getServiceURI(InteropConstants.SERVICE_PARTICIPANT) ;
+ SOURCE_COORDINATOR_URI = soapRegistry.getServiceURI(CoordinationConstants.SERVICE_ACTIVATION_COORDINATOR) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/ATTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/BATestCase.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/BATestCase.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/BATestCase.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,437 @@
+package com.jboss.transaction.txinterop.interop;
+
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.wsba11.BusinessActivityConstants;
+import com.arjuna.webservices.wscoor11.CoordinationConstants;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.arjuna.wst.BusinessActivityTerminator;
+import com.jboss.transaction.txinterop.interop.states.BAInteropDroppedParticipantCompletedState;
+import com.jboss.transaction.txinterop.interop.states.BAInteropParticipantCompletedState;
+import com.jboss.transaction.txinterop.interop.states.BAInteropUnsolicitedCompleteState;
+import com.jboss.transaction.txinterop.interop.states.InteropWaitState;
+import com.jboss.transaction.txinterop.proxy.ProxyConversation;
+import com.jboss.transaction.txinterop.proxy.ProxyURIRewriting;
+import com.jboss.transaction.txinterop.webservices.InteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.AsyncParticipantStub;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropUtil;
+import com.jboss.transaction.txinterop.webservices.bainterop.ParticipantStub;
+import com.jboss.transaction.txinterop.webservices.bainterop.SyncParticipantStub;
+
+/**
+ * The BA endpoint test case
+ * @author kevin
+ */
+public class BATestCase extends InteropTestCase
+{
+ /**
+ * The coordinator URI of the source.
+ */
+ private static final String SOURCE_COORDINATOR_URI ;
+ /**
+ * The service URI of the participant.
+ */
+ private static final String SOURCE_PARTICIPANT_URI ;
+
+ /**
+ * Construct the named test case.
+ */
+ public BATestCase()
+ {
+ // Default the service to the local service.
+ setParticipantURI(getSourceParticipantURI()) ;
+ setTestTimeout(120000) ;
+ setAsyncTest(true) ;
+ }
+
+ /**
+ * testBA1_1 - 1.1 Cancel
+ * The IA cancels the activity before the PA completes its work on behalf of the activity.
+ * @throws Exception on failure.
+ */
+ public void testBA1_1()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(BusinessActivityConstants.WSBA_ACTION_CANCELLED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().cancel(serviceURI, context) ;
+
+ final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
+ terminator.cancel() ;
+
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testBA1_2 - 1.2 Exit
+ * The PA exits without completing any work on behalf of the activity.
+ * @throws Exception on failure.
+ */
+ public void testBA1_2()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(BusinessActivityConstants.WSBA_ACTION_EXITED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().exit(serviceURI, context) ;
+
+ state.waitForCompletion(getTestTimeout()) ;
+
+ final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
+ terminator.cancel() ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testBA1_3 - 1.3 Fail
+ * The PA fails before completing its work on behalf of the activity.
+ * @throws Exception on failure.
+ */
+ public void testBA1_3()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(BusinessActivityConstants.WSBA_ACTION_FAILED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().fail(serviceURI, context) ;
+
+ state.waitForCompletion(getTestTimeout()) ;
+
+ final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
+ terminator.cancel() ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testBA1_4 - 1.4 CannotComplete
+ * The PA sends CannotComplete before completing its work on behalf of the activity.
+ * @throws Exception on failure.
+ */
+ public void testBA1_4()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(BusinessActivityConstants.WSBA_ACTION_NOT_COMPLETED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().cannotComplete(serviceURI, context) ;
+
+ state.waitForCompletion(getTestTimeout()) ;
+
+ final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
+ terminator.cancel() ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testBA1_5 - 1.5 ParticipantCompleteClose
+ * The PA successfully completes its work on behalf of the activity and the activity is closed.
+ * @throws Exception on failure.
+ */
+ public void testBA1_5()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final BAInteropParticipantCompletedState state = new BAInteropParticipantCompletedState(BusinessActivityConstants.WSBA_ACTION_CLOSED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().participantCompleteClose(serviceURI, context) ;
+
+ assertTrue("Participant did not issue Completed", state.waitForParticipantCompleted(getTestTimeout())) ;
+
+ final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
+ terminator.close() ;
+
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testBA1_6 - 1.6 CoordinatorCompleteClose
+ * The PA successfully completes its work on behalf of the activity and the activity is closed.
+ * @throws Exception on failure.
+ */
+ public void testBA1_6()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(BusinessActivityConstants.WSBA_ACTION_CLOSED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().coordinatorCompleteClose(serviceURI, context) ;
+
+ final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
+ terminator.complete() ;
+ terminator.close() ;
+
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testBA1_7 - 1.7 UnsolicitedComplete
+ * Tests a protocol error, participant send Completed for coordinator completion. Throws an invalid state fault.
+ * @throws Exception on failure.
+ */
+ public void testBA1_7()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final BAInteropUnsolicitedCompleteState state = new BAInteropUnsolicitedCompleteState() ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().unsolicitedComplete(serviceURI, context) ;
+
+ state.waitForCompletion(getTestTimeout()) ;
+
+ final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
+ terminator.cancel() ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+//
+ /**
+ * testBA1_8 - 1.8 Compensate
+ * The PA successfully completes its work on behalf of the activity and the activity is compensated.
+ * @throws Exception on failure.
+ */
+ public void testBA1_8()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final BAInteropParticipantCompletedState state = new BAInteropParticipantCompletedState(BusinessActivityConstants.WSBA_ACTION_COMPENSATED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().participantCompleteClose(serviceURI, context) ;
+
+ assertTrue("Participant did not issue Completed", state.waitForParticipantCompleted(getTestTimeout())) ;
+
+ final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
+ terminator.cancel() ;
+
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testBA1_9 - 1.9 CompensationFail
+ * The PA successfully completes its work on behalf of the activity but compensation fails..
+ * @throws Exception on failure.
+ */
+ public void testBA1_9()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final BAInteropParticipantCompletedState state = new BAInteropParticipantCompletedState(BusinessActivityConstants.WSBA_ACTION_FAILED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().compensationFail(serviceURI, context) ;
+
+ assertTrue("Participant did not issue Completed", state.waitForParticipantCompleted(getTestTimeout())) ;
+
+ final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
+ terminator.cancel() ;
+
+ state.waitForCompletion(getTestTimeout()) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testBA1_10 - 1.10 ParticipantCancelCompletedRace
+ * Simulate a race between cancel and completed.
+ * @throws Exception on failure.
+ */
+ public void testBA1_10()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final BAInteropDroppedParticipantCompletedState state = new BAInteropDroppedParticipantCompletedState(BusinessActivityConstants.WSBA_ACTION_COMPENSATED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().participantCancelCompletedRace(serviceURI, context) ;
+
+ assertTrue("Participant did not issue Completed", state.waitForParticipantCompleted(getTestTimeout())) ;
+
+ final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
+ terminator.cancel() ;
+
+ state.waitForCompletion(getTestTimeout()) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+ /**
+ * testBA1_11 - 1.11 MessageLossAndRecovery
+ * The IA cancels the activity before the PA completes its work on behalf of the activity.
+ * @throws Exception on failure.
+ */
+ public void testBA1_11()
+ throws Exception
+ {
+ final String conversationId = getConversationId() ;
+ final InteropWaitState state = new InteropWaitState(BusinessActivityConstants.WSBA_ACTION_COMPENSATED) ;
+ ProxyConversation.setConversationState(conversationId, state) ;
+ try
+ {
+ final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+ final CoordinationContextType context = BAInteropUtil.createAtomicOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+ getParticipantStub().messageLossAndRecovery(serviceURI, context) ;
+
+ final BusinessActivityTerminator terminator = BAInteropUtil.registerTerminator(context, context.getIdentifier().getValue()) ;
+ terminator.complete() ;
+ terminator.cancel() ;
+
+ state.waitForCompletion(0) ;
+ }
+ finally
+ {
+ ProxyConversation.clearConversationState(conversationId) ;
+ }
+ assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+ }
+
+// /**
+// * testBA1_12 - 1.12 MixedOutcome
+// * The IA cancels the activity before the PA completes its work on behalf of the activity.
+// * @throws Exception on failure.
+// */
+// public void testBA1_12()
+// throws Exception
+// {
+// final String conversationId = getConversationId() ;
+// final ATInteropWaitState state = new ATInteropWaitState(BusinessActivityConstants.WSAT_ACTION_COMMITTED) ;
+// ProxyConversation.setConversationState(conversationId, state) ;
+// try
+// {
+// final String serviceURI = ProxyURIRewriting.rewriteURI(conversationId, getParticipantURI()) ;
+// final CoordinationContextType context = BAInteropUtil.createMixedOutcomeCoordinationContext(getSourceCoordinatorURI()) ;
+// getParticipantStub().commit(serviceURI, context) ;
+//
+// final CompletionCoordinatorParticipant participant = BAInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+// participant.commit() ;
+//
+// state.waitForCompletion(getTestTimeout()) ;
+// }
+// finally
+// {
+// ProxyConversation.clearConversationState(conversationId) ;
+// }
+// assertTrue("Conversation did not complete successfully", state.isSuccessful()) ;
+// }
+
+ /**
+ * Get the source coordinator URI.
+ * @return The source coordinator uri.
+ */
+ protected static String getSourceCoordinatorURI()
+ {
+ return SOURCE_COORDINATOR_URI ;
+ }
+
+ /**
+ * Get the source participant URI.
+ * @return The source participant uri.
+ */
+ protected static String getSourceParticipantURI()
+ {
+ return SOURCE_PARTICIPANT_URI ;
+ }
+
+ /**
+ * Get the participant stub for the test.
+ * @return The participant stub.
+ */
+ private ParticipantStub getParticipantStub()
+ {
+ return (getAsyncTest() ? AsyncParticipantStub.getParticipantStub() : SyncParticipantStub.getParticipantStub()) ;
+ }
+
+ static
+ {
+ final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+ SOURCE_PARTICIPANT_URI = soapRegistry.getServiceURI(InteropConstants.SERVICE_PARTICIPANT) ;
+ SOURCE_COORDINATOR_URI = soapRegistry.getServiceURI(CoordinationConstants.SERVICE_ACTIVATION_COORDINATOR) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/BATestCase.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/InteropTestCase.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/InteropTestCase.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/InteropTestCase.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,162 @@
+package com.jboss.transaction.txinterop.interop;
+
+import junit.framework.TestCase;
+import junit.framework.TestResult;
+
+import com.jboss.transaction.txinterop.proxy.ProxyConversation;
+
+/**
+ * Base class for interop tests.
+ * @author kevin
+ */
+public class InteropTestCase extends TestCase
+{
+ /**
+ * The log message prefix start.
+ */
+ private static final String LOG_MESSAGE_PREFIX_START = "<log:message testcase=\"" ;
+ /**
+ * The log message prefix centre.
+ */
+ private static final String LOG_MESSAGE_PREFIX_CENTRE = "\" message=\"" ;
+ /**
+ * The log message prefix end.
+ */
+ private static final String LOG_MESSAGE_PREFIX_END = "\"><log:content>" ;
+ /**
+ * The log message suffix.
+ */
+ private static final String LOG_MESSAGE_SUFFIX = "</log:content></log:message>" ;
+
+ /**
+ * The URI of the participant.
+ */
+ private String participantURI ;
+
+ /**
+ * The conversation id for the test.
+ */
+ private String conversationId ;
+
+ /**
+ * The test timeout value.
+ */
+ private long testTimeout ;
+ /**
+ * The asynchronous test flag.
+ */
+ private boolean asyncTest ;
+
+ /**
+ * Set the participant URI.
+ * @param serviceURI The participant URI.
+ */
+ public void setParticipantURI(final String participantURI)
+ {
+ this.participantURI = participantURI ;
+ }
+
+ /**
+ * Get the participant URI.
+ * @return The participant URI.
+ */
+ protected String getParticipantURI()
+ {
+ return participantURI ;
+ }
+
+ /**
+ * Set the test timeout value.
+ * testTimeout The test timeout value.
+ */
+ public void setTestTimeout(final long testTimeout)
+ {
+ this.testTimeout = testTimeout ;
+ }
+
+ /**
+ * Get the asynchronous test flag.
+ * @return The asynchronous test flag.
+ */
+ protected boolean getAsyncTest()
+ {
+ return asyncTest ;
+ }
+
+ /**
+ * Set the asynchronous test flag.
+ * asyncTest The asynchronous test flag.
+ */
+ public void setAsyncTest(final boolean asyncTest)
+ {
+ this.asyncTest = asyncTest ;
+ }
+
+ /**
+ * Get the test timeout value.
+ * @return The test timeout value.
+ */
+ protected long getTestTimeout()
+ {
+ return testTimeout ;
+ }
+
+ /**
+ * Get the conversation id.
+ * @return The conversation id.
+ */
+ protected String getConversationId()
+ {
+ return conversationId ;
+ }
+
+ /**
+ * Wraps the run method to include logging of message interactions.
+ * @param result The test result.
+ */
+ public void run(final TestResult result)
+ {
+ // get a conversation id, start the log, clear it on finish.
+ conversationId = ProxyConversation.createConversation() ;
+ try
+ {
+ super.run(result) ;
+ }
+ finally
+ {
+ final String[] messages = ProxyConversation.removeConversation(conversationId) ;
+ conversationId = null ;
+ if (messages != null)
+ {
+ final int numMessages = messages.length ;
+ final StringBuffer buffer = new StringBuffer() ;
+ int count = 0 ;
+ while(count < numMessages)
+ {
+ final String message = messages[count] ;
+ count++ ;
+ if (message != null)
+ {
+ buffer.append(LOG_MESSAGE_PREFIX_START) ;
+ buffer.append(getName()) ;
+ buffer.append(LOG_MESSAGE_PREFIX_CENTRE) ;
+ buffer.append(count) ;
+ buffer.append(LOG_MESSAGE_PREFIX_END) ;
+ buffer.append(message) ;
+ buffer.append(LOG_MESSAGE_SUFFIX) ;
+ }
+ }
+ MessageLogging.appendThreadLog(buffer.toString()) ;
+ }
+ }
+ }
+
+ /**
+ * Return the string represenation of this test.
+ * @return the string representation.
+ */
+ public String toString()
+ {
+ return getName() ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/InteropTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/InteropTestSuite.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/InteropTestSuite.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/InteropTestSuite.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,111 @@
+package com.jboss.transaction.txinterop.interop;
+
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Interop testsuite to initialise the participant uri on addition.
+ * @author kevin
+ */
+public class InteropTestSuite extends TestSuite
+{
+ /**
+ * The participant URI for this test.
+ */
+ private final String participantURI ;
+ /**
+ * The test timeout.
+ */
+ private final long testTimeout ;
+ /**
+ * The asynchronous test flag.
+ */
+ private final boolean asyncTest ;
+
+ /**
+ * Construct an empty test suite with the specified participant URI.
+ * @param testTimeout The test timeout.
+ * @param participantURI The participant URI.
+ */
+ public InteropTestSuite(final String participantURI, final long testTimeout, final boolean asyncTest)
+ {
+ super() ;
+ this.participantURI = participantURI ;
+ this.testTimeout = testTimeout ;
+ this.asyncTest = asyncTest ;
+ }
+
+ /**
+ * Construct an empty test suite with the specified participant URI and name.
+ * @param participantURI The participant URI.
+ * @param testTimeout The test timeout.
+ * @param name The name of the test suite.
+ */
+ public InteropTestSuite(final String participantURI, final long testTimeout, final boolean asyncTest, final String name)
+ {
+ super(name) ;
+ this.participantURI = participantURI ;
+ this.testTimeout = testTimeout ;
+ this.asyncTest = asyncTest ;
+ }
+
+ /**
+ * Constructs a TestSuite from the given class using the specified participant URI.
+ * @param participantURI The participant URI.
+ * @param testTimeout The test timeout.
+ * @param clazz The class containing the tests.
+ */
+ public InteropTestSuite(final String participantURI, final long testTimeout, final boolean asyncTest, final Class clazz)
+ {
+ super(clazz) ;
+ this.participantURI = participantURI ;
+ this.testTimeout = testTimeout ;
+ this.asyncTest = asyncTest ;
+ final int numTests = countTestCases() ;
+ for(int count = 0 ; count < numTests ; count++)
+ {
+ initialiseTest(testAt(count)) ;
+ }
+ }
+
+ /**
+ * Constructs a TestSuite from the given class using the specified participant URI and name.
+ * @param participantURI The participant URI.
+ * @param testTimeout The test timeout.
+ * @param clazz The class containing the tests.
+ * @param name The name of the test suite.
+ */
+ public InteropTestSuite(final String participantURI, final long testTimeout, final boolean asyncTest, final Class clazz, final String name)
+ {
+ super(clazz, name) ;
+ this.participantURI = participantURI ;
+ this.testTimeout = testTimeout ;
+ this.asyncTest = asyncTest ;
+ }
+
+ /**
+ * Add a test to the test suite.
+ * @param test The test to add.
+ */
+ public void addTest(final Test test)
+ {
+ initialiseTest(test) ;
+ super.addTest(test) ;
+ }
+
+ /**
+ * Perform initialisation on the test.
+ * @param test The test to initialise.
+ */
+ private void initialiseTest(final Test test)
+ {
+ if (test instanceof InteropTestCase)
+ {
+ final InteropTestCase interopTestCase = (InteropTestCase)test ;
+ interopTestCase.setParticipantURI(participantURI) ;
+ interopTestCase.setTestTimeout(testTimeout) ;
+ interopTestCase.setAsyncTest(asyncTest) ;
+ }
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/InteropTestSuite.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/MessageLogging.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/MessageLogging.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/MessageLogging.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,51 @@
+package com.jboss.transaction.txinterop.interop;
+
+/**
+ * Class providing test message logging.
+ * @author kevin
+ */
+public class MessageLogging
+{
+ /**
+ * The thread local message log.
+ */
+ private static final ThreadLocal MESSAGE_LOG = new ThreadLocal() ;
+
+ /**
+ * 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() ;
+ return (value == null ? "" : value.toString()) ;
+ }
+
+ /**
+ * 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 StringBuffer buffer ;
+ if (value == null)
+ {
+ buffer = new StringBuffer(message) ;
+ MESSAGE_LOG.set(buffer) ;
+ }
+ else
+ {
+ buffer = (StringBuffer)value ;
+ buffer.append(message) ;
+ }
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/MessageLogging.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropPreparedAfterTimeoutState.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropPreparedAfterTimeoutState.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropPreparedAfterTimeoutState.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,70 @@
+package com.jboss.transaction.txinterop.interop.states;
+
+import com.arjuna.webservices.wsat11.AtomicTransactionConstants;
+
+/**
+ * A conversation state for prepare after timeout test.
+ */
+public class ATInteropPreparedAfterTimeoutState extends BaseState
+{
+ /**
+ * The prepared count.
+ */
+ private int preparedCount ;
+ /**
+ * The rollback count.
+ */
+ private int rollbackCount ;
+ /**
+ * Are we dropping other messages?
+ */
+ private boolean drop ;
+ /**
+ * Aborted flag.
+ */
+ private boolean aborted ;
+ /**
+ * Soap Fault flag.
+ */
+ private boolean soapFault ;
+
+ /**
+ * Handle the next action in the sequence.
+ * @param action The SOAP action.
+ * @param identifier The identifier associated with the endpoint.
+ * @return true if the message should be dropped, false otherwise.
+ */
+ public boolean handleAction(final String action, final String identifier)
+ {
+ if (AtomicTransactionConstants.WSAT_ACTION_PREPARED.equals(action))
+ {
+ if (++preparedCount == 2)
+ {
+ drop = true ;
+ }
+ }
+ else if (AtomicTransactionConstants.WSAT_ACTION_ROLLBACK.equals(action))
+ {
+ if (++rollbackCount == 2)
+ {
+ drop = false ;
+ return true ;
+ }
+ }
+ else if (AtomicTransactionConstants.WSAT_ACTION_ABORTED.equals(action))
+ {
+ aborted = true ;
+ }
+ else if (AtomicTransactionConstants.WSAT_ACTION_FAULT.equals(action))
+ {
+ soapFault = true ;
+ }
+
+ if (aborted && soapFault)
+ {
+ success() ;
+ }
+
+ return drop ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropPreparedAfterTimeoutState.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropRetryPreparedAbortState.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropRetryPreparedAbortState.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropRetryPreparedAbortState.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,51 @@
+package com.jboss.transaction.txinterop.interop.states;
+
+import com.arjuna.webservices.wsat11.AtomicTransactionConstants;
+
+/**
+ * A conversation state for retry prepared abort test.
+ */
+public class ATInteropRetryPreparedAbortState extends BaseState
+{
+ /**
+ * Have we had the first prepare?
+ */
+ private boolean firstPrepare ;
+ /**
+ * Are we dropping other messages?
+ */
+ private boolean drop ;
+
+ /**
+ * Handle the next action in the sequence.
+ * @param action The SOAP action.
+ * @param identifier The identifier associated with the endpoint.
+ * @return true if the message should be dropped, false otherwise.
+ */
+ public boolean handleAction(final String action, final String identifier)
+ {
+ if (AtomicTransactionConstants.WSAT_ACTION_PREPARE.equals(action))
+ {
+ if (!firstPrepare)
+ {
+ firstPrepare = true ;
+ drop = true ;
+ return false ;
+ }
+ return true ;
+ }
+ if (AtomicTransactionConstants.WSAT_ACTION_ROLLBACK.equals(action))
+ {
+ if (drop)
+ {
+ drop = false ;
+ return true ;
+ }
+ }
+ else if (AtomicTransactionConstants.WSAT_ACTION_ABORTED.equals(action))
+ {
+ success() ;
+ }
+ return drop ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropRetryPreparedAbortState.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropRetryPreparedCommitState.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropRetryPreparedCommitState.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropRetryPreparedCommitState.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,60 @@
+package com.jboss.transaction.txinterop.interop.states;
+
+import com.arjuna.webservices.wsat11.AtomicTransactionConstants;
+
+/**
+ * A conversation state for retry prepared commit state.
+ */
+public class ATInteropRetryPreparedCommitState extends BaseState
+{
+ /**
+ * The prepared count.
+ */
+ private int preparedCount ;
+ /**
+ * The committed count.
+ */
+ private int committedCount ;
+ /**
+ * The first identifier.
+ */
+ private String firstIdentifier ;
+ /**
+ * Are we dropping other messages?
+ */
+ private boolean drop ;
+
+ /**
+ * Handle the next action in the sequence.
+ * @param action The SOAP action.
+ * @param identifier The identifier associated with the endpoint.
+ * @return true if the message should be dropped, false otherwise.
+ */
+ public boolean handleAction(final String action, final String identifier)
+ {
+ if (AtomicTransactionConstants.WSAT_ACTION_PREPARED.equals(action))
+ {
+ preparedCount++ ;
+ if (preparedCount == 1)
+ {
+ firstIdentifier = identifier ;
+ }
+ else if (preparedCount == 2)
+ {
+ drop = true ;
+ }
+ else if (firstIdentifier.equals(identifier))
+ {
+ drop = false ;
+ }
+ }
+ else if (AtomicTransactionConstants.WSAT_ACTION_COMMITTED.equals(action))
+ {
+ if (++committedCount == 2)
+ {
+ success() ;
+ }
+ }
+ return drop ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/ATInteropRetryPreparedCommitState.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/BAInteropDroppedParticipantCompletedState.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/BAInteropDroppedParticipantCompletedState.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/BAInteropDroppedParticipantCompletedState.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,89 @@
+package com.jboss.transaction.txinterop.interop.states;
+
+import com.arjuna.webservices.wsba11.BusinessActivityConstants;
+
+
+/**
+ * A conversation state for waiting on participant completed.
+ */
+public class BAInteropDroppedParticipantCompletedState extends BaseState
+{
+ /**
+ * The last action.
+ */
+ private final String lastAction ;
+ /**
+ * The participant completed flag.
+ */
+ private boolean participantCompleted ;
+
+ /**
+ * Construct the participant completed test.
+ * @param lastAction The last action.
+ */
+ public BAInteropDroppedParticipantCompletedState(final String lastAction)
+ {
+ this.lastAction = lastAction ;
+ }
+
+ /**
+ * Handle the next action in the sequence.
+ * @param action The SOAP action.
+ * @param identifier The identifier associated with the endpoint.
+ * @return true if the message should be dropped, false otherwise.
+ */
+ public synchronized boolean handleAction(final String action, final String identifier)
+ {
+ if (!participantCompleted && BusinessActivityConstants.WSBA_ACTION_COMPLETED.equals(action))
+ {
+ participantCompleted = true ;
+ notifyAll() ;
+ return true ;
+ }
+ else if (participantCompleted && lastAction.equals(action))
+ {
+ success() ;
+ }
+ return false ;
+ }
+
+ /**
+ * Wait for the participant to complete.
+ * @param timeout The timeout.
+ * @return true if the participant has completed, false otherwise.
+ */
+ public boolean waitForParticipantCompleted(final long timeout)
+ {
+ final long endTime = System.currentTimeMillis() + timeout ;
+ final boolean result ;
+ synchronized(this)
+ {
+ while(!participantCompleted)
+ {
+ final long currentTimeout = endTime - System.currentTimeMillis() ;
+ if (currentTimeout <= 0)
+ {
+ break ;
+ }
+ try
+ {
+ wait(currentTimeout) ;
+ }
+ catch (final InterruptedException ie) {}
+ }
+
+ result = participantCompleted ;
+ }
+
+ if (result)
+ {
+ // If it is completd then wait to allow processing of message.
+ try
+ {
+ Thread.sleep(2000) ;
+ }
+ catch (final InterruptedException ie) {}
+ }
+ return result ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/BAInteropDroppedParticipantCompletedState.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/BAInteropParticipantCompletedState.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/BAInteropParticipantCompletedState.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/BAInteropParticipantCompletedState.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,88 @@
+package com.jboss.transaction.txinterop.interop.states;
+
+import com.arjuna.webservices.wsba11.BusinessActivityConstants;
+
+
+/**
+ * A conversation state for waiting on participant completed.
+ */
+public class BAInteropParticipantCompletedState extends BaseState
+{
+ /**
+ * The last action.
+ */
+ private final String lastAction ;
+ /**
+ * The participant completed flag.
+ */
+ private boolean participantCompleted ;
+
+ /**
+ * Construct the participant completed test.
+ * @param lastAction The last action.
+ */
+ public BAInteropParticipantCompletedState(final String lastAction)
+ {
+ this.lastAction = lastAction ;
+ }
+
+ /**
+ * Handle the next action in the sequence.
+ * @param action The SOAP action.
+ * @param identifier The identifier associated with the endpoint.
+ * @return true if the message should be dropped, false otherwise.
+ */
+ public synchronized boolean handleAction(final String action, final String identifier)
+ {
+ if (BusinessActivityConstants.WSBA_ACTION_COMPLETED.equals(action))
+ {
+ participantCompleted = true ;
+ notifyAll() ;
+ }
+ else if (participantCompleted && lastAction.equals(action))
+ {
+ success() ;
+ }
+ return false ;
+ }
+
+ /**
+ * Wait for the participant to complete.
+ * @param timeout The timeout.
+ * @return true if the participant has completed, false otherwise.
+ */
+ public boolean waitForParticipantCompleted(final long timeout)
+ {
+ final long endTime = System.currentTimeMillis() + timeout ;
+ final boolean result ;
+ synchronized(this)
+ {
+ while(!participantCompleted)
+ {
+ final long currentTimeout = endTime - System.currentTimeMillis() ;
+ if (currentTimeout <= 0)
+ {
+ break ;
+ }
+ try
+ {
+ wait(currentTimeout) ;
+ }
+ catch (final InterruptedException ie) {}
+ }
+
+ result = participantCompleted ;
+ }
+
+ if (result)
+ {
+ // If it is completd then wait to allow processing of message.
+ try
+ {
+ Thread.sleep(2000) ;
+ }
+ catch (final InterruptedException ie) {}
+ }
+ return result ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/BAInteropParticipantCompletedState.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/BAInteropUnsolicitedCompleteState.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/BAInteropUnsolicitedCompleteState.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/BAInteropUnsolicitedCompleteState.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,103 @@
+package com.jboss.transaction.txinterop.interop.states;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+
+import com.arjuna.webservices.wsba11.BusinessActivityConstants;
+import com.arjuna.webservices.wscoor11.CoordinationConstants;
+import com.jboss.transaction.txinterop.proxy.BaseHandler;
+
+
+/**
+ * A conversation state for unsolicited complete.
+ */
+public class BAInteropUnsolicitedCompleteState extends InteropWaitState
+{
+ /**
+ * The replaced flag.
+ */
+ private boolean replaced ;
+
+ /**
+ * Construct the unsolicited complete state.
+ */
+ public BAInteropUnsolicitedCompleteState()
+ {
+ super(CoordinationConstants.WSCOOR_ACTION_FAULT) ;
+ }
+
+ /**
+ * Get the Handler for rewriting the XML.
+ * @param nextHandler The next handler in the sequence.
+ * @return The handler or null if no rewriting required.
+ */
+ public ContentHandler getHandler(final ContentHandler nextHandler)
+ {
+ return (replaced ? null : new RegistrationHandler(nextHandler)) ;
+ }
+
+ /**
+ * The registration handler.
+ */
+ private final class RegistrationHandler extends BaseHandler
+ {
+ /**
+ * The 'in register' flag.
+ */
+ private boolean inRegister ;
+ /**
+ * The 'in protocol identifier' flag.
+ */
+ private boolean inProtocolIdentifier ;
+
+ /**
+ * Construct the registration handler.
+ * @param nextHandler The next handler.
+ */
+ RegistrationHandler(final ContentHandler nextHandler)
+ {
+ super(nextHandler) ;
+ }
+
+ public void startElement(final String uri, final String localName, final String qName, final Attributes attributes)
+ throws SAXException
+ {
+ if (CoordinationConstants.WSCOOR_NAMESPACE.equals(uri) && CoordinationConstants.WSCOOR_ELEMENT_REGISTER.equals(localName))
+ {
+ inRegister = true ;
+ }
+ else if (inRegister && CoordinationConstants.WSCOOR_NAMESPACE.equals(uri) && CoordinationConstants.WSCOOR_ELEMENT_PROTOCOL_IDENTIFIER.equals(localName))
+ {
+ inProtocolIdentifier = true ;
+ }
+ super.startElement(uri, localName, qName, attributes);
+ }
+
+ public void endElement(final String uri, final String localName, final String qName)
+ throws SAXException
+ {
+ if (inProtocolIdentifier && CoordinationConstants.WSCOOR_NAMESPACE.equals(uri) && CoordinationConstants.WSCOOR_ELEMENT_PROTOCOL_IDENTIFIER.equals(localName))
+ {
+ inProtocolIdentifier = false ;
+ final char[] chars = BusinessActivityConstants.WSBA_SUB_PROTOCOL_COORDINATOR_COMPLETION.toCharArray() ;
+ getNextHandler().characters(chars, 0, chars.length) ;
+ }
+ else if (inRegister && CoordinationConstants.WSCOOR_NAMESPACE.equals(uri) && CoordinationConstants.WSCOOR_ELEMENT_REGISTER.equals(localName))
+ {
+ inRegister = false ;
+ }
+ super.endElement(uri, localName, qName);
+ }
+
+ public void characters(final char[] chars, final int start, final int length)
+ throws SAXException
+ {
+ if (!inProtocolIdentifier)
+ {
+ super.characters(chars, start, length);
+ }
+ }
+
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/BAInteropUnsolicitedCompleteState.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/BaseState.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/BaseState.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/BaseState.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,97 @@
+package com.jboss.transaction.txinterop.interop.states;
+
+import org.xml.sax.ContentHandler;
+
+import com.jboss.transaction.txinterop.proxy.ProxyConversationState;
+
+/**
+ * The base state class for proxy conversations.
+ */
+abstract class BaseState implements ProxyConversationState
+{
+ /**
+ * The complete flag.
+ */
+ private boolean complete ;
+ /**
+ * The success flag.
+ */
+ private boolean success ;
+
+ /**
+ * Mark the conversation as successfully completed.
+ */
+ protected synchronized void success()
+ {
+ if (!complete)
+ {
+ System.out.println("KEV: success!") ;
+ complete = true ;
+ success = true ;
+ notifyAll() ;
+ }
+ else
+ {
+ System.out.println("KEV: AAAAAARRRRRRRGGGGGGGHHHHHHHHH, multiple successes called for conversation!") ;
+ }
+ }
+
+ /**
+ * Wait a specified period for the conversation to complete.
+ * @param timeout The timeout period of the conversation.
+ */
+ public synchronized void waitForCompletion(final long timeout)
+ {
+ if (!complete && (timeout > 0))
+ {
+ final long end = System.currentTimeMillis() + timeout ;
+ do
+ {
+ final long delay = end - System.currentTimeMillis() ;
+ if (delay > 0)
+ {
+ try
+ {
+ wait(delay) ;
+ }
+ catch (final InterruptedException ie) {} // ignore
+ }
+ else
+ {
+ break ;
+ }
+ }
+ while(!complete) ;
+ }
+
+ complete = true ;
+ }
+
+ /**
+ * Has the conversation complete?
+ * @return true if the conversation has complete, false otherwise.
+ */
+ public synchronized boolean isComplete()
+ {
+ return complete ;
+ }
+
+ /**
+ * Was the conversation successful?
+ * @return true if the conversation was successful, false otherwise.
+ */
+ public synchronized boolean isSuccessful()
+ {
+ return success ;
+ }
+
+ /**
+ * Get the Handler for rewriting the XML.
+ * @param nextHandler The next handler in the sequence.
+ * @return The handler or null if no rewriting required.
+ */
+ public ContentHandler getHandler(final ContentHandler nextHandler)
+ {
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/BaseState.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/InteropWaitState.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/InteropWaitState.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/InteropWaitState.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,54 @@
+package com.jboss.transaction.txinterop.interop.states;
+
+/**
+ * A conversation state that waits for a specified action before completing.
+ */
+public class InteropWaitState extends BaseState
+{
+ /**
+ * The last action.
+ */
+ private final String lastAction ;
+ /**
+ * The action count.
+ */
+ private int count ;
+
+ /**
+ * Construct the conversation state.
+ * @param lastAction The last action of the conversation.
+ */
+ public InteropWaitState(final String lastAction)
+ {
+ this(lastAction, 1) ;
+ }
+
+ /**
+ * Construct the conversation state.
+ * @param lastAction The last action of the conversation.
+ * @param count The occurrance to trigger on.
+ */
+ public InteropWaitState(final String lastAction, final int count)
+ {
+ this.lastAction = lastAction ;
+ this.count = count ;
+ }
+
+ /**
+ * Handle the next action in the sequence.
+ * @param action The SOAP action.
+ * @param identifier The identifier associated with the endpoint.
+ * @return true if the message should be dropped, false otherwise.
+ */
+ public boolean handleAction(final String action, final String identifier)
+ {
+ if (lastAction.equals(action))
+ {
+ if (--count == 0)
+ {
+ success() ;
+ }
+ }
+ return false ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/interop/states/InteropWaitState.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/AddressingProxySAXHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/AddressingProxySAXHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/AddressingProxySAXHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,176 @@
+/*
+ * Created on 20-Jan-2005
+ */
+package com.jboss.transaction.txinterop.proxy;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+
+import com.arjuna.webservices.wsaddr2005.AddressingConstants;
+import com.arjuna.webservices.wsjboss.JBossConstants;
+
+/**
+ * Sax parser for rewriting the XML via the proxy.
+ * @author kevin
+ */
+public class AddressingProxySAXHandler extends BaseHandler
+{
+ /**
+ * The WS-Addressing namespace URI.
+ */
+ private static final String WSA_NAMESPACE_URI = AddressingConstants.WSA_NAMESPACE ;
+ /**
+ * The WS-Addressing To element.
+ */
+ private static final String WSA_ELEMENT_TO = AddressingConstants.WSA_ELEMENT_TO ;
+ /**
+ * The WS-Addressing Address element.
+ */
+ private static final String WSA_ELEMENT_ADDRESS = AddressingConstants.WSA_ELEMENT_ADDRESS ;
+
+ /**
+ * Are we in a rewrite element?
+ */
+ private boolean inRewriteElement ;
+ /**
+ * Are we in a to element?
+ */
+ private boolean inToElement ;
+ /**
+ * Are we in an identifier element?
+ */
+ private boolean inIdentifierElement ;
+ /**
+ * The to address.
+ */
+ private String toAddress ;
+ /**
+ * The identifier.
+ */
+ private String identifier ;
+ /**
+ * The string buffer for text element content.
+ */
+ private StringBuffer characterContent = new StringBuffer() ;
+
+ /**
+ * The current conversation identifier.
+ */
+ private final String conversationIdentifier ;
+
+ /**
+ * Construct the SAX handler with the output writer.
+ * @param nextHandler The next content handler.
+ * @param conversationIdentifier The conversation identifier.
+ */
+ public AddressingProxySAXHandler(final ContentHandler nextHandler, final String conversationIdentifier)
+ {
+ super(nextHandler) ;
+ this.conversationIdentifier = conversationIdentifier ;
+ }
+
+ /**
+ * Start an element.
+ * @param uri The uri.
+ * @param localName The local name.
+ * @param qName The qualified name.
+ * @param attributes The element attributes.
+ * @throws SAXException for any errors.
+ */
+ public void startElement(final String uri, final String localName, final String qName,
+ final Attributes attributes)
+ throws SAXException
+ {
+ if (WSA_NAMESPACE_URI.equals(uri))
+ {
+ if (WSA_ELEMENT_ADDRESS.equals(localName))
+ {
+ inRewriteElement = true ;
+ }
+ else if (WSA_ELEMENT_TO.equals(localName))
+ {
+ inRewriteElement = true ;
+ inToElement = true ;
+ }
+ }
+ else if (JBossConstants.WSJBOSS_NAMESPACE.equals(uri) && JBossConstants.WSJBOSS_ELEMENT_INSTANCE_IDENTIFIER.equals(localName)
+ && (attributes.getValue(WSA_NAMESPACE_URI, AddressingConstants.WSA_ATTRIBUTE_IS_REFERENCE_PARAMETER) != null))
+ {
+ inIdentifierElement = true ;
+ }
+
+ getNextHandler().startElement(uri, localName, qName, attributes) ;
+ }
+
+ /**
+ * End an element.
+ * @param uri The uri.
+ * @param localName The local name.
+ * @param qName The qualified name.
+ * @throws SAXException for any errors.
+ */
+ public void endElement(final String uri, final String localName, final String qName)
+ throws SAXException
+ {
+ if (characterContent.length() > 0)
+ {
+ if (inRewriteElement)
+ {
+ final String newValue = ProxyURIRewriting.rewriteURI(conversationIdentifier, characterContent.toString().trim()) ;
+ getNextHandler().characters(newValue.toCharArray(), 0, newValue.length()) ;
+ if (inToElement)
+ {
+ toAddress = newValue ;
+ }
+ }
+ else if (inIdentifierElement)
+ {
+ identifier = characterContent.toString() ;
+ getNextHandler().characters(identifier.toCharArray(), 0, identifier.length()) ;
+ }
+ characterContent.setLength(0) ;
+ }
+ getNextHandler().endElement(uri, localName, qName) ;
+ inRewriteElement = false ;
+ inToElement = false ;
+ }
+
+ /**
+ * Process character text.
+ * @param chars The character array.
+ * @param start The start index.
+ * @param length The length of this section.
+ * @throws SAXException for any errors.
+ */
+ public void characters(char[] chars, int start, int length)
+ throws SAXException
+ {
+ if (inRewriteElement || inIdentifierElement)
+ {
+ characterContent.append(chars, start, length) ;
+ }
+ else
+ {
+ getNextHandler().characters(chars, start, length) ;
+ }
+ }
+
+ /**
+ * Return the to address from the processing.
+ * @return The to address.
+ */
+ public String getToAddress()
+ {
+ return toAddress ;
+ }
+
+ /**
+ * Return the identifier from the processing.
+ * @return The identifier.
+ */
+ public String getIdentifier()
+ {
+ return identifier ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/AddressingProxySAXHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/BaseHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/BaseHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/BaseHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,167 @@
+/*
+ * Created on 20-Jan-2005
+ */
+package com.jboss.transaction.txinterop.proxy;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+
+/**
+ * Sax parser for rewriting the XML via the proxy.
+ * @author kevin
+ */
+public class BaseHandler implements ContentHandler
+{
+ /**
+ * The next handler in the sequence.
+ */
+ private final ContentHandler nextHandler ;
+
+ /**
+ * Construct the base handler.
+ * @param nextHandler The next content handler.
+ */
+ protected BaseHandler(final ContentHandler nextHandler)
+ {
+ this.nextHandler = nextHandler ;
+ }
+
+ /**
+ * Set the document locator.
+ * @param locator The document locator.
+ */
+ public void setDocumentLocator(final Locator locator)
+ {
+ nextHandler.setDocumentLocator(locator) ;
+ }
+
+ /**
+ * Handle the procesing instruction.
+ * @param target The pi target.
+ * @param data The pi data.
+ * @throws SAXException for any errors.
+ */
+ public void processingInstruction(final String target, final String data)
+ throws SAXException
+ {
+ nextHandler.processingInstruction(target, data) ;
+ }
+
+ /**
+ * Start the document.
+ * @throws SAXException for any errors.
+ */
+ public void startDocument()
+ throws SAXException
+ {
+ nextHandler.startDocument() ;
+ }
+
+ /**
+ * End the document.
+ * @throws SAXException for any errors.
+ */
+ public void endDocument()
+ throws SAXException
+ {
+ nextHandler.endDocument() ;
+ }
+
+ /**
+ * Start a prefix mapping.
+ * @param prefix The namespace prefix.
+ * @param uri The namespace uri.
+ * @throws SAXException for any errors.
+ */
+ public void startPrefixMapping(final String prefix, final String uri)
+ throws SAXException
+ {
+ nextHandler.startPrefixMapping(prefix, uri) ;
+ }
+
+ /**
+ * End the prefix mapping.
+ * @param prefix The namespace prefix.
+ * @throws SAXException for any errors.
+ */
+ public void endPrefixMapping(final String prefix)
+ throws SAXException
+ {
+ nextHandler.endPrefixMapping(prefix) ;
+ }
+
+ /**
+ * Start an element.
+ * @param uri The uri.
+ * @param localName The local name.
+ * @param qName The qualified name.
+ * @param attributes The element attributes.
+ * @throws SAXException for any errors.
+ */
+ public void startElement(final String uri, final String localName, final String qName,
+ final Attributes attributes)
+ throws SAXException
+ {
+ nextHandler.startElement(uri, localName, qName, attributes) ;
+ }
+
+ /**
+ * End an element.
+ * @param uri The uri.
+ * @param localName The local name.
+ * @param qName The qualified name.
+ * @throws SAXException for any errors.
+ */
+ public void endElement(final String uri, final String localName, final String qName)
+ throws SAXException
+ {
+ nextHandler.endElement(uri, localName, qName) ;
+ }
+
+ /**
+ * Process character text.
+ * @param chars The character array.
+ * @param start The start index.
+ * @param length The length of this section.
+ * @throws SAXException for any errors.
+ */
+ public void characters(char[] chars, int start, int length)
+ throws SAXException
+ {
+ nextHandler.characters(chars, start, length) ;
+ }
+
+ /**
+ * Process ignorable white space.
+ * @param chars The character array.
+ * @param start The start index.
+ * @param length The length of this section.
+ * @throws SAXException for any errors.
+ */
+ public void ignorableWhitespace(char[] chars, int start, int length)
+ throws SAXException
+ {
+ nextHandler.ignorableWhitespace(chars, start, length) ;
+ }
+
+ /**
+ * Skip an entity.
+ * @throws SAXException for any errors.
+ */
+ public void skippedEntity(final String name)
+ throws SAXException
+ {
+ nextHandler.skippedEntity(name) ;
+ }
+
+ /**
+ * Get the next handler.
+ * @return The next handler.
+ */
+ protected final ContentHandler getNextHandler()
+ {
+ return nextHandler ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/BaseHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/ProxyConversation.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/ProxyConversation.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/ProxyConversation.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,145 @@
+package com.jboss.transaction.txinterop.proxy;
+
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.TreeMap;
+
+/**
+ * Message logging via the proxy.
+ */
+public class ProxyConversation
+{
+ /**
+ * The conversation id.
+ */
+ private static int currentConversationId ;
+ /**
+ * The conversation map.
+ */
+ private static Map conversationMap = new TreeMap() ;
+ /**
+ * The conversation state map.
+ */
+ private static Map conversationStateMap = new TreeMap() ;
+
+ /**
+ * The marker for an internal id.
+ */
+ private static final char INTERNAL_ID = 'c' ;
+ /**
+ * The marker for an external id.
+ */
+ private static final char EXTERNAL_ID = 'C' ;
+
+ /**
+ * Create a conversation.
+ * @return The id of the conversation.
+ */
+ public static synchronized String createConversation()
+ {
+ final String conversationId = INTERNAL_ID + Integer.toString(++currentConversationId) ;
+ conversationMap.put(mapConversationId(conversationId), new ArrayList()) ;
+System.out.println("KEV: created conversation " + conversationId) ;
+ return conversationId ;
+ }
+
+ /**
+ * Remove the conversation.
+ * @param conversationId The conversation id.
+ * @return The conversation messages in sequence.
+ */
+ public static synchronized String[] removeConversation(final String conversationId)
+ {
+ final ArrayList list = (ArrayList)conversationMap.remove(mapConversationId(conversationId)) ;
+System.out.println("KEV: removed conversation " + conversationId) ;
+ return (list == null ? new String[0] : (String[])list.toArray(new String[list.size()])) ;
+ }
+
+ /**
+ * Append a message to the conversation.
+ * @param conversationId The conversation id.
+ * @param message The message to append to the conversation.
+ */
+ public static synchronized void appendConversation(final String conversationId, final String message)
+ {
+ final ArrayList list = (ArrayList)conversationMap.get(mapConversationId(conversationId)) ;
+ if (list != null)
+ {
+ list.add(message) ;
+ }
+ }
+
+ /**
+ * Set the conversation state for the specified conversation.
+ * @param conversationId The conversation id.
+ * @param conversationState The conversation state.
+ */
+ public static synchronized void setConversationState(final String conversationId, final ProxyConversationState conversationState)
+ {
+ conversationStateMap.put(mapConversationId(conversationId), conversationState) ;
+ }
+
+ /**
+ * Get the conversation state for the specified conversation.
+ * @param conversationId The conversation id.
+ * @return The conversation state or null.
+ */
+ public static synchronized ProxyConversationState getConversationState(final String conversationId)
+ {
+ return (ProxyConversationState)conversationStateMap.get(mapConversationId(conversationId)) ;
+ }
+
+ /**
+ * Clear the conversation state for the specified conversation.
+ * @param conversationId The conversation id.
+ */
+ public static synchronized void clearConversationState(final String conversationId)
+ {
+ conversationStateMap.remove(mapConversationId(conversationId)) ;
+ }
+
+ /**
+ * Is the conversation id an internal id?
+ * @param conversationId The conversation id.
+ * @return True if the conversation id is internal, false if it is external.
+ */
+ public static boolean isInternalConversationId(final String conversationId)
+ {
+ return ((conversationId != null) && (conversationId.length() != 0) && (conversationId.charAt(0) == INTERNAL_ID)) ;
+ }
+
+ /**
+ * Get the alternate conversation id.
+ * @param conversationId The current conversation id.
+ * @return The alternate conversation id.
+ */
+ public static String getAlternateConversationId(final String conversationId)
+ {
+ if ((conversationId == null) || (conversationId.length() == 0))
+ {
+ return conversationId ;
+ }
+ if (conversationId.charAt(0) == INTERNAL_ID)
+ {
+ return EXTERNAL_ID + mapConversationId(conversationId) ;
+ }
+ else
+ {
+ return INTERNAL_ID + mapConversationId(conversationId) ;
+ }
+ }
+
+ /**
+ * Get the map conversation id.
+ * @param conversationId The full conversation id.
+ * @return The conversation id for the map.
+ */
+ private static String mapConversationId(final String conversationId)
+ {
+ if ((conversationId == null) || (conversationId.length() == 0))
+ {
+ return conversationId ;
+ }
+ return conversationId.substring(1) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/ProxyConversation.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/ProxyConversationState.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/ProxyConversationState.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/ProxyConversationState.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,24 @@
+package com.jboss.transaction.txinterop.proxy;
+
+import org.xml.sax.ContentHandler;
+
+/**
+ * Interface representing a conversation state.
+ */
+public interface ProxyConversationState
+{
+ /**
+ * Handle the next action in the sequence.
+ * @param action The SOAP action.
+ * @param identifier The identifier associated with the endpoint.
+ * @return true if the message should be dropped, false otherwise.
+ */
+ public boolean handleAction(final String action, final String identifier) ;
+
+ /**
+ * Get the Handler for rewriting the XML.
+ * @param nextHandler The next handler in the sequence.
+ * @return The handler or null if no rewriting required.
+ */
+ public ContentHandler getHandler(final ContentHandler nextHandler) ;
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/ProxyConversationState.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/ProxyListenerService.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/ProxyListenerService.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/ProxyListenerService.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,392 @@
+/*
+ * Copyright (c) 2002, 2003, Arjuna Technologies Limited.
+ *
+ * $Id: DummyListenerService.java,v 1.2 2004/06/24 13:52:53 nmcl Exp $
+ */
+
+package com.jboss.transaction.txinterop.proxy;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.StringWriter;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.Enumeration;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.xml.sax.ContentHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+public class ProxyListenerService extends HttpServlet
+{
+ /**
+ * The SOAP 1.1 content type.
+ */
+ private static final String SOAP_11_CONTENT_TYPE = "text/xml" ;
+ /**
+ * The SOAP 1.2 content type.
+ */
+ private static final String SOAP_12_CONTENT_TYPE = "application/soap+xml" ;
+ /**
+ * The name of the SOAP Action header.
+ */
+ public static final String SOAP_ACTION_HEADER = "SOAPAction" ;
+ /**
+ * The default data size.
+ */
+ private static final int DEFAULT_DATA_SIZE = 256 ;
+
+ /**
+ * Initialise the servlet.
+ * @param config The servlet configuration.
+ */
+ public void init(final ServletConfig config)
+ throws ServletException
+ {
+ super.init(config);
+
+ // Initialise the local host:port/urlstub for the proxy.
+ final String proxyServiceURI = config.getInitParameter("proxyServiceURI") ;
+ if (proxyServiceURI == null)
+ {
+ throw new ServletException("Proxy service URI missing") ;
+ }
+ ProxyURIRewriting.setProxyURI(proxyServiceURI) ;
+ }
+
+ /**
+ * Handle the post request.
+ * @param httpServletRequest The current HTTP servlet request.
+ * @param httpServletResponse The current HTTP servlet response.
+ */
+ public void doPost(final HttpServletRequest httpServletRequest, final HttpServletResponse httpServletResponse)
+ throws ServletException, IOException
+ {
+ final String conversationIdentifier = getConversationIdentifier(httpServletRequest) ;
+
+ final byte[] requestContents = getContents(httpServletRequest.getInputStream()) ;
+ final String soapAction = httpServletRequest.getHeader(SOAP_ACTION_HEADER) ;
+ final boolean jbossClient = ProxyConversation.isInternalConversationId(conversationIdentifier) ;
+ final String alternateConversationIdentifier = ProxyConversation.getAlternateConversationId(conversationIdentifier) ;
+
+ final ProxyConversationState state = ProxyConversation.getConversationState(conversationIdentifier) ;
+
+System.out.println("KEV: processing SOAP action " + trimAction(soapAction)) ;
+ // Search header for wsa:To and wsa:Address elements, changing their URL parts as we go.
+ // Get the target URL from the to.
+ try
+ {
+ final StringWriter newMessageWriter = new StringWriter() ;
+ final WriterSAXHandler writerHandler = new WriterSAXHandler(newMessageWriter) ;
+ final AddressingProxySAXHandler addressingHandler = new AddressingProxySAXHandler(writerHandler, alternateConversationIdentifier) ;
+
+ final ContentHandler stateHandler = (state == null ? null : state.getHandler(addressingHandler)) ;
+ final ContentHandler parserHandler = (stateHandler == null ? addressingHandler : stateHandler) ;
+
+ final XMLReader xmlReader = XMLReaderFactory.createXMLReader() ;
+ xmlReader.setContentHandler(parserHandler) ;
+ xmlReader.parse(new InputSource(new ByteArrayInputStream(requestContents))) ;
+
+ final StringBuffer newMessageBuffer = newMessageWriter.getBuffer() ;
+ final StringBuffer messageBuffer = (jbossClient ? newMessageBuffer : new StringBuffer(new String(requestContents))) ;
+
+ ProxyConversation.appendConversation(conversationIdentifier, checkForXMLDecl(messageBuffer)) ;
+
+ final String identifier = addressingHandler.getIdentifier() ;
+ if ((state != null) && state.handleAction(trimAction(soapAction), identifier))
+ {
+ httpServletResponse.setStatus(HttpServletResponse.SC_ACCEPTED) ;
+ httpServletResponse.flushBuffer() ;
+ return ;
+ }
+
+ // parse input stream
+
+ final URL destURL = new URL(addressingHandler.getToAddress()) ;
+ final HttpURLConnection destConnection = (HttpURLConnection)destURL.openConnection() ;
+ try
+ {
+ destConnection.setDoOutput(true) ;
+ destConnection.setUseCaches(false) ;
+
+ // copy the headers
+ final Enumeration headerNameEnum = httpServletRequest.getHeaderNames() ;
+ while(headerNameEnum.hasMoreElements())
+ {
+ final String name = (String)headerNameEnum.nextElement() ;
+ if (name.equals(SOAP_ACTION_HEADER))
+ {
+ destConnection.setRequestProperty(name, soapAction) ;
+ }
+ else
+ {
+ final String value = httpServletRequest.getHeader(name) ;
+ destConnection.setRequestProperty(name, value) ;
+ }
+ }
+
+ // Set content length
+ destConnection.setRequestProperty("Content-Length", Integer.toString(newMessageBuffer.length())) ;
+ final int port = destURL.getPort() ;
+ final String host = (port > 0 ? destURL.getHost() + ":" + port : destURL.getHost()) ;
+ destConnection.setRequestProperty("Host", host) ;
+ destConnection.setRequestMethod("POST") ;
+ // Connect
+ destConnection.connect() ;
+ // Write the new request
+ final OutputStream os = destConnection.getOutputStream() ;
+ os.write(newMessageBuffer.toString().getBytes()) ;
+ os.flush() ;
+ os.close() ;
+
+ final int responseCode = destConnection.getResponseCode() ;
+ final String fullContentType = destConnection.getContentType() ;
+ final String contentType = getContentType(fullContentType) ;
+ switch (responseCode)
+ {
+ case HttpServletResponse.SC_OK:
+ case HttpServletResponse.SC_ACCEPTED:
+ if ((contentType != null) && !(SOAP_11_CONTENT_TYPE.equals(contentType) ||
+ SOAP_12_CONTENT_TYPE.equals(contentType)))
+ {
+ httpServletResponse.setStatus(HttpServletResponse.SC_ACCEPTED) ;
+ httpServletResponse.flushBuffer() ;
+ break ;
+ }
+ // FALL THRU
+ default:
+ // Pass the response back.
+ httpServletResponse.setStatus(destConnection.getResponseCode()) ;
+ final int contentLength = destConnection.getContentLength() ;
+ if (contentLength >= 0)
+ {
+ httpServletResponse.setContentLength(contentLength) ;
+ }
+ if (fullContentType != null)
+ {
+ httpServletResponse.setContentType(fullContentType) ;
+ }
+
+ // Copy data
+ final int datasize = DEFAULT_DATA_SIZE ;
+ final char[] data = new char[datasize] ;
+ int readCount ;
+
+ final InputStream is ;
+ if (responseCode == HttpURLConnection.HTTP_INTERNAL_ERROR)
+ {
+ is = destConnection.getErrorStream() ;
+ }
+ else
+ {
+ is = destConnection.getInputStream() ;
+ }
+ final InputStreamReader isr = new InputStreamReader(is) ;
+ try
+ {
+ final StringWriter writer = new StringWriter() ;
+ do
+ {
+ readCount = isr.read(data, 0, datasize) ;
+ if (readCount > 0)
+ {
+ writer.write(data, 0, readCount) ;
+ }
+ }
+ while(readCount > 0) ;
+ final String responseContents = writer.toString() ;
+ if (responseContents.length() > 0)
+ {
+ if ((contentType != null) && !(SOAP_11_CONTENT_TYPE.equals(contentType) ||
+ SOAP_12_CONTENT_TYPE.equals(contentType)))
+ {
+ ProxyConversation.appendConversation(conversationIdentifier, escapeContents(responseContents)) ;
+ }
+ else
+ {
+ ProxyConversation.appendConversation(conversationIdentifier, responseContents) ;
+ }
+ final ServletOutputStream sos = httpServletResponse.getOutputStream() ;
+ sos.print(responseContents) ;
+ sos.flush() ;
+ }
+ }
+ finally
+ {
+ is.close() ;
+ }
+ break ;
+ }
+ }
+ finally
+ {
+ destConnection.disconnect() ;
+ }
+ }
+ catch (Exception exception)
+ {
+ System.err.println("Proxy Listener Service: " + exception);
+ exception.printStackTrace() ;
+ }
+ catch (Error error)
+ {
+ System.err.println("Proxy Listener Service: " + error);
+ error.printStackTrace() ;
+ }
+ }
+
+ /**
+ * Trim quotes from the action.
+ * @param action The action.
+ * @return The trimmed action.
+ */
+ private static String trimAction(final String action)
+ {
+ final int length = (action == null ? 0 : action.length()) ;
+ if ((length < 2) || (action.charAt(0) != '"') || (action.charAt(length-1) != '"'))
+ {
+ return action ;
+ }
+ return action.substring(1, length-1) ;
+ }
+
+ /**
+ * Get the content type part.
+ * @param fullContentType The full content type.
+ * @return The content type.
+ */
+ private static String getContentType(final String fullContentType)
+ {
+ if (fullContentType == null)
+ {
+ return null ;
+ }
+ final int separatorIndex = fullContentType.indexOf(';') ;
+ return (separatorIndex == -1 ? fullContentType : fullContentType.substring(0, separatorIndex)) ;
+ }
+
+ /**
+ * Get the conversation identifier from the request.
+ * @return The conversation identifier.
+ */
+ private static String getConversationIdentifier(final HttpServletRequest httpServletRequest)
+ {
+ final String pathInfo = httpServletRequest.getPathInfo() ;
+ final int separator = pathInfo.indexOf('/', 1) ;
+ return pathInfo.substring(1, separator) ;
+ }
+
+ /**
+ * Get the contents of the input stream
+ * @param is The input stream.
+ * @return The contents.
+ * @throws IOException for errors.
+ */
+ private byte[] getContents(final InputStream is)
+ throws IOException
+ {
+ final ByteArrayOutputStream baos = new ByteArrayOutputStream() ;
+ final byte[] buffer = new byte[1024] ;
+ int readCount ;
+ do
+ {
+ readCount = is.read(buffer, 0, buffer.length) ;
+ if (readCount > 0)
+ {
+ baos.write(buffer, 0, readCount) ;
+ }
+ }
+ while(readCount > 0) ;
+ return baos.toByteArray() ;
+ }
+
+ /**
+ * Check for the XML declaration and remove.
+ * This method is only used if we are intending to log the SOAP message so that it is easy to combine the XML without creating invalid documents.
+ * @param contents The current stream contents.
+ * @return The stream contents as a string.
+ */
+ private static String checkForXMLDecl(final StringBuffer contents)
+ {
+ int count = 0 ;
+ try
+ {
+ while(Character.isWhitespace(contents.charAt(count))) count++ ;
+ if (contents.charAt(count) == '<')
+ {
+ if (contents.charAt(count+1) == '?')
+ {
+ count+=2 ;
+ while(contents.charAt(count++) != '>') ;
+ }
+ }
+ if (count > 0)
+ {
+ contents.delete(0, count) ;
+ }
+ }
+ catch (final StringIndexOutOfBoundsException sioobe) {}
+
+ return contents.toString() ;
+ }
+
+ /**
+ * Escape the contents of the string.
+ * @param contents The original contents.
+ * @return The escaped contents.
+ */
+ private static String escapeContents(final String contents)
+ {
+ final int length = contents.length() ;
+ StringWriter escapedContents = null ;
+
+ for(int count = 0 ; count < length ; count++)
+ {
+ final char ch = contents.charAt(count) ;
+ if ((ch == '<') || (ch == '>') || (ch == '&') || (ch == '"'))
+ {
+ if (escapedContents == null)
+ {
+ escapedContents = new StringWriter(length) ;
+ if (count > 0)
+ {
+ escapedContents.write(contents, 0, count-1) ;
+ }
+ }
+ if (ch == '<')
+ {
+ escapedContents.write("<") ;
+ }
+ else if (ch == '>')
+ {
+ escapedContents.write(">") ;
+ }
+ else if (ch == '&')
+ {
+ escapedContents.write("&") ;
+ }
+ else if (ch == '"')
+ {
+ escapedContents.write(""") ;
+ }
+ }
+ else if (escapedContents != null)
+ {
+ escapedContents.write(ch) ;
+ }
+ }
+ return (escapedContents == null ? contents : escapedContents.toString()) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/ProxyListenerService.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/ProxyURIRewriting.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/ProxyURIRewriting.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/ProxyURIRewriting.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,139 @@
+package com.jboss.transaction.txinterop.proxy;
+
+
+/**
+ * @author kevin
+ */
+public class ProxyURIRewriting
+{
+ /**
+ * The base URI of the proxy.
+ */
+ private static String PROXY_URI ;
+
+ /**
+ * Set the proxy URI.
+ * @param proxyURI The proxy URI.
+ */
+ public static synchronized void setProxyURI(final String proxyURI)
+ {
+ PROXY_URI = proxyURI ;
+ }
+
+ /**
+ * Get the proxy URI.
+ * @return The proxy URI.
+ */
+ public static synchronized String getProxyURI()
+ {
+ return PROXY_URI ;
+ }
+
+ /**
+ * Rewrite the URI.
+ * @param conversationIdentifier The conversation identifier.
+ * @param uri The uri to be rewritten.
+ * @return The replacement URI.
+ */
+ public static String rewriteURI(final String conversationIdentifier, final String uri)
+ {
+ final String proxyURI = getProxyURI() ;
+
+ if (uri != null)
+ {
+ if (uri.startsWith(proxyURI))
+ {
+ final int separatorIndex = uri.indexOf('/', proxyURI.length()+1) ;
+ final String remainder = uri.substring(separatorIndex+1) ;
+ return decodeURI(remainder) ;
+ }
+ else if (!uri.startsWith("http://www.w3.org/"))
+ {
+ return proxyURI + "/" + conversationIdentifier + "/" + encodeURI(uri) ;
+ }
+ }
+ return uri ;
+ }
+
+ /**
+ * Decode a URI that has been encoded.
+ * @param uri The encoded URI.
+ * @return The decoded URI.
+ */
+ public static String decodeURI(final String uri)
+ {
+ if (uri == null)
+ {
+ return null ;
+ }
+ final StringBuffer result = new StringBuffer() ;
+ final int length = uri.length() ;
+ int separatorCount = 0 ;
+ for(int count = 0 ; count < length ; count++)
+ {
+ final char ch = uri.charAt(count) ;
+ if (separatorCount < 3)
+ {
+ if (ch == '-')
+ {
+ result.append("/") ;
+ separatorCount++ ;
+ continue ;
+ }
+ else if (ch == '_')
+ {
+ result.append(":") ;
+ continue ;
+ }
+ result.append(ch) ;
+ }
+ else
+ {
+ result.append(ch) ;
+ }
+ }
+ return result.toString() ;
+ }
+
+ /**
+ * Encode a URI.
+ * @param uri The URI.
+ * @return The encoded URI.
+ */
+ public static String encodeURI(final String uri)
+ {
+ if (uri == null)
+ {
+ return "" ;
+ }
+
+ final StringBuffer result = new StringBuffer() ;
+ final int length = uri.length() ;
+ int separatorCount = 0 ;
+ for(int count = 0 ; count < length ; count++)
+ {
+ final char ch = uri.charAt(count) ;
+ if (separatorCount < 3)
+ {
+ if (ch == '/')
+ {
+ separatorCount++ ;
+ result.append("-") ;
+ }
+ else if (ch == ':')
+ {
+ result.append("_") ;
+ }
+ else
+ {
+ result.append(ch) ;
+ }
+ }
+ else
+ {
+ result.append(ch) ;
+ }
+ }
+ return result.toString() ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/ProxyURIRewriting.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/WriterSAXHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/WriterSAXHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/WriterSAXHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,394 @@
+/*
+ * Created on 20-Jan-2005
+ */
+package com.jboss.transaction.txinterop.proxy;
+
+import java.io.PrintWriter;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Stack;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+
+/**
+ * Sax parser for rewriting the XML via the proxy.
+ * @author kevin
+ */
+public class WriterSAXHandler implements ContentHandler
+{
+ /**
+ * Do we need to end the start tag?
+ */
+ private boolean endStartTag ;
+ /**
+ * The to address.
+ */
+ private String toAddress ;
+ /**
+ * The identifier.
+ */
+ private String identifier ;
+ /**
+ * The string buffer for text element content.
+ */
+ private StringBuffer characterContent = new StringBuffer() ;
+ /**
+ * The new namespaces.
+ */
+ private List newNamespaces = new ArrayList() ;
+ /**
+ * The stack of active namespaces.
+ */
+ private Stack namespaceStack = new Stack() ;
+ /**
+ * The active namespaces.
+ */
+ private Map activeNamespaces = new HashMap() ;
+
+ /**
+ * The writer for output.
+ */
+ private final PrintWriter printWriter ;
+
+ /**
+ * Construct the SAX handler with the output writer.
+ * @param writer The writer for output.
+ */
+ public WriterSAXHandler(final Writer writer)
+ {
+ this.printWriter = new PrintWriter(writer) ;
+ }
+
+ /**
+ * Set the document locator.
+ * @param locator The document locator.
+ */
+ public void setDocumentLocator(final Locator locator)
+ {
+ }
+
+ /**
+ * Handle the procesing instruction.
+ * @param target The pi target.
+ * @param data The pi data.
+ * @throws SAXException for any errors.
+ */
+ public void processingInstruction(final String target, final String data)
+ throws SAXException
+ {
+ }
+
+ /**
+ * Start the document.
+ * @throws SAXException for any errors.
+ */
+ public void startDocument()
+ throws SAXException
+ {
+ }
+
+ /**
+ * End the document.
+ * @throws SAXException for any errors.
+ */
+ public void endDocument()
+ throws SAXException
+ {
+ printWriter.flush() ;
+ }
+
+ /**
+ * Start a prefix mapping.
+ * @param prefix The namespace prefix.
+ * @param uri The namespace uri.
+ * @throws SAXException for any errors.
+ */
+ public void startPrefixMapping(final String prefix, final String uri)
+ throws SAXException
+ {
+ newNamespaces.add(new NamespaceInfo(prefix, uri)) ;
+ }
+
+ /**
+ * End the prefix mapping.
+ * @param prefix The namespace prefix.
+ * @throws SAXException for any errors.
+ */
+ public void endPrefixMapping(final String prefix)
+ throws SAXException
+ {
+ }
+
+ /**
+ * Start an element.
+ * @param uri The uri.
+ * @param localName The local name.
+ * @param qName The qualified name.
+ * @param attributes The element attributes.
+ * @throws SAXException for any errors.
+ */
+ public void startElement(final String uri, final String localName, final String qName,
+ final Attributes attributes)
+ throws SAXException
+ {
+ checkEndStartTag() ;
+
+ namespaceStack.push(activeNamespaces) ;
+ final Iterator newNamespacesIter = newNamespaces.iterator() ;
+ final String namespaces ;
+ if (newNamespacesIter.hasNext())
+ {
+ final HashMap newActiveNamespaces = new HashMap(activeNamespaces) ;
+ final StringBuffer namespacesValue = new StringBuffer() ;
+ do
+ {
+ final NamespaceInfo namespaceInfo = (NamespaceInfo)newNamespacesIter.next() ;
+ final String namespacePrefix = namespaceInfo.getPrefix() ;
+ final String namespaceURI = namespaceInfo.getURI() ;
+ newActiveNamespaces.put(namespaceURI, namespacePrefix) ;
+
+ namespacesValue.append(" xmlns") ;
+ if ((namespacePrefix != null) && (namespacePrefix.length() > 0))
+ {
+ namespacesValue.append(':') ;
+ namespacesValue.append(namespacePrefix) ;
+ }
+ namespacesValue.append("=\"") ;
+ namespacesValue.append(namespaceURI) ;
+ namespacesValue.append('"') ;
+ }
+ while(newNamespacesIter.hasNext()) ;
+ newNamespaces.clear() ;
+ activeNamespaces = newActiveNamespaces ;
+ namespaces = namespacesValue.toString() ;
+ }
+ else
+ {
+ namespaces = null ;
+ }
+
+ printWriter.write('<') ;
+ printWriter.write(getQName(uri, localName, qName)) ;
+ if (namespaces != null)
+ {
+ printWriter.write(namespaces) ;
+ }
+
+ final int numAttributes = attributes.getLength() ;
+ if (numAttributes > 0)
+ {
+ for(int count = 0 ; count < numAttributes ; count++)
+ {
+ printWriter.write(' ') ;
+ final String attributeQName = getQName(attributes.getURI(count), attributes.getLocalName(count), attributes.getQName(count)) ;
+ printWriter.write(attributeQName) ;
+ printWriter.write("=\"") ;
+ final String value = attributes.getValue(count) ;
+ escapeTextContent(value.toCharArray(), 0, value.length()) ;
+ printWriter.write('"') ;
+ }
+ }
+
+ endStartTag = true ;
+ }
+
+ /**
+ * End an element.
+ * @param uri The uri.
+ * @param localName The local name.
+ * @param qName The qualified name.
+ * @throws SAXException for any errors.
+ */
+ public void endElement(final String uri, final String localName, final String qName)
+ throws SAXException
+ {
+ characterContent.setLength(0) ;
+ if (endStartTag)
+ {
+ printWriter.write("/>") ;
+ }
+ else
+ {
+ printWriter.write("</") ;
+ printWriter.write(qName) ;
+ printWriter.write('>') ;
+ }
+ activeNamespaces = (Map)namespaceStack.pop() ;
+ endStartTag = false ;
+ }
+
+ /**
+ * Process character text.
+ * @param chars The character array.
+ * @param start The start index.
+ * @param length The length of this section.
+ * @throws SAXException for any errors.
+ */
+ public void characters(char[] chars, int start, int length)
+ throws SAXException
+ {
+ checkEndStartTag() ;
+ escapeTextContent(chars, start, length) ;
+ }
+
+ /**
+ * Process ignorable white space.
+ * @param chars The character array.
+ * @param start The start index.
+ * @param length The length of this section.
+ * @throws SAXException for any errors.
+ */
+ public void ignorableWhitespace(char[] chars, int start, int length)
+ throws SAXException
+ {
+ checkEndStartTag() ;
+ printWriter.write(chars, start, length) ;
+ }
+
+ /**
+ * Skip an entity.
+ * @throws SAXException for any errors.
+ */
+ public void skippedEntity(final String name)
+ throws SAXException
+ {
+ }
+
+ /**
+ * Get the qualified name of the element/attribute.
+ * @param uri The qualifed namespace uri or empty string.
+ * @param localName The qualified local name.
+ * @param qName The qualified name.
+ * @return The qualified name of the element/attribute.
+ */
+ private String getQName(final String uri, final String localName, final String qName)
+ {
+ if (uri.length() > 0)
+ {
+ final String prefix = (String)activeNamespaces.get(uri) ;
+ if (prefix.length() > 0)
+ {
+ return prefix + ":" + localName ;
+ }
+ else
+ {
+ return localName ;
+ }
+ }
+ else
+ {
+ return qName ;
+ }
+ }
+
+ /**
+ * Check to see if the end of the start tag has been processed.
+ */
+ private void checkEndStartTag()
+ {
+ if (endStartTag)
+ {
+ printWriter.write('>') ;
+ endStartTag = false ;
+ }
+ }
+
+ /**
+ * Escape the contents of a text element.
+ * @param chars The character array.
+ * @param start The start index.
+ * @param length The length of this section.
+ */
+ private void escapeTextContent(final char[] chars, final int start, final int length)
+ {
+ final int end = start + length ;
+ for(int count = start ; count < end ; count++)
+ {
+ final char ch = chars[count] ;
+ switch(ch)
+ {
+ case '<':
+ printWriter.print("<") ;
+ break ;
+ case '>':
+ printWriter.print(">") ;
+ break ;
+ case '&':
+ printWriter.print("&") ;
+ break ;
+ case '"':
+ printWriter.print(""") ;
+ break ;
+ default:
+ printWriter.print(ch) ;
+ break ;
+ }
+ }
+ }
+
+ /**
+ * Return the to address from the processing.
+ * @return The to address.
+ */
+ public String getToAddress()
+ {
+ return toAddress ;
+ }
+
+ /**
+ * Return the identifier from the processing.
+ * @return The identifier.
+ */
+ public String getIdentifier()
+ {
+ return identifier ;
+ }
+
+ private static final class NamespaceInfo
+ {
+ /**
+ * The namespace prefix.
+ */
+ private final String prefix ;
+ /**
+ * The namespace uri.
+ */
+ private final String uri ;
+
+ /**
+ * Construct the namespace information.
+ * @param prefix The namespace prefix.
+ * @param uri The namespace uri.
+ */
+ NamespaceInfo(final String prefix, final String uri)
+ {
+ this.prefix = prefix ;
+ this.uri = uri ;
+ }
+
+ /**
+ * Get the namespace prefix.
+ * @return The namespace prefix.
+ */
+ String getPrefix()
+ {
+ return prefix ;
+ }
+
+ /**
+ * Get the namespace URI.
+ * @return The namespace URI.
+ */
+ String getURI()
+ {
+ return uri ;
+ }
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/proxy/WriterSAXHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/TestConstants.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/TestConstants.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/TestConstants.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,328 @@
+package com.jboss.transaction.txinterop.test ;
+
+import java.util.Map;
+import java.util.TreeMap;
+
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+
+/**
+ * This class contains constants used to map the front end onto
+ * the WS-TX interop tests.
+ * @author kevin
+ */
+public class TestConstants
+{
+ /**
+ * The name of the Service URI parameter.
+ */
+ public static final String PARAM_SERVICE_URI = "serviceuri" ;
+ /**
+ * The name of the test parameter.
+ */
+ public static final String PARAM_TEST = "test" ;
+ /**
+ * The name of the test timeout parameter.
+ */
+ public static final String PARAM_TEST_TIMEOUT = "testTimeout" ;
+ /**
+ * The name of the asynchronous test flag parameter.
+ */
+ public static final String PARAM_ASYNC_TEST = "asyncTest" ;
+
+ /**
+ * The name of the test results attribute.
+ */
+ public static final String ATTRIBUTE_TEST_RESULT = "testResult" ;
+ /**
+ * The name of the test validation attribute.
+ */
+ public static final String ATTRIBUTE_TEST_VALIDATION = "testValidation" ;
+ /**
+ * The name of the log count attribute.
+ */
+ public static final String ATTRIBUTE_LOG_COUNT = "logCount" ;
+ /**
+ * The name of the log name attribute.
+ */
+ public static final String ATTRIBUTE_LOG_NAME = "logName" ;
+
+ /**
+ * test name for all tests
+ */
+ public static final String NAME_ALL_TESTS = "allTests" ;
+ /**
+ * test name for all AT tests
+ */
+ public static final String NAME_ALL_AT_TESTS = "allATTests" ;
+ /**
+ * test name for all BA tests
+ */
+ public static final String NAME_ALL_BA_TESTS = "allBATests" ;
+ /**
+ * The prefix for all AT tests.
+ */
+ public static final String PREFIX_AT_TESTS = "testAT" ;
+ /**
+ * The prefix for all BA tests.
+ */
+ public static final String PREFIX_BA_TESTS = "testBA" ;
+
+ /**
+ * test name for AT Scenario 1.1
+ */
+ public static final String NAME_TEST_AT_1_1 = PREFIX_AT_TESTS + "1_1" ;
+ /**
+ * test description for AT Scenario 1.1
+ */
+ public static final String DESCRIPTION_TEST_AT_1_1 = "1.1 - " + ATInteropConstants.INTEROP_ELEMENT_COMPLETION_COMMIT ;
+ /**
+ * test name for AT Scenario 1.2
+ */
+ public static final String NAME_TEST_AT_1_2 = PREFIX_AT_TESTS + "1_2" ;
+ /**
+ * test description for AT Scenario 1.2
+ */
+ public static final String DESCRIPTION_TEST_AT_1_2 = "1.2 - " + ATInteropConstants.INTEROP_ELEMENT_COMPLETION_ROLLBACK ;
+ /**
+ * test name for AT Scenario 2.1
+ */
+ public static final String NAME_TEST_AT_2_1 = PREFIX_AT_TESTS + "2_1" ;
+ /**
+ * test description for AT Scenario 2.1
+ */
+ public static final String DESCRIPTION_TEST_AT_2_1 = "2.1 - " + ATInteropConstants.INTEROP_ELEMENT_COMMIT ;
+ /**
+ * test name for AT Scenario 2.2
+ */
+ public static final String NAME_TEST_AT_2_2 = PREFIX_AT_TESTS + "2_2" ;
+ /**
+ * test description for AT Scenario 2.2
+ */
+ public static final String DESCRIPTION_TEST_AT_2_2 = "2.2 - " + ATInteropConstants.INTEROP_ELEMENT_ROLLBACK ;
+ /**
+ * test name for AT Scenario 3.1
+ */
+ public static final String NAME_TEST_AT_3_1 = PREFIX_AT_TESTS + "3_1" ;
+ /**
+ * test description for AT Scenario 3.1
+ */
+ public static final String DESCRIPTION_TEST_AT_3_1 = "3.1 - " + ATInteropConstants.INTEROP_ELEMENT_PHASE_2_ROLLBACK ;
+ /**
+ * test name for AT Scenario 3.2
+ */
+ public static final String NAME_TEST_AT_3_2 = PREFIX_AT_TESTS + "3_2" ;
+ /**
+ * test description for AT Scenario 3.2
+ */
+ public static final String DESCRIPTION_TEST_AT_3_2 = "3.2 - " + ATInteropConstants.INTEROP_ELEMENT_READONLY ;
+ /**
+ * test name for AT Scenario 3.3
+ */
+ public static final String NAME_TEST_AT_3_3 = PREFIX_AT_TESTS + "3_3" ;
+ /**
+ * test description for AT Scenario 3.3
+ */
+ public static final String DESCRIPTION_TEST_AT_3_3 = "3.3 - " + ATInteropConstants.INTEROP_ELEMENT_VOLATILE_AND_DURABLE ;
+ /**
+ * test name for AT Scenario 4.1
+ */
+ public static final String NAME_TEST_AT_4_1 = PREFIX_AT_TESTS + "4_1" ;
+ /**
+ * test description for AT Scenario 4.1
+ */
+ public static final String DESCRIPTION_TEST_AT_4_1 = "4.1 - " + ATInteropConstants.INTEROP_ELEMENT_EARLY_READONLY ;
+ /**
+ * test name for AT Scenario 4.2
+ */
+ public static final String NAME_TEST_AT_4_2 = PREFIX_AT_TESTS + "4_2" ;
+ /**
+ * test description for AT Scenario 4.2
+ */
+ public static final String DESCRIPTION_TEST_AT_4_2 = "4.2 - " + ATInteropConstants.INTEROP_ELEMENT_EARLY_ABORTED ;
+ /**
+ * test name for AT Scenario 5.1
+ */
+ public static final String NAME_TEST_AT_5_1 = PREFIX_AT_TESTS + "5_1" ;
+ /**
+ * test description for AT Scenario 5.1
+ */
+ public static final String DESCRIPTION_TEST_AT_5_1 = "5.1 - " + ATInteropConstants.INTEROP_ELEMENT_REPLAY_COMMIT ;
+ /**
+ * test name for AT Scenario 5.2
+ */
+ public static final String NAME_TEST_AT_5_2 = PREFIX_AT_TESTS + "5_2" ;
+ /**
+ * test description for AT Scenario 5.2
+ */
+ public static final String DESCRIPTION_TEST_AT_5_2 = "5.2 - " + ATInteropConstants.INTEROP_ELEMENT_RETRY_PREPARED_COMMIT ;
+ /**
+ * test name for AT Scenario 5.3
+ */
+ public static final String NAME_TEST_AT_5_3 = PREFIX_AT_TESTS + "5_3" ;
+ /**
+ * test description for AT Scenario 5.3
+ */
+ public static final String DESCRIPTION_TEST_AT_5_3 = "5.3 - " + ATInteropConstants.INTEROP_ELEMENT_RETRY_PREPARED_ABORT ;
+ /**
+ * test name for AT Scenario 5.4
+ */
+ public static final String NAME_TEST_AT_5_4 = PREFIX_AT_TESTS + "5_4" ;
+ /**
+ * test description for AT Scenario 5.4
+ */
+ public static final String DESCRIPTION_TEST_AT_5_4 = "5.4 - " + ATInteropConstants.INTEROP_ELEMENT_RETRY_COMMIT ;
+ /**
+ * test name for AT Scenario 5.5
+ */
+ public static final String NAME_TEST_AT_5_5 = PREFIX_AT_TESTS + "5_5" ;
+ /**
+ * test description for AT Scenario 5.5
+ */
+ public static final String DESCRIPTION_TEST_AT_5_5 = "5.5 - " + ATInteropConstants.INTEROP_ELEMENT_PREPARED_AFTER_TIMEOUT ;
+ /**
+ * test name for AT Scenario 5.6
+ */
+ public static final String NAME_TEST_AT_5_6 = PREFIX_AT_TESTS + "5_6" ;
+ /**
+ * test description for AT Scenario 5.6
+ */
+ public static final String DESCRIPTION_TEST_AT_5_6 = "5.6 - " + ATInteropConstants.INTEROP_ELEMENT_LOST_COMMITTED ;
+
+ /**
+ * test name for BA Scenario 1.1
+ */
+ public static final String NAME_TEST_BA_1_1 = PREFIX_BA_TESTS + "1_1" ;
+ /**
+ * test description for BA Scenario 1.1
+ */
+ public static final String DESCRIPTION_TEST_BA_1_1 = "1.1 - " + BAInteropConstants.INTEROP_ELEMENT_CANCEL ;
+ /**
+ * test name for BA Scenario 1.2
+ */
+ public static final String NAME_TEST_BA_1_2 = PREFIX_BA_TESTS + "1_2" ;
+ /**
+ * test description for BA Scenario 1.2
+ */
+ public static final String DESCRIPTION_TEST_BA_1_2 = "1.2 - " + BAInteropConstants.INTEROP_ELEMENT_EXIT ;
+ /**
+ * test name for BA Scenario 1.3
+ */
+ public static final String NAME_TEST_BA_1_3 = PREFIX_BA_TESTS + "1_3" ;
+ /**
+ * test description for BA Scenario 1.3
+ */
+ public static final String DESCRIPTION_TEST_BA_1_3 = "1.3 - " + BAInteropConstants.INTEROP_ELEMENT_FAIL ;
+ /**
+ * test name for BA Scenario 1.4
+ */
+ public static final String NAME_TEST_BA_1_4 = PREFIX_BA_TESTS + "1_4" ;
+ /**
+ * test description for BA Scenario 1.4
+ */
+ public static final String DESCRIPTION_TEST_BA_1_4 = "1.4 - " + BAInteropConstants.INTEROP_ELEMENT_CANNOT_COMPLETE ;
+ /**
+ * test name for BA Scenario 1.5
+ */
+ public static final String NAME_TEST_BA_1_5 = PREFIX_BA_TESTS + "1_5" ;
+ /**
+ * test description for BA Scenario 1.5
+ */
+ public static final String DESCRIPTION_TEST_BA_1_5 = "1.5 - " + BAInteropConstants.INTEROP_ELEMENT_PARTICIPANT_COMPLETE_CLOSE ;
+ /**
+ * test name for BA Scenario 1.6
+ */
+ public static final String NAME_TEST_BA_1_6 = PREFIX_BA_TESTS + "1_6" ;
+ /**
+ * test description for BA Scenario 1.6
+ */
+ public static final String DESCRIPTION_TEST_BA_1_6 = "1.6 - " + BAInteropConstants.INTEROP_ELEMENT_COORDINATOR_COMPLETE_CLOSE ;
+ /**
+ * test name for BA Scenario 1.7
+ */
+ public static final String NAME_TEST_BA_1_7 = PREFIX_BA_TESTS + "1_7" ;
+ /**
+ * test description for BA Scenario 1.7
+ */
+ public static final String DESCRIPTION_TEST_BA_1_7 = "1.7 - " + BAInteropConstants.INTEROP_ELEMENT_UNSOLICITED_COMPLETE ;
+ /**
+ * test name for BA Scenario 1.8
+ */
+ public static final String NAME_TEST_BA_1_8 = PREFIX_BA_TESTS + "1_8" ;
+ /**
+ * test description for BA Scenario 1.8
+ */
+ public static final String DESCRIPTION_TEST_BA_1_8 = "1.8 - " + BAInteropConstants.INTEROP_ELEMENT_COMPENSATE ;
+ /**
+ * test name for BA Scenario 1.9
+ */
+ public static final String NAME_TEST_BA_1_9 = PREFIX_BA_TESTS + "1_9" ;
+ /**
+ * test description for BA Scenario 1.9
+ */
+ public static final String DESCRIPTION_TEST_BA_1_9 = "1.9 - " + BAInteropConstants.INTEROP_ELEMENT_COMPENSATION_FAIL ;
+ /**
+ * test name for BA Scenario 1.10
+ */
+ public static final String NAME_TEST_BA_1_10 = PREFIX_BA_TESTS + "1_10" ;
+ /**
+ * test description for BA Scenario 1.10
+ */
+ public static final String DESCRIPTION_TEST_BA_1_10 = "1.10 - " + BAInteropConstants.INTEROP_ELEMENT_PARTICIPANT_CANCEL_COMPLETED_RACE ;
+ /**
+ * test name for BA Scenario 1.11
+ */
+ public static final String NAME_TEST_BA_1_11 = PREFIX_BA_TESTS + "1_11" ;
+ /**
+ * test description for BA Scenario 1.11
+ */
+ public static final String DESCRIPTION_TEST_BA_1_11 = "1.11 - " + BAInteropConstants.INTEROP_ELEMENT_MESSAGE_LOSS_AND_RECOVERY ;
+ /**
+ * test name for BA Scenario 1.12
+ */
+ public static final String NAME_TEST_BA_1_12 = PREFIX_BA_TESTS + "1_12" ;
+ /**
+ * test description for BA Scenario 1.12
+ */
+ public static final String DESCRIPTION_TEST_BA_1_12 = "1.12 - " + BAInteropConstants.INTEROP_ELEMENT_MIXED_OUTCOME ;
+
+ /**
+ * The name to description map.
+ */
+ public static final Map DESCRIPTIONS ;
+
+ static
+ {
+ final TreeMap descriptions = new TreeMap() ;
+
+ descriptions.put(NAME_TEST_AT_1_1, DESCRIPTION_TEST_AT_1_1) ;
+ descriptions.put(NAME_TEST_AT_1_2, DESCRIPTION_TEST_AT_1_2) ;
+ descriptions.put(NAME_TEST_AT_2_1, DESCRIPTION_TEST_AT_2_1) ;
+ descriptions.put(NAME_TEST_AT_2_2, DESCRIPTION_TEST_AT_2_2) ;
+ descriptions.put(NAME_TEST_AT_3_1, DESCRIPTION_TEST_AT_3_1) ;
+ descriptions.put(NAME_TEST_AT_3_2, DESCRIPTION_TEST_AT_3_2) ;
+ descriptions.put(NAME_TEST_AT_3_3, DESCRIPTION_TEST_AT_3_3) ;
+ descriptions.put(NAME_TEST_AT_4_1, DESCRIPTION_TEST_AT_4_1) ;
+ descriptions.put(NAME_TEST_AT_4_2, DESCRIPTION_TEST_AT_4_2) ;
+ descriptions.put(NAME_TEST_AT_5_1, DESCRIPTION_TEST_AT_5_1) ;
+ descriptions.put(NAME_TEST_AT_5_2, DESCRIPTION_TEST_AT_5_2) ;
+ descriptions.put(NAME_TEST_AT_5_3, DESCRIPTION_TEST_AT_5_3) ;
+ descriptions.put(NAME_TEST_AT_5_4, DESCRIPTION_TEST_AT_5_4) ;
+ descriptions.put(NAME_TEST_AT_5_5, DESCRIPTION_TEST_AT_5_5) ;
+ descriptions.put(NAME_TEST_AT_5_6, DESCRIPTION_TEST_AT_5_6) ;
+ descriptions.put(NAME_TEST_BA_1_1, DESCRIPTION_TEST_BA_1_1) ;
+ descriptions.put(NAME_TEST_BA_1_2, DESCRIPTION_TEST_BA_1_2) ;
+ descriptions.put(NAME_TEST_BA_1_3, DESCRIPTION_TEST_BA_1_3) ;
+ descriptions.put(NAME_TEST_BA_1_4, DESCRIPTION_TEST_BA_1_4) ;
+ descriptions.put(NAME_TEST_BA_1_5, DESCRIPTION_TEST_BA_1_5) ;
+ descriptions.put(NAME_TEST_BA_1_6, DESCRIPTION_TEST_BA_1_6) ;
+ descriptions.put(NAME_TEST_BA_1_7, DESCRIPTION_TEST_BA_1_7) ;
+ descriptions.put(NAME_TEST_BA_1_8, DESCRIPTION_TEST_BA_1_8) ;
+ descriptions.put(NAME_TEST_BA_1_9, DESCRIPTION_TEST_BA_1_9) ;
+ descriptions.put(NAME_TEST_BA_1_10, DESCRIPTION_TEST_BA_1_10) ;
+ descriptions.put(NAME_TEST_BA_1_11, DESCRIPTION_TEST_BA_1_11) ;
+// descriptions.put(NAME_TEST_BA_1_12, DESCRIPTION_TEST_BA_1_12) ;
+
+ DESCRIPTIONS = descriptions ;
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/TestConstants.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/TestLogController.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/TestLogController.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/TestLogController.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,84 @@
+package com.jboss.transaction.txinterop.test;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+
+/**
+ * The test log controller.
+ * @author kevin
+ */
+public class TestLogController
+{
+ /**
+ * The base directory for logs, hardcoded for now.
+ */
+ private static File baseDir ;
+
+ static
+ {
+ final String userHome = System.getProperty("user.home") ;
+ baseDir = new File(userHome, "logs") ;
+ if (!baseDir.exists())
+ {
+ baseDir.mkdir() ;
+ }
+ }
+
+ /**
+ * Read the contents of the specified log.
+ * @param logName The log to retrieve.
+ * @return The log contents.
+ * @throws IOException for reading errors.
+ */
+ public static String readLog(final String logName)
+ throws IOException
+ {
+ final File logFile = new File(baseDir, logName) ;
+ if (logFile.exists() && logFile.canRead())
+ {
+ final FileReader reader = new FileReader(logFile) ;
+ try
+ {
+ final StringBuffer buffer = new StringBuffer() ;
+ final char[] charBuffer = new char[256] ;
+ while(reader.ready())
+ {
+ final int count = reader.read(charBuffer) ;
+ if (count > 0)
+ {
+ buffer.append(charBuffer, 0, count) ;
+ }
+ }
+ return buffer.toString() ;
+ }
+ finally
+ {
+ reader.close() ;
+ }
+ }
+ throw new IOException("Cannot read log file: " + logName) ;
+ }
+
+ /**
+ * Write the contents of the specified log.
+ * @param logName The log to write.
+ * @param contents The log contents.
+ * @throws IOException for reading errors.
+ */
+ public static void writeLog(final String logName, final String contents)
+ throws IOException
+ {
+ final File logFile = new File(baseDir, logName) ;
+ final FileWriter writer = new FileWriter(logFile) ;
+ try
+ {
+ writer.write(contents) ;
+ }
+ finally
+ {
+ writer.close() ;
+ }
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/TestLogController.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/TestLogServlet.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/TestLogServlet.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/TestLogServlet.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,96 @@
+package com.jboss.transaction.txinterop.test;
+
+import java.io.IOException;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.arjuna.webservices.util.ClassLoaderHelper;
+
+/**
+ * The test servlet.
+ * @author kevin
+ */
+public class TestLogServlet extends HttpServlet
+{
+ /**
+ * The servlet serial version UID.
+ */
+ private static final long serialVersionUID = 2566877081747112520L ;
+
+ /**
+ * The not found HTML page.
+ */
+ private String notFoundResponse ;
+ /**
+ * The directory contents HTML page.
+ */
+ private String directoryContents ;
+
+ /**
+ * Initialise the servlet.
+ * @param servletConfig The servlet configuration.
+ */
+ public void init(final ServletConfig servletConfig)
+ throws ServletException
+ {
+ super.init(servletConfig) ;
+ try
+ {
+ notFoundResponse = ClassLoaderHelper.getResourceAsString(TestLogServlet.class, "notFoundResponse.html") ;
+ directoryContents = ClassLoaderHelper.getResourceAsString(TestLogServlet.class, "directoryContents.html") ;
+ }
+ catch (final IOException ioe)
+ {
+ throw new ServletException("Failed to load HTML pages", ioe) ;
+ }
+ }
+
+ /**
+ * Return the specified logs
+ * @param request The HTTP servlet request.
+ * @param response The HTTP servlet response.
+ */
+ protected void doGet(final HttpServletRequest request, final HttpServletResponse response)
+ throws ServletException, IOException
+ {
+ final String logName = request.getPathInfo() ;
+ if ((logName == null) || (logName.length() == 0))
+ {
+ response.sendRedirect("logs/") ;
+ return ;
+ }
+ else if ("/".equals(logName))
+ {
+ response.setContentType("text/html") ;
+ response.setStatus(HttpServletResponse.SC_OK) ;
+ response.setContentLength(directoryContents.length()) ;
+ response.getOutputStream().print(directoryContents) ;
+ }
+ else
+ {
+ final String contents ;
+ try
+ {
+ contents = TestLogController.readLog(logName) ;
+ }
+ catch (final Throwable th)
+ {
+ log("Error reading log file", th) ;
+ response.setContentType("text/html") ;
+ response.setStatus(HttpServletResponse.SC_NOT_FOUND) ;
+ response.setContentLength(notFoundResponse.length()) ;
+ response.getOutputStream().print(notFoundResponse) ;
+ return ;
+ }
+
+ response.setContentType("text/xml") ;
+ response.setStatus(HttpServletResponse.SC_OK) ;
+ response.setContentLength(contents.length()) ;
+ response.getOutputStream().print(contents) ;
+ }
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/TestLogServlet.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/TestRunner.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/TestRunner.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/TestRunner.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,136 @@
+package com.jboss.transaction.txinterop.test;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestResult;
+import junit.framework.TestSuite;
+
+import com.jboss.transaction.txinterop.interop.ATTestCase;
+import com.jboss.transaction.txinterop.interop.BATestCase;
+import com.jboss.transaction.txinterop.interop.InteropTestCase;
+import com.jboss.transaction.txinterop.interop.InteropTestSuite;
+import com.jboss.transaction.txinterop.interop.MessageLogging;
+
+/**
+ * Class responsible for executing the appropriate JUnit test.
+ * @author kevin
+ */
+public class TestRunner
+{
+ /**
+ * The log message prefix.
+ */
+ private static final String LOG_MESSAGE_PREFIX = "<log:log xmlns:log=\"http://docs.oasis-open.org/ws-tx/logs/\">" ;
+ /**
+ * The log message suffix.
+ */
+ private static final String LOG_MESSAGE_SUFFIX = "</log:log>";
+
+ /**
+ * The AT test class.
+ */
+ private static final Class AT_TEST_CLASS = ATTestCase.class ;
+ /**
+ * The BA test class.
+ */
+ private static final Class BA_TEST_CLASS = BATestCase.class ;
+
+ /**
+ * Execute the specific test against the specified participant.
+ * @param participantURI The URI of the participant.
+ * @param testTimeout The test timeout.
+ * @param asyncTest The asynchronous test flag.
+ * @param testName The name of the test to execute.
+ * @return The test result.
+ */
+ public static TestResult execute(final String participantURI, final long testTimeout, final boolean asyncTest, final String testName)
+ {
+ MessageLogging.clearThreadLog() ;
+ final Test test ;
+ if (TestConstants.NAME_ALL_TESTS.equals(testName))
+ {
+ final TestSuite testSuite = new TestSuite() ;
+ testSuite.addTest(new InteropTestSuite(participantURI, testTimeout, asyncTest, AT_TEST_CLASS)) ;
+ testSuite.addTest(new InteropTestSuite(participantURI, testTimeout, asyncTest, BA_TEST_CLASS)) ;
+ test = testSuite ;
+ }
+ else if (TestConstants.NAME_ALL_AT_TESTS.equals(testName))
+ {
+ test = new InteropTestSuite(participantURI, testTimeout, asyncTest, AT_TEST_CLASS) ;
+ }
+ else if (TestConstants.NAME_ALL_BA_TESTS.equals(testName))
+ {
+ test = new InteropTestSuite(participantURI, testTimeout, asyncTest, BA_TEST_CLASS) ;
+ }
+ else if (testName.startsWith(TestConstants.PREFIX_AT_TESTS))
+ {
+ final Class testClass = AT_TEST_CLASS ;
+ try
+ {
+ test = createTest(testClass, participantURI, testTimeout, asyncTest, testName) ;
+ }
+ catch (final Throwable th)
+ {
+ System.err.println("Unexpected error instantiating test class: " + th) ;
+ return null ;
+ }
+ }
+ else if (testName.startsWith(TestConstants.PREFIX_BA_TESTS))
+ {
+ final Class testClass = BA_TEST_CLASS ;
+ try
+ {
+ test = createTest(testClass, participantURI, testTimeout, asyncTest, testName) ;
+ }
+ catch (final Throwable th)
+ {
+ System.err.println("Unexpected error instantiating test class: " + th) ;
+ return null ;
+ }
+ }
+ else
+ {
+ System.err.println("Unidentified test name: " + testName) ;
+ return null ;
+ }
+ MessageLogging.appendThreadLog(LOG_MESSAGE_PREFIX) ;
+ final TestResult testResult = new TestResult() ;
+ test.run(testResult) ;
+ MessageLogging.appendThreadLog(LOG_MESSAGE_SUFFIX) ;
+ return testResult ;
+ }
+
+ /**
+ * Create the test instance.
+ * @param testClass The test class name.
+ * @param participantURI The participant URI.
+ * @param testTimeout The test timeout.
+ * @param asyncTest The asynchronous test flag.
+ * @param testName The test name.
+ * @return The test instance.
+ * @throws IllegalAccessException For access exception instantiating the test class.
+ * @throws InstantiationException For errors instantiating the test class.
+ * @throws IllegalArgumentException For an invalid test class.
+ */
+ private static TestCase createTest(final Class testClass, final String participantURI, final long testTimeout, final boolean asyncTest, final String testName)
+ throws IllegalAccessException, InstantiationException, IllegalArgumentException
+ {
+ final Object testObject = testClass.newInstance() ;
+ if (testObject instanceof InteropTestCase)
+ {
+ final InteropTestCase interopTestCase = (InteropTestCase)testObject ;
+ interopTestCase.setParticipantURI(participantURI) ;
+ interopTestCase.setTestTimeout(testTimeout) ;
+ interopTestCase.setAsyncTest(asyncTest) ;
+ interopTestCase.setName(testName) ;
+ return interopTestCase ;
+ }
+ else if (testObject instanceof TestCase)
+ {
+ final TestCase test = (TestCase)testObject ;
+ test.setName(testName) ;
+ return test ;
+ }
+ throw new IllegalArgumentException("Invalid class: " + testClass.getName()) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/TestRunner.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/TestServlet.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/TestServlet.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/TestServlet.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,199 @@
+package com.jboss.transaction.txinterop.test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Templates;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import junit.framework.TestResult;
+
+import com.arjuna.webservices.util.ClassLoaderHelper;
+import com.jboss.transaction.txinterop.interop.MessageLogging;
+
+/**
+ * The test servlet.
+ * @author kevin
+ */
+public class TestServlet extends HttpServlet
+{
+ /**
+ * The servlet serial version UID.
+ */
+ private static final long serialVersionUID = 6764303043215036856L ;
+
+ /**
+ * The validation templates.
+ */
+ private Templates validationTemplates ;
+
+ /**
+ * Initialise the servlet.
+ * @param config The servlet configuration.
+ */
+ public void init(final ServletConfig config)
+ throws ServletException
+ {
+ super.init(config) ;
+
+ final InputStream is = ClassLoaderHelper.getResourceAsStream(getClass(), "processor.xsl") ;
+ if (is == null)
+ {
+ throw new ServletException("Cannot locate transformation stylesheet") ;
+ }
+ final TransformerFactory factory = TransformerFactory.newInstance() ;
+ try
+ {
+ validationTemplates = factory.newTemplates(new StreamSource(is)) ;
+ }
+ catch (final TransformerConfigurationException tce)
+ {
+ throw new ServletException("Error creating transformation template!", tce) ;
+ }
+ }
+
+ /**
+ * Execute the test
+ * @param request The HTTP servlet request.
+ * @param response The HTTP servlet response.
+ */
+ protected void doPost(final HttpServletRequest request, final HttpServletResponse response)
+ throws ServletException, IOException
+ {
+ final String serviceURI = request.getParameter(TestConstants.PARAM_SERVICE_URI) ;
+ final String test = request.getParameter(TestConstants.PARAM_TEST) ;
+ final String testTimeoutValue = request.getParameter(TestConstants.PARAM_TEST_TIMEOUT) ;
+ final String asyncTestValue = request.getParameter(TestConstants.PARAM_ASYNC_TEST) ;
+
+ final int serviceURILength = (serviceURI == null ? 0 : serviceURI.length()) ;
+ final int testLength = (test == null ? 0 : test.length()) ;
+
+ long testTimeout = 0 ;
+
+ boolean testTimeoutValid = false ;
+ if ((testTimeoutValue != null) && (testTimeoutValue.length() > 0))
+ {
+ try
+ {
+ testTimeout = Long.parseLong(testTimeoutValue) ;
+ testTimeoutValid = true ;
+ }
+ catch (final NumberFormatException nfe) {} // ignore
+ }
+
+ final boolean asyncTest = (asyncTestValue != null) ;
+
+ if ((serviceURILength == 0) || (testLength == 0) || !testTimeoutValid)
+ {
+ final RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/invalidParameters.html") ;
+ dispatcher.forward(request, response) ;
+ return ;
+ }
+
+ final HttpSession session = request.getSession() ;
+ final String id = session.getId() ;
+ final int logCount = getLogCount(session) ;
+ final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss") ;
+ final String date = format.format(new Date()) ;
+ final String logName = date + "-" + id + "-" + logCount ;
+
+ session.setAttribute(TestConstants.ATTRIBUTE_TEST_RESULT, null) ;
+ session.setAttribute(TestConstants.ATTRIBUTE_TEST_VALIDATION, null) ;
+ session.setAttribute(TestConstants.ATTRIBUTE_LOG_NAME, null) ;
+
+ final String threadLog ;
+ try
+ {
+ final TestResult result = TestRunner.execute(serviceURI, testTimeout, asyncTest, test) ;
+ if (result != null)
+ {
+ session.setAttribute(TestConstants.ATTRIBUTE_TEST_RESULT, result) ;
+
+ threadLog = MessageLogging.getThreadLog() ;
+
+ try
+ {
+ TestLogController.writeLog(logName, threadLog) ;
+ session.setAttribute(TestConstants.ATTRIBUTE_LOG_NAME, logName) ;
+ }
+ catch (final IOException ioe)
+ {
+ log("Unexpected IOException writing message log", ioe) ;
+ }
+ }
+ else
+ {
+ threadLog = null ;
+ }
+ }
+ finally
+ {
+ MessageLogging.clearThreadLog() ;
+ }
+
+ if ((threadLog != null) && (threadLog.length() > 0))
+ {
+ try
+ {
+ final String testValidation = transform(threadLog) ;
+ session.setAttribute(TestConstants.ATTRIBUTE_TEST_VALIDATION, testValidation) ;
+ }
+ catch (final Throwable th)
+ {
+ log("Unexpected throwable transforming message log", th) ;
+ }
+ }
+
+ final RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/results.jsp") ;
+ dispatcher.forward(request, response) ;
+ }
+
+ /**
+ * Get the log count from the session, incrementing afterwards.
+ * @param session The current HTTP session.
+ * @return The log count.
+ */
+ private int getLogCount(final HttpSession session)
+ {
+ final Object logCountObject = session.getAttribute(TestConstants.ATTRIBUTE_LOG_COUNT) ;
+ final int logCount = (logCountObject == null ? 1 : ((Integer)logCountObject).intValue() + 1) ;
+ session.setAttribute(TestConstants.ATTRIBUTE_LOG_COUNT, new Integer(logCount)) ;
+ return logCount ;
+ }
+
+ /**
+ * Transform the specified message log.
+ * @param messageLog The specified message log.
+ * @return The transformed result.
+ * @throws TransformerConfigurationException For transformer configuration errors.
+ * @throws TransformerException The transformation errors.
+ */
+ private String transform(final String messageLog)
+ throws TransformerConfigurationException, TransformerException
+ {
+ final Source source = new StreamSource(new StringReader(messageLog)) ;
+ final Transformer transformer = validationTemplates.newTransformer() ;
+ final StringWriter writer = new StringWriter() ;
+ final Result result = new StreamResult(writer) ;
+ transformer.transform(source, result) ;
+ return writer.toString() ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/TestServlet.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/directoryContents.html
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/directoryContents.html (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/directoryContents.html 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,25 @@
+<html>
+ <head>
+ <title>JBoss Transaction WS-TX interop results</title>
+ </head>
+ <body>
+ <h1>WS-TX Interop results</h1>
+ <!--
+ <p>These log files are the results of executing the JBoss Transaction WS-TX Interop client against public endpoints</p>
+ <table>
+ <thead>
+ <tr><td>Endpoint</td><td>Log file</td></tr>
+ </thead>
+ <tbody>
+ <tr><td>JBoss</td><td><a href="jboss-jboss.xml">jboss-jboss.xml</a></td></tr>
+ <tr><td>IBM</td><td><a href="jboss-ibm.xml">jboss-ibm.xml</a></td></tr>
+ <tr><td>Sun</td><td><a href="jboss-sun.xml">jboss-sun.xml</a></td></tr>
+ <tr><td>Microsoft</td><td><a href="jboss-msft.xml">jboss-msft.xml</a></td></tr>
+ <tr><td>Apache</td><td><a href="jboss-apache.xml">jboss-apache.xml</a></td></tr>
+ <tr><td>WSO2</td><td><a href="jboss-wso2.xml">jboss-wso2.xml</a></td></tr>
+ </tbody>
+ </table>
+ -->
+ <p>Please send any queries to the <a href="mailto:kevin.conner at jboss.com?subject=Log%20results%20query">interop test contact</a></p>
+ </body>
+</html>
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/directoryContents.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/notFoundResponse.html
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/notFoundResponse.html (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/notFoundResponse.html 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,9 @@
+<html>
+ <head>
+ <title>Log file not found</title>
+ </head>
+ <body>
+ <h1>Log file not found</h1>
+ Requested log file could not be found
+ </body>
+</html>
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/notFoundResponse.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/processor.xsl
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/processor.xsl (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/processor.xsl 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/ws-addressing/testsuite/observer/processor.xsl
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/test/processor.xsl
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/InteropConstants.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/InteropConstants.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/InteropConstants.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,12 @@
+package com.jboss.transaction.txinterop.webservices;
+
+/**
+ * Interface containing WS-TX Interop constants.
+ */
+public interface InteropConstants
+{
+ /**
+ * The interop test participant service name.
+ */
+ public String SERVICE_PARTICIPANT = "TX11Participant" ;
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/InteropConstants.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ATInteropConstants.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ATInteropConstants.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ATInteropConstants.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,240 @@
+package com.jboss.transaction.txinterop.webservices.atinterop;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Interface containing WS-TX AT Interop constants.
+ */
+public interface ATInteropConstants
+{
+ /**
+ * The interop test initiator service name.
+ */
+ public String SERVICE_INITIATOR = "TX11ATInitiator" ;
+
+ /**
+ * The interop Namespace.
+ */
+ public String INTEROP_NAMESPACE = "http://fabrikam123.com" ;
+ /**
+ * The interop namespace prefix.
+ */
+ public String INTEROP_PREFIX = "atinterop" ;
+
+ /**
+ * The participant action prefix.
+ */
+ public String INTEROP_ACTION_PARTICIPANT_PREFIX = INTEROP_NAMESPACE + "/ParticipantPortType/" ;
+ /**
+ * The initiator action prefix.
+ */
+ public String INTEROP_ACTION_INITIATOR_PREFIX = INTEROP_NAMESPACE + "/InitiatorPortType/" ;
+
+ /**
+ * The completion commit element.
+ */
+ public String INTEROP_ELEMENT_COMPLETION_COMMIT = "CompletionCommit" ;
+ /**
+ * The completion commit QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_COMPLETION_COMMIT = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_COMPLETION_COMMIT, INTEROP_PREFIX) ;
+ /**
+ * The completion commit Action.
+ */
+ public String INTEROP_ACTION_COMPLETION_COMMIT = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_COMPLETION_COMMIT ;
+
+ /**
+ * The completion rollback element.
+ */
+ public String INTEROP_ELEMENT_COMPLETION_ROLLBACK = "CompletionRollback" ;
+ /**
+ * The completion rollback QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_COMPLETION_ROLLBACK = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_COMPLETION_ROLLBACK, INTEROP_PREFIX) ;
+ /**
+ * The completion rollback Action.
+ */
+ public String INTEROP_ACTION_COMPLETION_ROLLBACK = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_COMPLETION_ROLLBACK ;
+
+ /**
+ * The commit element.
+ */
+ public String INTEROP_ELEMENT_COMMIT = "Commit" ;
+ /**
+ * The commit QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_COMMIT = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_COMMIT, INTEROP_PREFIX) ;
+ /**
+ * The commit Action.
+ */
+ public String INTEROP_ACTION_COMMIT = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_COMMIT ;
+
+ /**
+ * The rollback element.
+ */
+ public String INTEROP_ELEMENT_ROLLBACK = "Rollback" ;
+ /**
+ * The rollback QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_ROLLBACK = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_ROLLBACK, INTEROP_PREFIX) ;
+ /**
+ * The rollback Action.
+ */
+ public String INTEROP_ACTION_ROLLBACK = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_ROLLBACK ;
+
+ /**
+ * The phase 2 rollback element.
+ */
+ public String INTEROP_ELEMENT_PHASE_2_ROLLBACK = "Phase2Rollback" ;
+ /**
+ * The phase 2 rollback QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_PHASE_2_ROLLBACK = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_PHASE_2_ROLLBACK, INTEROP_PREFIX) ;
+ /**
+ * The phase 2 rollback Action.
+ */
+ public String INTEROP_ACTION_PHASE_2_ROLLBACK = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_PHASE_2_ROLLBACK ;
+
+ /**
+ * The readonly element.
+ */
+ public String INTEROP_ELEMENT_READONLY = "Readonly" ;
+ /**
+ * The readonly QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_READONLY = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_READONLY, INTEROP_PREFIX) ;
+ /**
+ * The readonly Action.
+ */
+ public String INTEROP_ACTION_READONLY = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_READONLY ;
+
+ /**
+ * The volatile and durable element.
+ */
+ public String INTEROP_ELEMENT_VOLATILE_AND_DURABLE = "VolatileAndDurable" ;
+ /**
+ * The volatile and durable QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_VOLATILE_AND_DURABLE = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_VOLATILE_AND_DURABLE, INTEROP_PREFIX) ;
+ /**
+ * The volatile and durable Action.
+ */
+ public String INTEROP_ACTION_VOLATILE_AND_DURABLE = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_VOLATILE_AND_DURABLE ;
+
+ /**
+ * The early readonly element.
+ */
+ public String INTEROP_ELEMENT_EARLY_READONLY = "EarlyReadonly" ;
+ /**
+ * The early readonly QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_EARLY_READONLY = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_EARLY_READONLY, INTEROP_PREFIX) ;
+ /**
+ * The early readonly Action.
+ */
+ public String INTEROP_ACTION_EARLY_READONLY = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_EARLY_READONLY ;
+
+ /**
+ * The early aborted element.
+ */
+ public String INTEROP_ELEMENT_EARLY_ABORTED = "EarlyAborted" ;
+ /**
+ * The early aborted QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_EARLY_ABORTED = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_EARLY_ABORTED, INTEROP_PREFIX) ;
+ /**
+ * The early aborted Action.
+ */
+ public String INTEROP_ACTION_EARLY_ABORTED = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_EARLY_ABORTED ;
+
+ /**
+ * The replay commit element.
+ */
+ public String INTEROP_ELEMENT_REPLAY_COMMIT = "ReplayCommit" ;
+ /**
+ * The replay commit QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_REPLAY_COMMIT = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_REPLAY_COMMIT, INTEROP_PREFIX) ;
+ /**
+ * The replay commit Action.
+ */
+ public String INTEROP_ACTION_REPLAY_COMMIT = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_REPLAY_COMMIT ;
+
+ /**
+ * The retry prepared commit element.
+ */
+ public String INTEROP_ELEMENT_RETRY_PREPARED_COMMIT = "RetryPreparedCommit" ;
+ /**
+ * The retry prepared commit QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_RETRY_PREPARED_COMMIT = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_RETRY_PREPARED_COMMIT, INTEROP_PREFIX) ;
+ /**
+ * The retry prepared commit Action.
+ */
+ public String INTEROP_ACTION_RETRY_PREPARED_COMMIT = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_RETRY_PREPARED_COMMIT ;
+
+ /**
+ * The retry prepared abort element.
+ */
+ public String INTEROP_ELEMENT_RETRY_PREPARED_ABORT = "RetryPreparedAbort" ;
+ /**
+ * The retry prepared abort QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_RETRY_PREPARED_ABORT = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_RETRY_PREPARED_ABORT, INTEROP_PREFIX) ;
+ /**
+ * The retry prepared abort Action.
+ */
+ public String INTEROP_ACTION_RETRY_PREPARED_ABORT = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_RETRY_PREPARED_ABORT ;
+
+ /**
+ * The retry commit element.
+ */
+ public String INTEROP_ELEMENT_RETRY_COMMIT = "RetryCommit" ;
+ /**
+ * The retry commit QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_RETRY_COMMIT = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_RETRY_COMMIT, INTEROP_PREFIX) ;
+ /**
+ * The retry commit Action.
+ */
+ public String INTEROP_ACTION_RETRY_COMMIT = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_RETRY_COMMIT ;
+
+ /**
+ * The prepared after timeout element.
+ */
+ public String INTEROP_ELEMENT_PREPARED_AFTER_TIMEOUT = "PreparedAfterTimeout" ;
+ /**
+ * The prepared after timeout QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_PREPARED_AFTER_TIMEOUT = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_PREPARED_AFTER_TIMEOUT, INTEROP_PREFIX) ;
+ /**
+ * The prepared after timeout Action.
+ */
+ public String INTEROP_ACTION_PREPARED_AFTER_TIMEOUT = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_PREPARED_AFTER_TIMEOUT ;
+
+ /**
+ * The lost committed element.
+ */
+ public String INTEROP_ELEMENT_LOST_COMMITTED = "LostCommitted" ;
+ /**
+ * The lost committed QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_LOST_COMMITTED = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_LOST_COMMITTED, INTEROP_PREFIX) ;
+ /**
+ * The lost committed Action.
+ */
+ public String INTEROP_ACTION_LOST_COMMITTED = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_LOST_COMMITTED ;
+
+ /**
+ * The response element.
+ */
+ public String INTEROP_ELEMENT_RESPONSE = "Response" ;
+ /**
+ * The response QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_RESPONSE = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_RESPONSE, INTEROP_PREFIX) ;
+ /**
+ * The response Action.
+ */
+ public String INTEROP_ACTION_RESPONSE = INTEROP_ACTION_INITIATOR_PREFIX + INTEROP_ELEMENT_RESPONSE ;
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ATInteropConstants.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ATInteropUtil.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ATInteropUtil.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ATInteropUtil.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,145 @@
+package com.jboss.transaction.txinterop.webservices.atinterop;
+
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.wsaddr2005.AttributedURIType;
+import com.arjuna.webservices.wsaddr2005.EndpointReferenceType;
+import com.arjuna.webservices.wsat11.AtomicTransactionConstants;
+import com.arjuna.webservices.wsat11.processors.ParticipantProcessor;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.arjuna.webservices.wsjboss.InstanceIdentifier;
+import com.arjuna.wsc.ActivationCoordinator11;
+import com.arjuna.wsc.RegistrationCoordinator11;
+import com.arjuna.wsc.messaging.MessageId;
+import com.arjuna.wst.CompletionCoordinatorParticipant;
+import com.arjuna.wst.Durable2PCParticipant;
+import com.arjuna.wst.Participant;
+import com.arjuna.wst.Volatile2PCParticipant;
+import com.arjuna.wst.messaging.engines.Participant11Engine;
+import com.arjuna.wst.stub.Completion11Stub;
+
+/**
+ * Utility methods
+ */
+public class ATInteropUtil
+{
+ /**
+ * Get a coordination context.
+ * @param coordinatorURI The coordinator URI.
+ * @return The coordination context.
+ * @throws Exception for errors.
+ */
+ public static CoordinationContextType createCoordinationContext(final String coordinatorURI)
+ throws Exception
+ {
+ return ActivationCoordinator11.createCoordinationContext(coordinatorURI, MessageId.getMessageId(), AtomicTransactionConstants.WSAT_PROTOCOL, null, null) ;
+ }
+
+ /**
+ * Register for completion.
+ * @param context The coordination context.
+ * @return The endpoint for communicating with the coordinator.
+ * @throws Exception for errors.
+ */
+ public static CompletionCoordinatorParticipant registerCompletion(final CoordinationContextType context, final String id)
+ throws Exception
+ {
+ final EndpointReferenceType completionCoordinator = register(context, getCompletionParticipant(id), AtomicTransactionConstants.WSAT_SUB_PROTOCOL_COMPLETION) ;
+ return new Completion11Stub(id, completionCoordinator);
+ }
+
+ /**
+ * Register a durable participant in the specified coordination context.
+ * @param context The coordination context.
+ * @param participant The durable 2PC participant
+ * @param id The participant id.
+ * @return The participant engine.
+ * @throws Exception for errors.
+ */
+ public static Participant11Engine registerDurable2PC(final CoordinationContextType context, final Durable2PCParticipant participant, final String id)
+ throws Exception
+ {
+ return registerParticipant(context, participant, id, AtomicTransactionConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC) ;
+ }
+
+ /**
+ * Register a volatile participant in the specified coordination context.
+ * @param context The coordination context.
+ * @param participant The volatile 2PC participant
+ * @param id The participant id.
+ * @return The participant engine.
+ * @throws Exception for errors.
+ */
+ public static Participant11Engine registerVolatile2PC(final CoordinationContextType context, final Volatile2PCParticipant participant, final String id)
+ throws Exception
+ {
+ return registerParticipant(context, participant, id, AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC) ;
+ }
+
+ /**
+ * Register the participant in the specified coordination context.
+ * @param context The coordination context.
+ * @param participant The participant.
+ * @param id The participant id.
+ * @param protocol The sub protocol to register for.
+ * @return The participant engine.
+ * @throws Exception for errors.
+ */
+ private static Participant11Engine registerParticipant(final CoordinationContextType context, final Participant participant, final String id, final String protocol)
+ throws Exception
+ {
+ final EndpointReferenceType coordinator = RegistrationCoordinator11.register(context, MessageId.getMessageId(),
+ getParticipant(id), protocol) ;
+ final Participant11Engine engine = new Participant11Engine(participant, id, coordinator) ;
+ ParticipantProcessor.getProcessor().activateParticipant(engine, id) ;
+ return engine ;
+ }
+
+ /**
+ * Register for a sub protocol.
+ * @param context The coordination context.
+ * @param participant The participant EPR.
+ * @param protocol The protocol.
+ * @return The coordinator endpoint.
+ * @throws Exception for errors.
+ */
+ private static EndpointReferenceType register(final CoordinationContextType context, final EndpointReferenceType participant, final String protocol)
+ throws Exception
+ {
+ return RegistrationCoordinator11.register(context, MessageId.getMessageId(), participant, protocol) ;
+ }
+
+ /**
+ * Get the endpoint reference for completion.
+ * @param id The completion id.
+ * @return The endpoint reference.
+ */
+ private static EndpointReferenceType getCompletionParticipant(final String id)
+ {
+ return getEndpointReference(AtomicTransactionConstants.SERVICE_COMPLETION_INITIATOR, id) ;
+ }
+
+ /**
+ * Get the endpoint reference for a participant.
+ * @param id The participant id.
+ * @return The endpoint reference.
+ */
+ private static EndpointReferenceType getParticipant(final String id)
+ {
+ return getEndpointReference(AtomicTransactionConstants.SERVICE_PARTICIPANT, id) ;
+ }
+
+ /**
+ * Get the endpoint reference for a service.
+ * @param service The service.
+ * @param id The service id.
+ * @return The endpoint reference.
+ */
+ private static EndpointReferenceType getEndpointReference(final String service, final String id)
+ {
+ final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+ final String serviceURI = soapRegistry.getServiceURI(service) ;
+ final EndpointReferenceType participant = new EndpointReferenceType(new AttributedURIType(serviceURI)) ;
+ InstanceIdentifier.setEndpointInstanceIdentifier(participant, id) ;
+ return participant ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ATInteropUtil.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/AsyncParticipantStub.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/AsyncParticipantStub.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/AsyncParticipantStub.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,550 @@
+package com.jboss.transaction.txinterop.webservices.atinterop;
+
+import java.io.IOException;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.soap.Soap11Details;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.arjuna.wsc.messaging.MessageId;
+import com.jboss.transaction.txinterop.webservices.atinterop.client.AsyncParticipantClient;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATInitiatorCallback;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATInitiatorProcessor;
+
+/**
+ * The participant stub.
+ */
+public class AsyncParticipantStub implements ParticipantStub
+{
+ /**
+ * The SOAP 1.1 details.
+ */
+ private static final SoapDetails SOAP_DETAILS = new Soap11Details() ;
+
+ /***
+ * The participant stub singletong.
+ */
+ private static final ParticipantStub PARTICIPANT_STUB = new AsyncParticipantStub() ;
+
+ /**
+ * Get the participant stub singleton.
+ * @return The participant stub singleton.
+ */
+ public static ParticipantStub getParticipantStub()
+ {
+ return PARTICIPANT_STUB ;
+ }
+
+ /**
+ * Send a completion commit request.
+ * @param serviceURI The target service URI.
+ * @param coordinatorURI The coordinator URI.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void completionCommit(final String serviceURI, final String coordinatorURI)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendCompletionCommit(addressingContext, SOAP_DETAILS, coordinatorURI) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a completion rollback request.
+ * @param serviceURI The target service URI.
+ * @param coordinatorURI The coordinator URI.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void completionRollback(final String serviceURI, final String coordinatorURI)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendCompletionRollback(addressingContext, SOAP_DETAILS, coordinatorURI) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a commit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void commit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendCommit(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a rollback request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void rollback(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendRollback(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a phase2Rollback request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void phase2Rollback(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendPhase2Rollback(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a readonly request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void readonly(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendReadonly(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a volatileAndDurable request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void volatileAndDurable(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendVolatileAndDurable(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send an earlyReadonly request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void earlyReadonly(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendEarlyReadonly(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a earlyAborted request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void earlyAborted(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendEarlyAborted(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a replayCommit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void replayCommit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendReplayCommit(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a retryPreparedCommit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void retryPreparedCommit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendRetryPreparedCommit(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a retryPreparedAbort request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void retryPreparedAbort(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendRetryPreparedAbort(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a retryCommit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void retryCommit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendRetryCommit(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a preparedAfterTimeout request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void preparedAfterTimeout(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendPreparedAfterTimeout(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a lostCommitted request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void lostCommitted(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final ATInitiatorProcessor initiator = ATInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendLostCommitted(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Handle the callback.
+ * @param callback The callback.
+ * @throws SoapFault for errors.
+ */
+ private static void handleCallback(final RequestCallback callback)
+ throws SoapFault
+ {
+ if (callback.hasFailed())
+ {
+ throw new SoapFault(SoapFaultType.FAULT_RECEIVER, null, "Callback execution failed") ;
+ }
+ else if (!callback.hasTriggered())
+ {
+ throw new SoapFault(SoapFaultType.FAULT_RECEIVER, null, "Callback wasn't triggered") ;
+ }
+ else if (!callback.isResponse())
+ {
+ throw callback.getSoapFault() ;
+ }
+ }
+
+ /**
+ * The request callback class.
+ */
+ private static final class RequestCallback extends ATInitiatorCallback
+ {
+ /**
+ * The response flag.
+ */
+ private boolean response ;
+ /**
+ * The SOAP fault response.
+ */
+ private SoapFault soapFault ;
+
+ /**
+ * A response.
+ * @param response The response.
+ * @param addressingContext The current addressing context.
+ */
+ public void response(final TestMessageType response,
+ final AddressingContext addressingContext)
+ {
+ this.response = true ;
+ }
+
+ /**
+ * 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 ;
+ }
+
+ /**
+ * Was a response received?
+ * @return true if a response was received, false otherwise.
+ */
+ boolean isResponse()
+ {
+ return response ;
+ }
+
+ /**
+ * Get the SOAP fault.
+ * @return The SOAP fault or null.
+ */
+ SoapFault getSoapFault()
+ {
+ return soapFault ;
+ }
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/AsyncParticipantStub.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ParticipantStub.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ParticipantStub.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ParticipantStub.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,162 @@
+package com.jboss.transaction.txinterop.webservices.atinterop;
+
+import java.io.IOException;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+
+/**
+ * The interface for the participant stub.
+ */
+public interface ParticipantStub
+{
+ /**
+ * Send a completion commit request.
+ * @param serviceURI The target service URI.
+ * @param coordinatorURI The coordinator URI.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void completionCommit(final String serviceURI, final String coordinatorURI)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a completion rollback request.
+ * @param serviceURI The target service URI.
+ * @param coordinatorURI The coordinator URI.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void completionRollback(final String serviceURI, final String coordinatorURI)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a commit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void commit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a rollback request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void rollback(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a phase2Rollback request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void phase2Rollback(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a readonly request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void readonly(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a volatileAndDurable request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void volatileAndDurable(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send an earlyReadonly request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void earlyReadonly(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a earlyAborted request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void earlyAborted(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a replayCommit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void replayCommit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a retryPreparedCommit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void retryPreparedCommit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a retryPreparedAbort request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void retryPreparedAbort(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a retryCommit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void retryCommit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a preparedAfterTimeout request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void preparedAfterTimeout(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a lostCommitted request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void lostCommitted(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/ParticipantStub.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/SyncParticipantStub.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/SyncParticipantStub.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/SyncParticipantStub.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,276 @@
+package com.jboss.transaction.txinterop.webservices.atinterop;
+
+import java.io.IOException;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.Soap11Details;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.arjuna.wsc.messaging.MessageId;
+import com.jboss.transaction.txinterop.webservices.atinterop.client.SyncParticipantClient;
+
+/**
+ * The participant stub.
+ */
+public class SyncParticipantStub implements ParticipantStub
+{
+ /**
+ * The SOAP 1.1 details.
+ */
+ private static final SoapDetails SOAP_DETAILS = new Soap11Details() ;
+
+ /***
+ * The participant stub singletong.
+ */
+ private static final ParticipantStub PARTICIPANT_STUB = new SyncParticipantStub() ;
+
+ /**
+ * Get the participant stub singleton.
+ * @return The participant stub singleton.
+ */
+ public static ParticipantStub getParticipantStub()
+ {
+ return PARTICIPANT_STUB ;
+ }
+
+ /**
+ * Send a completion commit request.
+ * @param serviceURI The target service URI.
+ * @param coordinatorURI The coordinator URI.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void completionCommit(final String serviceURI, final String coordinatorURI)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendCompletionCommit(addressingContext, SOAP_DETAILS, coordinatorURI) ;
+ }
+
+ /**
+ * Send a completion rollback request.
+ * @param serviceURI The target service URI.
+ * @param coordinatorURI The coordinator URI.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void completionRollback(final String serviceURI, final String coordinatorURI)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendCompletionRollback(addressingContext, SOAP_DETAILS, coordinatorURI) ;
+ }
+
+ /**
+ * Send a commit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void commit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendCommit(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a rollback request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void rollback(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendRollback(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a phase2Rollback request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void phase2Rollback(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendPhase2Rollback(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a readonly request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void readonly(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendReadonly(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a volatileAndDurable request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void volatileAndDurable(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendVolatileAndDurable(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send an earlyReadonly request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void earlyReadonly(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendEarlyReadonly(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a earlyAborted request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void earlyAborted(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendEarlyAborted(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a replayCommit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void replayCommit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendReplayCommit(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a retryPreparedCommit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void retryPreparedCommit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendRetryPreparedCommit(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a retryPreparedAbort request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void retryPreparedAbort(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendRetryPreparedAbort(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a retryCommit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void retryCommit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendRetryCommit(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a preparedAfterTimeout request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void preparedAfterTimeout(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendPreparedAfterTimeout(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a lostCommitted request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void lostCommitted(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendLostCommitted(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/SyncParticipantStub.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/TestMessageType.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/TestMessageType.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/TestMessageType.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,70 @@
+/*
+ * 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.jboss.transaction.txinterop.webservices.atinterop;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.stax.ElementContent;
+
+/*
+ * <xsd:complexType name="TestMessageType">
+ * <xsd:sequence/>
+ * </xsd:complexType>
+ */
+/**
+ * Representation of the Test Message type.
+ * @author kevin
+ */
+public class TestMessageType extends ElementContent
+{
+ /**
+ * Default constructor.
+ */
+ public TestMessageType()
+ {
+ }
+
+ /**
+ * Construct a register response from the input stream.
+ *
+ * @param in The input stream.
+ * @throws XMLStreamException For errors during parsing.
+ */
+ public TestMessageType(final XMLStreamReader in)
+ throws XMLStreamException
+ {
+ parse(in) ;
+ }
+
+ /**
+ * Add the element.
+ * @param in The current input stream.
+ * @param elementName The qualified element name.
+ */
+ protected void putElement(final XMLStreamReader in,
+ final QName elementName)
+ throws XMLStreamException
+ {
+ throw new XMLStreamException("Unexpected element name: " + elementName) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/TestMessageType.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/AsyncParticipantClient.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/AsyncParticipantClient.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/AsyncParticipantClient.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,567 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.client;
+
+import java.io.IOException;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.SoapService;
+import com.arjuna.webservices.base.policy.ClientPolicy;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.stax.TextElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wsaddr2005.AttributedURIType;
+import com.arjuna.webservices.wsaddr2005.EndpointReferenceType;
+import com.arjuna.webservices.wsaddr2005.client.WSAddr2005Client;
+import com.arjuna.webservices.wsaddr2005.policy.AddressingPolicy;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.arjuna.webservices.wscoor11.policy.CoordinationContextPolicy;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+
+/**
+ * The participant client.
+ * @author kevin
+ */
+public class AsyncParticipantClient
+{
+ /**
+ * The client singleton.
+ */
+ private static final AsyncParticipantClient CLIENT = new AsyncParticipantClient() ;
+
+ /**
+ * The completion commit action.
+ */
+ private final String completionCommitAction = ATInteropConstants.INTEROP_ACTION_COMPLETION_COMMIT ;
+ /**
+ * The completion rollback Action.
+ */
+ private final String completionRollbackAction = ATInteropConstants.INTEROP_ACTION_COMPLETION_ROLLBACK ;
+ /**
+ * The commit Action.
+ */
+ private final String commitAction = ATInteropConstants.INTEROP_ACTION_COMMIT ;
+ /**
+ * The rollback Action.
+ */
+ private final String rollbackAction = ATInteropConstants.INTEROP_ACTION_ROLLBACK ;
+ /**
+ * The phase 2 rollback Action.
+ */
+ private final String phase2RollbackAction = ATInteropConstants.INTEROP_ACTION_PHASE_2_ROLLBACK ;
+ /**
+ * The readonly Action.
+ */
+ private final String readonlyAction = ATInteropConstants.INTEROP_ACTION_READONLY ;
+ /**
+ * The volatile and durable Action.
+ */
+ private final String volatileAndDurableAction = ATInteropConstants.INTEROP_ACTION_VOLATILE_AND_DURABLE ;
+ /**
+ * The early readonly Action.
+ */
+ private final String earlyReadonlyAction = ATInteropConstants.INTEROP_ACTION_EARLY_READONLY ;
+ /**
+ * The early aborted Action.
+ */
+ private final String earlyAbortedAction = ATInteropConstants.INTEROP_ACTION_EARLY_ABORTED ;
+ /**
+ * The replay commit Action.
+ */
+ private final String replayCommitAction = ATInteropConstants.INTEROP_ACTION_REPLAY_COMMIT ;
+ /**
+ * The retry prepared commit Action.
+ */
+ private final String retryPreparedCommitAction = ATInteropConstants.INTEROP_ACTION_RETRY_PREPARED_COMMIT ;
+ /**
+ * The retry prepared abort Action.
+ */
+ private final String retryPreparedAbortAction = ATInteropConstants.INTEROP_ACTION_RETRY_PREPARED_ABORT ;
+ /**
+ * The retry commit Action.
+ */
+ private final String retryCommitAction = ATInteropConstants.INTEROP_ACTION_RETRY_COMMIT ;
+ /**
+ * The prepared after timeout Action.
+ */
+ private final String preparedAfterTimeoutAction = ATInteropConstants.INTEROP_ACTION_PREPARED_AFTER_TIMEOUT ;
+ /**
+ * The lost committed Action.
+ */
+ private final String lostCommittedAction = ATInteropConstants.INTEROP_ACTION_LOST_COMMITTED ;
+
+ /**
+ * The SOAP service representing the client.
+ */
+ private final SoapService soapService ;
+ /**
+ * The initiator URI for replies.
+ */
+ private final EndpointReferenceType initiator ;
+
+ /**
+ * Construct the interop synch client.
+ */
+ private AsyncParticipantClient()
+ {
+ final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+ // Add WS-Addressing
+ AddressingPolicy.register(handlerRegistry) ;
+ // Add coordination context
+ CoordinationContextPolicy.register(handlerRegistry) ;
+ // Add client policies
+ ClientPolicy.register(handlerRegistry) ;
+
+ soapService = new SoapService(handlerRegistry) ;
+ final String initiatorURI = SoapRegistry.getRegistry().getServiceURI(ATInteropConstants.SERVICE_INITIATOR) ;
+ initiator = new EndpointReferenceType(new AttributedURIType(initiatorURI)) ;
+ }
+
+ /**
+ * Send a completion commit request.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @param coordinatorURI The coordinator URI.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendCompletionCommit(final AddressingContext addressingContext, final SoapDetails soapDetails, final String coordinatorURI)
+ throws SoapFault, IOException
+ {
+ final TextElement completionCommit = new TextElement(coordinatorURI) ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_COMPLETION_COMMIT, completionCommit) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(completionCommitAction) ;
+ addressingContext.setAction(new AttributedURIType(completionCommitAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+
+ /**
+ * Send a completion rollback request.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @param coordinatorURI The coordinator URI.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendCompletionRollback(final AddressingContext addressingContext, final SoapDetails soapDetails, final String coordinatorURI)
+ throws SoapFault, IOException
+ {
+ final TextElement completionRollback = new TextElement(coordinatorURI) ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_COMPLETION_ROLLBACK, completionRollback) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(completionRollbackAction) ;
+ addressingContext.setAction(new AttributedURIType(completionRollbackAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+
+ /**
+ * Send a commit request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendCommit(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType commit = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_COMMIT, commit) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(commitAction) ;
+ addressingContext.setAction(new AttributedURIType(commitAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a rollback request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendRollback(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType rollback = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_ROLLBACK, rollback) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(rollbackAction) ;
+ addressingContext.setAction(new AttributedURIType(rollbackAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a phase2Rollback request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendPhase2Rollback(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType phase2Rollback = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_PHASE_2_ROLLBACK, phase2Rollback) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(phase2RollbackAction) ;
+ addressingContext.setAction(new AttributedURIType(phase2RollbackAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a readonly request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendReadonly(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType readonly = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_READONLY, readonly) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(readonlyAction) ;
+ addressingContext.setAction(new AttributedURIType(readonlyAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a volatileAndDurable request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendVolatileAndDurable(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType volatileAndDurable = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_VOLATILE_AND_DURABLE, volatileAndDurable) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(volatileAndDurableAction) ;
+ addressingContext.setAction(new AttributedURIType(volatileAndDurableAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send an earlyReadonly request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendEarlyReadonly(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType earlyReadonly = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_EARLY_READONLY, earlyReadonly) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(earlyReadonlyAction) ;
+ addressingContext.setAction(new AttributedURIType(earlyReadonlyAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a earlyAborted request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendEarlyAborted(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType earlyAborted = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_EARLY_ABORTED, earlyAborted) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(earlyAbortedAction) ;
+ addressingContext.setAction(new AttributedURIType(earlyAbortedAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a replayCommit request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendReplayCommit(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType replayCommit = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_REPLAY_COMMIT, replayCommit) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(replayCommitAction) ;
+ addressingContext.setAction(new AttributedURIType(replayCommitAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a retryPreparedCommit request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendRetryPreparedCommit(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType retryPreparedCommit = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_PREPARED_COMMIT, retryPreparedCommit) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(retryPreparedCommitAction) ;
+ addressingContext.setAction(new AttributedURIType(retryPreparedCommitAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a retryPreparedAbort request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendRetryPreparedAbort(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType retryPreparedAbort = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_PREPARED_ABORT, retryPreparedAbort) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(retryPreparedAbortAction) ;
+ addressingContext.setAction(new AttributedURIType(retryPreparedAbortAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a retryCommit request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendRetryCommit(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType retryCommit = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_COMMIT, retryCommit) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(retryCommitAction) ;
+ addressingContext.setAction(new AttributedURIType(retryCommitAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a preparedAfterTimeout request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendPreparedAfterTimeout(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType preparedAfterTimeout = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_PREPARED_AFTER_TIMEOUT, preparedAfterTimeout) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(preparedAfterTimeoutAction) ;
+ addressingContext.setAction(new AttributedURIType(preparedAfterTimeoutAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a lostCommitted request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendLostCommitted(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType lostCommitted = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_LOST_COMMITTED, lostCommitted) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(lostCommittedAction) ;
+ addressingContext.setAction(new AttributedURIType(lostCommittedAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Get the Interop client singleton.
+ * @return The Interop client singleton.
+ */
+ public static AsyncParticipantClient getClient()
+ {
+ return CLIENT ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/AsyncParticipantClient.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/InitiatorClient.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/InitiatorClient.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/InitiatorClient.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,101 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.client;
+
+import java.io.IOException;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapService;
+import com.arjuna.webservices.base.policy.ClientPolicy;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wsaddr2005.AttributedURIType;
+import com.arjuna.webservices.wsaddr2005.client.WSAddr2005Client;
+import com.arjuna.webservices.wsaddr2005.policy.AddressingPolicy;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+
+/**
+ * The initiator client.
+ * @author kevin
+ */
+public class InitiatorClient
+{
+ /**
+ * The client singleton.
+ */
+ private static final InitiatorClient CLIENT = new InitiatorClient() ;
+
+ /**
+ * The response action.
+ */
+ private final String responseAction = ATInteropConstants.INTEROP_ACTION_RESPONSE ;
+
+ /**
+ * The SOAP service representing the client.
+ */
+ private final SoapService soapService ;
+
+ /**
+ * Construct the interop synch client.
+ */
+ private InitiatorClient()
+ {
+ final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+ // Add WS-Addressing
+ AddressingPolicy.register(handlerRegistry) ;
+ // Add client policies
+ ClientPolicy.register(handlerRegistry) ;
+
+ soapService = new SoapService(handlerRegistry) ;
+ }
+
+ /**
+ * Send a response.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendResponse(final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType response = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(responseAction) ;
+ addressingContext.setAction(new AttributedURIType(responseAction)) ;
+
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+
+ /**
+ * Send a fault.
+ * @param addressingContext The addressing context.
+ * @param soapDetails The SOAP details.
+ * @param soapFault The SOAP fault.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendSoapFault(final AddressingContext addressingContext, final SoapDetails soapDetails, final SoapFault soapFault)
+ throws SoapFault, IOException
+ {
+ final String soapFaultAction = soapFault.getAction() ;
+ if (soapFaultAction != null)
+ {
+ addressingContext.setAction(new AttributedURIType(soapFaultAction)) ;
+ }
+ WSAddr2005Client.sendSoapFault(soapFault, addressingContext, soapDetails, soapService) ;
+ }
+
+ /**
+ * Get the Interop client singleton.
+ * @return The Interop client singleton.
+ */
+ public static InitiatorClient getClient()
+ {
+ return CLIENT ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/InitiatorClient.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/SyncParticipantClient.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/SyncParticipantClient.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/SyncParticipantClient.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,571 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.client;
+
+import java.io.IOException;
+
+import javax.xml.namespace.QName;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.SoapService;
+import com.arjuna.webservices.base.policy.ClientPolicy;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.stax.TextElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wsaddr2005.AttributedURIType;
+import com.arjuna.webservices.wsaddr2005.client.WSAddr2005Client;
+import com.arjuna.webservices.wsaddr2005.policy.AddressingPolicy;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.arjuna.webservices.wscoor11.policy.CoordinationContextPolicy;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.policy.ATInitiatorPolicy;
+
+/**
+ * The participant client.
+ * @author kevin
+ */
+public class SyncParticipantClient
+{
+ /**
+ * The client singleton.
+ */
+ private static final SyncParticipantClient CLIENT = new SyncParticipantClient() ;
+
+ /**
+ * The completion commit action.
+ */
+ private final String completionCommitAction = ATInteropConstants.INTEROP_ACTION_COMPLETION_COMMIT ;
+ /**
+ * The completion rollback Action.
+ */
+ private final String completionRollbackAction = ATInteropConstants.INTEROP_ACTION_COMPLETION_ROLLBACK ;
+ /**
+ * The commit Action.
+ */
+ private final String commitAction = ATInteropConstants.INTEROP_ACTION_COMMIT ;
+ /**
+ * The rollback Action.
+ */
+ private final String rollbackAction = ATInteropConstants.INTEROP_ACTION_ROLLBACK ;
+ /**
+ * The phase 2 rollback Action.
+ */
+ private final String phase2RollbackAction = ATInteropConstants.INTEROP_ACTION_PHASE_2_ROLLBACK ;
+ /**
+ * The readonly Action.
+ */
+ private final String readonlyAction = ATInteropConstants.INTEROP_ACTION_READONLY ;
+ /**
+ * The volatile and durable Action.
+ */
+ private final String volatileAndDurableAction = ATInteropConstants.INTEROP_ACTION_VOLATILE_AND_DURABLE ;
+ /**
+ * The early readonly Action.
+ */
+ private final String earlyReadonlyAction = ATInteropConstants.INTEROP_ACTION_EARLY_READONLY ;
+ /**
+ * The early aborted Action.
+ */
+ private final String earlyAbortedAction = ATInteropConstants.INTEROP_ACTION_EARLY_ABORTED ;
+ /**
+ * The replay commit Action.
+ */
+ private final String replayCommitAction = ATInteropConstants.INTEROP_ACTION_REPLAY_COMMIT ;
+ /**
+ * The retry prepared commit Action.
+ */
+ private final String retryPreparedCommitAction = ATInteropConstants.INTEROP_ACTION_RETRY_PREPARED_COMMIT ;
+ /**
+ * The retry prepared abort Action.
+ */
+ private final String retryPreparedAbortAction = ATInteropConstants.INTEROP_ACTION_RETRY_PREPARED_ABORT ;
+ /**
+ * The retry commit Action.
+ */
+ private final String retryCommitAction = ATInteropConstants.INTEROP_ACTION_RETRY_COMMIT ;
+ /**
+ * The prepared after timeout Action.
+ */
+ private final String preparedAfterTimeoutAction = ATInteropConstants.INTEROP_ACTION_PREPARED_AFTER_TIMEOUT ;
+ /**
+ * The lost committed Action.
+ */
+ private final String lostCommittedAction = ATInteropConstants.INTEROP_ACTION_LOST_COMMITTED ;
+
+ /**
+ * The SOAP service representing the client.
+ */
+ private final SoapService soapService ;
+
+ /**
+ * Construct the interop synch client.
+ */
+ private SyncParticipantClient()
+ {
+ final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+ // Add WS-Addressing
+ AddressingPolicy.register(handlerRegistry) ;
+ // Add coordination context
+ CoordinationContextPolicy.register(handlerRegistry) ;
+ // Add the initiator policy
+ ATInitiatorPolicy.register(handlerRegistry) ;
+ // Add client policies
+ ClientPolicy.register(handlerRegistry) ;
+
+ soapService = new SoapService(handlerRegistry) ;
+ }
+
+ /**
+ * Send a completion commit request.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @param coordinatorURI The coordinator URI.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendCompletionCommit(final AddressingContext addressingContext, final SoapDetails soapDetails, final String coordinatorURI)
+ throws SoapFault, IOException
+ {
+ final TextElement completionCommit = new TextElement(coordinatorURI) ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_COMPLETION_COMMIT, completionCommit) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(completionCommitAction) ;
+ addressingContext.setAction(new AttributedURIType(completionCommitAction)) ;
+
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+
+ /**
+ * Send a completion rollback request.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @param coordinatorURI The coordinator URI.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendCompletionRollback(final AddressingContext addressingContext, final SoapDetails soapDetails, final String coordinatorURI)
+ throws SoapFault, IOException
+ {
+ final TextElement completionRollback = new TextElement(coordinatorURI) ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_COMPLETION_ROLLBACK, completionRollback) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(completionRollbackAction) ;
+ addressingContext.setAction(new AttributedURIType(completionRollbackAction)) ;
+
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+
+ /**
+ * Send a commit request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendCommit(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType commit = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_COMMIT, commit) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(commitAction) ;
+ addressingContext.setAction(new AttributedURIType(commitAction)) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a rollback request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendRollback(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType rollback = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_ROLLBACK, rollback) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(rollbackAction) ;
+ addressingContext.setAction(new AttributedURIType(rollbackAction)) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a phase2Rollback request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendPhase2Rollback(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType phase2Rollback = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_PHASE_2_ROLLBACK, phase2Rollback) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(phase2RollbackAction) ;
+ addressingContext.setAction(new AttributedURIType(phase2RollbackAction)) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a readonly request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendReadonly(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType readonly = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_READONLY, readonly) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(readonlyAction) ;
+ addressingContext.setAction(new AttributedURIType(readonlyAction)) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a volatileAndDurable request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendVolatileAndDurable(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType volatileAndDurable = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_VOLATILE_AND_DURABLE, volatileAndDurable) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(volatileAndDurableAction) ;
+ addressingContext.setAction(new AttributedURIType(volatileAndDurableAction)) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send an earlyReadonly request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendEarlyReadonly(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType earlyReadonly = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_EARLY_READONLY, earlyReadonly) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(earlyReadonlyAction) ;
+ addressingContext.setAction(new AttributedURIType(earlyReadonlyAction)) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a earlyAborted request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendEarlyAborted(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType earlyAborted = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_EARLY_ABORTED, earlyAborted) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(earlyAbortedAction) ;
+ addressingContext.setAction(new AttributedURIType(earlyAbortedAction)) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a replayCommit request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendReplayCommit(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType replayCommit = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_REPLAY_COMMIT, replayCommit) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(replayCommitAction) ;
+ addressingContext.setAction(new AttributedURIType(replayCommitAction)) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a retryPreparedCommit request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendRetryPreparedCommit(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType retryPreparedCommit = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_PREPARED_COMMIT, retryPreparedCommit) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(retryPreparedCommitAction) ;
+ addressingContext.setAction(new AttributedURIType(retryPreparedCommitAction)) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a retryPreparedAbort request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendRetryPreparedAbort(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType retryPreparedAbort = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_PREPARED_ABORT, retryPreparedAbort) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(retryPreparedAbortAction) ;
+ addressingContext.setAction(new AttributedURIType(retryPreparedAbortAction)) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a retryCommit request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendRetryCommit(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType retryCommit = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_COMMIT, retryCommit) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(retryCommitAction) ;
+ addressingContext.setAction(new AttributedURIType(retryCommitAction)) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a preparedAfterTimeout request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendPreparedAfterTimeout(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType preparedAfterTimeout = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_PREPARED_AFTER_TIMEOUT, preparedAfterTimeout) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(preparedAfterTimeoutAction) ;
+ addressingContext.setAction(new AttributedURIType(preparedAfterTimeoutAction)) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a lostCommitted request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendLostCommitted(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType lostCommitted = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_LOST_COMMITTED, lostCommitted) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(lostCommittedAction) ;
+ addressingContext.setAction(new AttributedURIType(lostCommittedAction)) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Process the response.
+ * @param soapBody The soap body.
+ * @return The response.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ private TestMessageType processResponse(final SoapBody soapBody)
+ throws SoapFault, IOException
+ {
+ if (soapBody != null)
+ {
+ final NamedElement responseElement = soapBody.getContents() ;
+ if (responseElement != null)
+ {
+ final QName responseName = responseElement.getName() ;
+ if (ATInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE.equals(responseName))
+ {
+ try
+ {
+ return (TestMessageType)responseElement.getElementContent() ;
+ }
+ catch (final ClassCastException cce)
+ {
+ throw new SoapFault(SoapFaultType.FAULT_RECEIVER, null, "Expected test message response type for element: " + responseName) ;
+ }
+ }
+ else
+ {
+ throw new SoapFault(SoapFaultType.FAULT_RECEIVER, null, "Unexpected response element: " + responseName) ;
+ }
+ }
+ }
+ return null ;
+ }
+
+ /**
+ * Get the Interop client singleton.
+ * @return The Interop client singleton.
+ */
+ public static SyncParticipantClient getClient()
+ {
+ return CLIENT ;
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/client/SyncParticipantClient.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/InitiatorResponseHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/InitiatorResponseHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/InitiatorResponseHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,42 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATInitiatorProcessor;
+
+/**
+ * The response handler.
+ * @author kevin
+ */
+public class InitiatorResponseHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+
+ ATInitiatorProcessor.getInitiator().handleResponse(message, addressingContext) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/InitiatorResponseHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/InitiatorSoapFaultHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/InitiatorSoapFaultHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/InitiatorSoapFaultHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,46 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATInitiatorProcessor;
+
+/**
+ * The SOAP fault handler.
+ * @author kevin
+ */
+public class InitiatorSoapFaultHandler implements 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
+ {
+ final SoapFault soapFault = soapDetails.parseSoapFault(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ ATInitiatorProcessor.getInitiator().handleSoapFault(soapFault, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/InitiatorSoapFaultHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCommitHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCommitHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCommitHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The commit handler.
+ * @author kevin
+ */
+public class ParticipantCommitHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ final TestMessageType response = ATParticipantProcessor.getParticipant().commit(message, coordinationContext, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, ATInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCommitHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCompletionCommitHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCompletionCommitHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCompletionCommitHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,46 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.stax.TextElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The completion commit handler.
+ * @author kevin
+ */
+public class ParticipantCompletionCommitHandler implements 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
+ {
+ final TextElement message = new TextElement(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+
+ final TestMessageType response = ATParticipantProcessor.getParticipant().completionCommit(message, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, ATInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCompletionCommitHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCompletionRollbackHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCompletionRollbackHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCompletionRollbackHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,46 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.stax.TextElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The completion rollback handler.
+ * @author kevin
+ */
+public class ParticipantCompletionRollbackHandler implements 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
+ {
+ final TextElement message = new TextElement(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+
+ final TestMessageType response = ATParticipantProcessor.getParticipant().completionRollback(message, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, ATInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantCompletionRollbackHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantEarlyAbortedHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantEarlyAbortedHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantEarlyAbortedHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The early aborted handler.
+ * @author kevin
+ */
+public class ParticipantEarlyAbortedHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ final TestMessageType response = ATParticipantProcessor.getParticipant().earlyAborted(message, coordinationContext, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, ATInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantEarlyAbortedHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantEarlyReadonlyHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantEarlyReadonlyHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantEarlyReadonlyHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The early readonly handler.
+ * @author kevin
+ */
+public class ParticipantEarlyReadonlyHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ final TestMessageType response = ATParticipantProcessor.getParticipant().earlyReadonly(message, coordinationContext, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, ATInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantEarlyReadonlyHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantLostCommittedHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantLostCommittedHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantLostCommittedHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The lost committed handler.
+ * @author kevin
+ */
+public class ParticipantLostCommittedHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ final TestMessageType response = ATParticipantProcessor.getParticipant().lostCommitted(message, coordinationContext, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, ATInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantLostCommittedHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantPhase2RollbackHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantPhase2RollbackHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantPhase2RollbackHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The phase 2 rollback handler.
+ * @author kevin
+ */
+public class ParticipantPhase2RollbackHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ final TestMessageType response = ATParticipantProcessor.getParticipant().phase2Rollback(message, coordinationContext, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, ATInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantPhase2RollbackHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantPreparedAfterTimeoutHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantPreparedAfterTimeoutHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantPreparedAfterTimeoutHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The prepared after timeout handler.
+ * @author kevin
+ */
+public class ParticipantPreparedAfterTimeoutHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ final TestMessageType response = ATParticipantProcessor.getParticipant().preparedAfterTimeout(message, coordinationContext, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, ATInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantPreparedAfterTimeoutHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantReadonlyHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantReadonlyHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantReadonlyHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The readonly handler.
+ * @author kevin
+ */
+public class ParticipantReadonlyHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ final TestMessageType response = ATParticipantProcessor.getParticipant().readonly(message, coordinationContext, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, ATInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantReadonlyHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantReplayCommitHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantReplayCommitHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantReplayCommitHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The replay commit handler.
+ * @author kevin
+ */
+public class ParticipantReplayCommitHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ final TestMessageType response = ATParticipantProcessor.getParticipant().replayCommit(message, coordinationContext, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, ATInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantReplayCommitHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryCommitHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryCommitHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryCommitHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The retry commit handler.
+ * @author kevin
+ */
+public class ParticipantRetryCommitHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ final TestMessageType response = ATParticipantProcessor.getParticipant().retryCommit(message, coordinationContext, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, ATInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryCommitHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryPreparedAbortHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryPreparedAbortHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryPreparedAbortHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The retry prepared abort handler.
+ * @author kevin
+ */
+public class ParticipantRetryPreparedAbortHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ final TestMessageType response = ATParticipantProcessor.getParticipant().retryPreparedAbort(message, coordinationContext, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, ATInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryPreparedAbortHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryPreparedCommitHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryPreparedCommitHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryPreparedCommitHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The retry prepared commit handler.
+ * @author kevin
+ */
+public class ParticipantRetryPreparedCommitHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ final TestMessageType response = ATParticipantProcessor.getParticipant().retryPreparedCommit(message, coordinationContext, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, ATInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRetryPreparedCommitHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRollbackHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRollbackHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRollbackHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The rollback handler.
+ * @author kevin
+ */
+public class ParticipantRollbackHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ final TestMessageType response = ATParticipantProcessor.getParticipant().rollback(message, coordinationContext, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, ATInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantRollbackHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantVolatileAndDurableHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantVolatileAndDurableHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantVolatileAndDurableHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATParticipantProcessor;
+
+/**
+ * The volatile and durable handler.
+ * @author kevin
+ */
+public class ParticipantVolatileAndDurableHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ final TestMessageType response = ATParticipantProcessor.getParticipant().volatileAndDurable(message, coordinationContext, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(ATInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, ATInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/handlers/ParticipantVolatileAndDurableHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitDurable2PCParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitDurable2PCParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitDurable2PCParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,22 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.participant;
+
+import com.arjuna.wst.Durable2PCParticipant;
+import com.arjuna.wst.Prepared;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.Vote;
+import com.arjuna.wst.WrongStateException;
+
+/**
+ * The commit durable 2PC participant
+ */
+public class CommitDurable2PCParticipant extends ParticipantAdapter implements Durable2PCParticipant
+{
+ /**
+ * Vote to prepare.
+ */
+ public Vote prepare()
+ throws WrongStateException, SystemException
+ {
+ return new Prepared() ;
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitDurable2PCParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitFailureDurable2PCParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitFailureDurable2PCParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitFailureDurable2PCParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,37 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.participant;
+
+import com.arjuna.wst.Durable2PCParticipant;
+import com.arjuna.wst.Prepared;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.Vote;
+import com.arjuna.wst.WrongStateException;
+
+/**
+ * The durable 2PC participant which fails the first call to commit.
+ */
+public class CommitFailureDurable2PCParticipant extends ParticipantAdapter implements Durable2PCParticipant
+{
+ /**
+ * The drop commit flag.
+ */
+ private boolean dropCommit ;
+
+ /**
+ * Vote to prepare.
+ */
+ public Vote prepare()
+ throws WrongStateException, SystemException
+ {
+ return new Prepared() ;
+ }
+
+ public void commit()
+ throws WrongStateException, SystemException
+ {
+ if (!dropCommit)
+ {
+ dropCommit = true ;
+ throw new IllegalStateException("Forced failure of commit") ;
+ }
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitFailureDurable2PCParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitFailureRecoveryDurable2PCParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitFailureRecoveryDurable2PCParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitFailureRecoveryDurable2PCParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,69 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.participant;
+
+import java.util.TimerTask;
+
+import com.arjuna.webservices.util.TransportTimer;
+import com.arjuna.wst.Durable2PCParticipant;
+import com.arjuna.wst.Prepared;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.Vote;
+import com.arjuna.wst.WrongStateException;
+import com.arjuna.wst.messaging.engines.Participant11Engine;
+
+/**
+ * The durable 2PC participant which fails the first call to commit and recovers.
+ */
+public class CommitFailureRecoveryDurable2PCParticipant extends ParticipantAdapter implements Durable2PCParticipant
+{
+ /**
+ * The participant engine.
+ */
+ private Participant11Engine engine ;
+ /**
+ * The set recovery flag.
+ */
+ private boolean setRecovery ;
+ /**
+ * The recovering flag.
+ */
+ private boolean recovering ;
+
+ /**
+ * Set the participant engine.
+ * @param engine The participant engine.
+ */
+ public void setEngine(final Participant11Engine engine)
+ {
+ this.engine = engine ;
+ }
+
+ /**
+ * Vote to prepare.
+ */
+ public Vote prepare()
+ throws WrongStateException, SystemException
+ {
+ return new Prepared() ;
+ }
+
+ public void commit()
+ throws WrongStateException, SystemException
+ {
+ if (!setRecovery)
+ {
+ setRecovery = true ;
+ final TimerTask timerTask = new TimerTask() {
+ public void run() {
+ recovering = true ;
+ engine.recovery() ;
+ }
+ } ;
+ TransportTimer.getTimer().schedule(timerTask, 2000) ;
+ }
+
+ if (!recovering)
+ {
+ throw new IllegalStateException("Forced failure of commit") ;
+ }
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitFailureRecoveryDurable2PCParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitVolatile2PCParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitVolatile2PCParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitVolatile2PCParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,22 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.participant;
+
+import com.arjuna.wst.Prepared;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.Volatile2PCParticipant;
+import com.arjuna.wst.Vote;
+import com.arjuna.wst.WrongStateException;
+
+/**
+ * The commit volatile 2PC participant
+ */
+public class CommitVolatile2PCParticipant extends ParticipantAdapter implements Volatile2PCParticipant
+{
+ /**
+ * Vote to prepare.
+ */
+ public Vote prepare()
+ throws WrongStateException, SystemException
+ {
+ return new Prepared() ;
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/CommitVolatile2PCParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/ParticipantAdapter.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/ParticipantAdapter.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/ParticipantAdapter.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,44 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.participant;
+
+import com.arjuna.wst.Participant;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.WrongStateException;
+
+/**
+ * The base participant adapter.
+ */
+public abstract class ParticipantAdapter implements Participant
+{
+ /**
+ * Commit the participant.
+ */
+ public void commit()
+ throws WrongStateException, SystemException
+ {
+ }
+
+ /**
+ * Rollback the participant.
+ */
+ public void rollback()
+ throws WrongStateException, SystemException
+ {
+ }
+
+ /**
+ * Handle an error on the participant.
+ */
+ public void error()
+ throws SystemException
+ {
+ }
+
+ /**
+ * Handle an unknown on the participant.
+ */
+ public void unknown()
+ throws SystemException
+ {
+ }
+
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/ParticipantAdapter.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/ReadonlyDurable2PCParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/ReadonlyDurable2PCParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/ReadonlyDurable2PCParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,22 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.participant;
+
+import com.arjuna.wst.Durable2PCParticipant;
+import com.arjuna.wst.ReadOnly;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.Vote;
+import com.arjuna.wst.WrongStateException;
+
+/**
+ * The readonly durable 2PC participant
+ */
+public class ReadonlyDurable2PCParticipant extends ParticipantAdapter implements Durable2PCParticipant
+{
+ /**
+ * Vote readonly.
+ */
+ public Vote prepare()
+ throws WrongStateException, SystemException
+ {
+ return new ReadOnly() ;
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/ReadonlyDurable2PCParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/RollbackDurable2PCParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/RollbackDurable2PCParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/RollbackDurable2PCParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,22 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.participant;
+
+import com.arjuna.wst.Aborted;
+import com.arjuna.wst.Durable2PCParticipant;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.Vote;
+import com.arjuna.wst.WrongStateException;
+
+/**
+ * The rollback durable 2PC participant
+ */
+public class RollbackDurable2PCParticipant extends ParticipantAdapter implements Durable2PCParticipant
+{
+ /**
+ * Vote to abort.
+ */
+ public Vote prepare()
+ throws WrongStateException, SystemException
+ {
+ return new Aborted() ;
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/RollbackDurable2PCParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/VolatileAndDurableDurable2PCParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/VolatileAndDurableDurable2PCParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/VolatileAndDurableDurable2PCParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,22 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.participant;
+
+import com.arjuna.wst.Durable2PCParticipant;
+import com.arjuna.wst.Prepared;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.Vote;
+import com.arjuna.wst.WrongStateException;
+
+/**
+ * The VolatileAndDurable durable 2PC participant
+ */
+public class VolatileAndDurableDurable2PCParticipant extends ParticipantAdapter implements Durable2PCParticipant
+{
+ /**
+ * Vote to prepare.
+ */
+ public Vote prepare()
+ throws WrongStateException, SystemException
+ {
+ return new Prepared() ;
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/VolatileAndDurableDurable2PCParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/VolatileAndDurableVolatile2PCParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/VolatileAndDurableVolatile2PCParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/VolatileAndDurableVolatile2PCParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,47 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.participant;
+
+import com.arjuna.ats.arjuna.common.Uid;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.arjuna.wst.ReadOnly;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.Volatile2PCParticipant;
+import com.arjuna.wst.Vote;
+import com.arjuna.wst.WrongStateException;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropUtil;
+
+/**
+ * The VolatileAndDurable volatile 2PC participant
+ */
+public class VolatileAndDurableVolatile2PCParticipant extends ParticipantAdapter implements Volatile2PCParticipant
+{
+ /**
+ * The current coordination context.
+ */
+ private final CoordinationContextType coordinationContext ;
+
+ /**
+ * Construct the participant.
+ * @param coordinationContext The coordination context.
+ */
+ public VolatileAndDurableVolatile2PCParticipant(final CoordinationContextType coordinationContext)
+ {
+ this.coordinationContext = coordinationContext ;
+ }
+
+ /**
+ * Vote to prepare.
+ */
+ public Vote prepare()
+ throws WrongStateException, SystemException
+ {
+ try
+ {
+ ATInteropUtil.registerDurable2PC(coordinationContext, new VolatileAndDurableDurable2PCParticipant(), new Uid().toString()) ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SystemException(th.getMessage()) ;
+ }
+ return new ReadOnly() ;
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/participant/VolatileAndDurableVolatile2PCParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/policy/ATInitiatorPolicy.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/policy/ATInitiatorPolicy.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/policy/ATInitiatorPolicy.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,34 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.policy;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.InitiatorResponseHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.InitiatorSoapFaultHandler;
+
+/**
+ * Policy responsible for binding in the WS-TX AT Interop participant server handlers.
+ * @author kevin
+ */
+public class ATInitiatorPolicy
+{
+ /**
+ * Add this policy to the registry.
+ * @param registry The registry containing the policy.
+ */
+ public static void register(final HandlerRegistry registry)
+ {
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, new InitiatorResponseHandler()) ;
+
+ registry.registerFaultHandler(new InitiatorSoapFaultHandler()) ;
+ }
+
+ /**
+ * Remove this policy from the registry.
+ * @param registry The registry containing the policy.
+ */
+ public static void remove(final HandlerRegistry registry)
+ {
+ registry.registerFaultHandler(null) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/policy/ATInitiatorPolicy.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/policy/ATParticipantPolicy.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/policy/ATParticipantPolicy.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/policy/ATParticipantPolicy.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,77 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.policy;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.arjuna.webservices.base.handlers.LoggingFaultHandler;
+import com.jboss.transaction.txinterop.webservices.InteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantCommitHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantCompletionCommitHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantCompletionRollbackHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantEarlyAbortedHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantEarlyReadonlyHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantLostCommittedHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantPhase2RollbackHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantPreparedAfterTimeoutHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantReadonlyHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantReplayCommitHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantRetryCommitHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantRetryPreparedAbortHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantRetryPreparedCommitHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantRollbackHandler;
+import com.jboss.transaction.txinterop.webservices.atinterop.handlers.ParticipantVolatileAndDurableHandler;
+
+/**
+ * Policy responsible for binding in the WS-TX AT Interop participant server handlers.
+ * @author kevin
+ */
+public class ATParticipantPolicy
+{
+ /**
+ * Add this policy to the registry.
+ * @param registry The registry containing the policy.
+ */
+ public static void register(final HandlerRegistry registry)
+ {
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_COMPLETION_COMMIT, new ParticipantCompletionCommitHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_COMPLETION_ROLLBACK, new ParticipantCompletionRollbackHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_COMMIT, new ParticipantCommitHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_ROLLBACK, new ParticipantRollbackHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_PHASE_2_ROLLBACK, new ParticipantPhase2RollbackHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_READONLY, new ParticipantReadonlyHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_VOLATILE_AND_DURABLE, new ParticipantVolatileAndDurableHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_EARLY_READONLY, new ParticipantEarlyReadonlyHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_EARLY_ABORTED, new ParticipantEarlyAbortedHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_REPLAY_COMMIT, new ParticipantReplayCommitHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_PREPARED_COMMIT, new ParticipantRetryPreparedCommitHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_PREPARED_ABORT, new ParticipantRetryPreparedAbortHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_COMMIT, new ParticipantRetryCommitHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_PREPARED_AFTER_TIMEOUT, new ParticipantPreparedAfterTimeoutHandler()) ;
+ registry.registerBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_LOST_COMMITTED, new ParticipantLostCommittedHandler()) ;
+
+ registry.registerFaultHandler(new LoggingFaultHandler(InteropConstants.SERVICE_PARTICIPANT)) ;
+ }
+
+ /**
+ * Remove this policy from the registry.
+ * @param registry The registry containing the policy.
+ */
+ public static void remove(final HandlerRegistry registry)
+ {
+ registry.registerFaultHandler(null) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_LOST_COMMITTED) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_PREPARED_AFTER_TIMEOUT) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_COMMIT) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_PREPARED_ABORT) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_RETRY_PREPARED_COMMIT) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_REPLAY_COMMIT) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_EARLY_ABORTED) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_EARLY_READONLY) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_VOLATILE_AND_DURABLE) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_READONLY) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_PHASE_2_ROLLBACK) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_ROLLBACK) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_COMMIT) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_COMPLETION_ROLLBACK) ;
+ registry.removeBodyHandler(ATInteropConstants.INTEROP_ELEMENT_QNAME_COMPLETION_COMMIT) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/policy/ATParticipantPolicy.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATInitiatorCallback.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATInitiatorCallback.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATInitiatorCallback.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+/*
+ * 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.jboss.transaction.txinterop.webservices.atinterop.processors;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.base.processors.Callback;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+
+/**
+ * The callback for the initiator client.
+ * @author kevin
+ */
+public abstract class ATInitiatorCallback extends Callback
+{
+ /**
+ * A response.
+ * @param response The response.
+ * @param addressingContext The current addressing context.
+ */
+ public abstract void response(final TestMessageType response,
+ final AddressingContext addressingContext) ;
+
+ /**
+ * A SOAP fault response.
+ * @param soapFault The SOAP fault response.
+ * @param addressingContext The current addressing context.
+ */
+ public abstract void soapFault(final SoapFault soapFault, final AddressingContext addressingContext) ;
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATInitiatorCallback.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATInitiatorProcessor.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATInitiatorProcessor.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATInitiatorProcessor.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,86 @@
+/*
+ * 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.jboss.transaction.txinterop.webservices.atinterop.processors;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.base.processors.Callback;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wsaddr2005.processor.BaseWSAddr2005ResponseProcessor;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+
+/**
+ * The Initiator processor.
+ * @author kevin
+ */
+public class ATInitiatorProcessor extends BaseWSAddr2005ResponseProcessor
+{
+ /**
+ * The initiator singleton.
+ */
+ private static final ATInitiatorProcessor INITIATOR = new ATInitiatorProcessor() ;
+
+ /**
+ * Get the initiator singleton.
+ * @return The singleton.
+ */
+ public static ATInitiatorProcessor getInitiator()
+ {
+ return INITIATOR ;
+ }
+
+ /**
+ * Handle a response response.
+ * @param response The response.
+ * @param addressingContext The current addressing context.
+ */
+ public void handleResponse(final TestMessageType response, final AddressingContext addressingContext)
+ {
+ handleCallbacks(new CallbackExecutorAdapter() {
+ public void execute(final Callback callback) {
+ ((ATInitiatorCallback)callback).response(response, addressingContext) ;
+ }
+ }, getIDs(addressingContext)) ;
+ }
+
+ /**
+ * Register a SOAP fault response.
+ * @param soapFault The SOAP fault response.
+ * @param addressingContext The current addressing context.
+ */
+ public void handleSoapFault(final SoapFault soapFault, final AddressingContext addressingContext)
+ {
+ handleCallbacks(new CallbackExecutorAdapter() {
+ public void execute(final Callback callback) {
+ ((ATInitiatorCallback)callback).soapFault(soapFault, addressingContext) ;
+ }
+ }, getIDs(addressingContext)) ;
+ }
+
+ /**
+ * Register a callback for the specific message id.
+ * @param messageID The message ID.
+ * @param callback The callback for the response.
+ */
+ public void registerCallback(final String messageID, final ATInitiatorCallback callback)
+ {
+ register(messageID, callback) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATInitiatorProcessor.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATParticipantProcessor.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATParticipantProcessor.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATParticipantProcessor.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,390 @@
+/*
+ * 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.jboss.transaction.txinterop.webservices.atinterop.processors;
+
+import com.arjuna.ats.arjuna.common.Uid;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.stax.TextElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.arjuna.wst.CompletionCoordinatorParticipant;
+import com.arjuna.wst.messaging.engines.Participant11Engine;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropUtil;
+import com.jboss.transaction.txinterop.webservices.atinterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.atinterop.participant.CommitDurable2PCParticipant;
+import com.jboss.transaction.txinterop.webservices.atinterop.participant.CommitFailureDurable2PCParticipant;
+import com.jboss.transaction.txinterop.webservices.atinterop.participant.CommitFailureRecoveryDurable2PCParticipant;
+import com.jboss.transaction.txinterop.webservices.atinterop.participant.CommitVolatile2PCParticipant;
+import com.jboss.transaction.txinterop.webservices.atinterop.participant.ReadonlyDurable2PCParticipant;
+import com.jboss.transaction.txinterop.webservices.atinterop.participant.RollbackDurable2PCParticipant;
+import com.jboss.transaction.txinterop.webservices.atinterop.participant.VolatileAndDurableVolatile2PCParticipant;
+
+/**
+ * The Participant processor.
+ * @author kevin
+ */
+public class ATParticipantProcessor
+{
+ /**
+ * The participant.
+ */
+ private static ATParticipantProcessor PARTICIPANT = new ATParticipantProcessor() ;
+
+ /**
+ * Get the participant.
+ * @return The participant.
+ */
+ public static ATParticipantProcessor getParticipant()
+ {
+ return PARTICIPANT ;
+ }
+
+ /**
+ * Execute the CompletionCommit
+ * @param completionCommit The completion commit request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType completionCommit(final TextElement completionCommit, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ final String coordinatorURI = completionCommit.getText() ;
+ try
+ {
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(coordinatorURI) ;
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.commit() ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SoapFault(th) ;
+ }
+ return new TestMessageType() ;
+ }
+
+ /**
+ * Execute the CompletionRollback
+ * @param completionRollback The completion rollback request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType completionRollback(final TextElement completionRollback, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ final String coordinatorURI = completionRollback.getText() ;
+ try
+ {
+ final CoordinationContextType context = ATInteropUtil.createCoordinationContext(coordinatorURI) ;
+ final CompletionCoordinatorParticipant participant = ATInteropUtil.registerCompletion(context, context.getIdentifier().getValue()) ;
+ participant.rollback() ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SoapFault(th) ;
+ }
+ return new TestMessageType() ;
+ }
+
+ /**
+ * Execute the Commit
+ * @param commit The commit request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType commit(final TestMessageType commit, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ try
+ {
+ ATInteropUtil.registerDurable2PC(coordinationContext, new CommitDurable2PCParticipant(), new Uid().toString()) ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SoapFault(th) ;
+ }
+ return new TestMessageType() ;
+ }
+
+ /**
+ * Execute the Rollback
+ * @param rollback The rollback request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType rollback(final TestMessageType rollback, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ try
+ {
+ ATInteropUtil.registerDurable2PC(coordinationContext, new RollbackDurable2PCParticipant(), new Uid().toString()) ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SoapFault(th) ;
+ }
+ return new TestMessageType() ;
+ }
+
+ /**
+ * Execute the Phase2Rollback
+ * @param phase2Rollback The phase 2 rollback request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType phase2Rollback(final TestMessageType phase2Rollback, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ try
+ {
+ ATInteropUtil.registerVolatile2PC(coordinationContext, new CommitVolatile2PCParticipant(), new Uid().toString()) ;
+ ATInteropUtil.registerDurable2PC(coordinationContext, new RollbackDurable2PCParticipant(), new Uid().toString()) ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SoapFault(th) ;
+ }
+ return new TestMessageType() ;
+ }
+
+ /**
+ * Execute the Readonly
+ * @param readonly The readonly request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType readonly(final TestMessageType readonly, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ try
+ {
+ ATInteropUtil.registerDurable2PC(coordinationContext, new ReadonlyDurable2PCParticipant(), new Uid().toString()) ;
+ ATInteropUtil.registerDurable2PC(coordinationContext, new CommitDurable2PCParticipant(), new Uid().toString()) ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SoapFault(th) ;
+ }
+ return new TestMessageType() ;
+ }
+
+ /**
+ * Execute the VolatileAndDurable
+ * @param volatileAndDurable The volatile and durable request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType volatileAndDurable(final TestMessageType volatileAndDurable, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ try
+ {
+ ATInteropUtil.registerVolatile2PC(coordinationContext, new VolatileAndDurableVolatile2PCParticipant(coordinationContext), new Uid().toString()) ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SoapFault(th) ;
+ }
+ return new TestMessageType() ;
+ }
+
+ /**
+ * Execute the EarlyReadonly
+ * @param earlyReadonly The early readonly request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType earlyReadonly(final TestMessageType earlyReadonly, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ try
+ {
+ final Participant11Engine engine = ATInteropUtil.registerVolatile2PC(coordinationContext, new CommitVolatile2PCParticipant(), new Uid().toString()) ;
+ ATInteropUtil.registerDurable2PC(coordinationContext, new CommitDurable2PCParticipant(), new Uid().toString()) ;
+ engine.earlyReadonly() ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SoapFault(th) ;
+ }
+ return new TestMessageType() ;
+ }
+
+ /**
+ * Execute the EarlyAborted
+ * @param earlyAborted The early aborted request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType earlyAborted(final TestMessageType earlyAborted, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ try
+ {
+ final Participant11Engine engine = ATInteropUtil.registerVolatile2PC(coordinationContext, new CommitVolatile2PCParticipant(), new Uid().toString()) ;
+ ATInteropUtil.registerDurable2PC(coordinationContext, new CommitDurable2PCParticipant(), new Uid().toString()) ;
+ engine.earlyRollback() ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SoapFault(th) ;
+ }
+ return new TestMessageType() ;
+ }
+
+ /**
+ * Execute the ReplayCommit
+ * @param replayCommit The replay commit request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType replayCommit(final TestMessageType replayCommit, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ try
+ {
+ final CommitFailureRecoveryDurable2PCParticipant participant = new CommitFailureRecoveryDurable2PCParticipant() ;
+ final Participant11Engine engine = ATInteropUtil.registerDurable2PC(coordinationContext, participant, new Uid().toString()) ;
+ participant.setEngine(engine) ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SoapFault(th) ;
+ }
+ return new TestMessageType() ;
+ }
+
+ /**
+ * Execute the RetryPreparedCommit
+ * @param retryPreparedCommit The retry prepared commit request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType retryPreparedCommit(final TestMessageType retryPreparedCommit, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ try
+ {
+ ATInteropUtil.registerDurable2PC(coordinationContext, new CommitDurable2PCParticipant(), new Uid().toString()) ;
+ ATInteropUtil.registerDurable2PC(coordinationContext, new CommitDurable2PCParticipant(), new Uid().toString()) ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SoapFault(th) ;
+ }
+ return new TestMessageType() ;
+ }
+
+ /**
+ * Execute the RetryPreparedAbort
+ * @param retryPreparedAbort The retry prepared abort request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType retryPreparedAbort(final TestMessageType retryPreparedAbort, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ try
+ {
+ ATInteropUtil.registerDurable2PC(coordinationContext, new CommitDurable2PCParticipant(), new Uid().toString()) ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SoapFault(th) ;
+ }
+ return new TestMessageType() ;
+ }
+
+ /**
+ * Execute the RetryCommit
+ * @param retryCommit The retry commit request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType retryCommit(final TestMessageType retryCommit, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ try
+ {
+ ATInteropUtil.registerDurable2PC(coordinationContext, new CommitFailureDurable2PCParticipant(), new Uid().toString()) ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SoapFault(th) ;
+ }
+ return new TestMessageType() ;
+ }
+
+ /**
+ * Execute the PreparedAfterTimeout
+ * @param preparedAfterTimeout The prepared after timeout request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType preparedAfterTimeout(final TestMessageType preparedAfterTimeout, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ try
+ {
+ ATInteropUtil.registerVolatile2PC(coordinationContext, new CommitVolatile2PCParticipant(), new Uid().toString()) ;
+ ATInteropUtil.registerDurable2PC(coordinationContext, new CommitDurable2PCParticipant(), new Uid().toString()) ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SoapFault(th) ;
+ }
+ return new TestMessageType() ;
+ }
+
+ /**
+ * Execute the LostCommitted
+ * @param lostCommitted The lost committed request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType lostCommitted(final TestMessageType lostCommitted, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ try
+ {
+ ATInteropUtil.registerDurable2PC(coordinationContext, new CommitFailureDurable2PCParticipant(), new Uid().toString()) ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SoapFault(th) ;
+ }
+ return new TestMessageType() ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/processors/ATParticipantProcessor.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/server/ATInitiatorInitialisation.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/server/ATInitiatorInitialisation.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/server/ATInitiatorInitialisation.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,44 @@
+package com.jboss.transaction.txinterop.webservices.atinterop.server;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.SoapService;
+import com.arjuna.webservices.wsaddr2005.policy.AddressingPolicy;
+import com.jboss.transaction.txinterop.webservices.atinterop.ATInteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.policy.ATInitiatorPolicy;
+
+/**
+ * Initialise the interop initiator service.
+ * @author kevin
+ */
+public class ATInitiatorInitialisation implements ServletContextListener
+{
+ /**
+ * The context has been initialized.
+ * @param servletContextEvent The servlet context event.
+ */
+ public void contextInitialized(final ServletContextEvent servletContextEvent)
+ {
+ final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+ // Add WS-Addressing
+ AddressingPolicy.register(handlerRegistry) ;
+ // Add endpoint
+ ATInitiatorPolicy.register(handlerRegistry) ;
+
+ final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+ soapRegistry.registerSoapService(ATInteropConstants.SERVICE_INITIATOR,
+ new SoapService(handlerRegistry)) ;
+ }
+
+ /**
+ * The context is about to be destroyed.
+ * @param servletContextEvent The servlet context event.
+ */
+ public void contextDestroyed(final ServletContextEvent servletContextEvent)
+ {
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/atinterop/server/ATInitiatorInitialisation.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/AsyncParticipantStub.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/AsyncParticipantStub.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/AsyncParticipantStub.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,463 @@
+package com.jboss.transaction.txinterop.webservices.bainterop;
+
+import java.io.IOException;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.soap.Soap11Details;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.arjuna.wsc.messaging.MessageId;
+import com.jboss.transaction.txinterop.webservices.bainterop.client.AsyncParticipantClient;
+import com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorCallback;
+import com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor;
+
+/**
+ * The participant stub.
+ */
+public class AsyncParticipantStub implements ParticipantStub
+{
+ /**
+ * The SOAP 1.1 details.
+ */
+ private static final SoapDetails SOAP_DETAILS = new Soap11Details() ;
+
+ /***
+ * The participant stub singletong.
+ */
+ private static final ParticipantStub PARTICIPANT_STUB = new AsyncParticipantStub() ;
+
+ /**
+ * Get the participant stub singleton.
+ * @return The participant stub singleton.
+ */
+ public static ParticipantStub getParticipantStub()
+ {
+ return PARTICIPANT_STUB ;
+ }
+
+ /**
+ * Send a cancel request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void cancel(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendCancel(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a exit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void exit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendExit(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a fail request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void fail(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendFail(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a cannotComplete request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void cannotComplete(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendCannotComplete(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a participantCompleteClose request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void participantCompleteClose(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendParticipantCompleteClose(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a coordinatorCompleteClose request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void coordinatorCompleteClose(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendCoordinatorCompleteClose(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a unsolicitedComplete request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void unsolicitedComplete(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendUnsolicitedComplete(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a compensate request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void compensate(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendCompensate(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a compensationFail request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void compensationFail(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendCompensationFail(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a participantCancelCompletedRace request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void participantCancelCompletedRace(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendParticipantCancelCompletedRace(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a messageLossAndRecovery request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void messageLossAndRecovery(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendMessageLossAndRecovery(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Send a mixedOutcome request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void mixedOutcome(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ final RequestCallback callback = new RequestCallback() ;
+ final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator() ;
+ initiator.registerCallback(messageId, callback) ;
+ try
+ {
+ AsyncParticipantClient.getClient().sendMixedOutcome(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ callback.waitUntilTriggered(15000) ;
+ }
+ finally
+ {
+ initiator.removeCallback(messageId) ;
+ }
+
+ handleCallback(callback) ;
+ }
+
+ /**
+ * Handle the callback.
+ * @param callback The callback.
+ * @throws SoapFault for errors.
+ */
+ private static void handleCallback(final RequestCallback callback)
+ throws SoapFault
+ {
+ if (callback.hasFailed())
+ {
+ throw new SoapFault(SoapFaultType.FAULT_RECEIVER, null, "Callback execution failed") ;
+ }
+ else if (!callback.hasTriggered())
+ {
+ throw new SoapFault(SoapFaultType.FAULT_RECEIVER, null, "Callback wasn't triggered") ;
+ }
+ else if (!callback.isResponse())
+ {
+ throw callback.getSoapFault() ;
+ }
+ }
+
+ /**
+ * The request callback class.
+ */
+ private static final class RequestCallback extends BAInitiatorCallback
+ {
+ /**
+ * The response flag.
+ */
+ private boolean response ;
+ /**
+ * The SOAP fault response.
+ */
+ private SoapFault soapFault ;
+
+ /**
+ * A response.
+ * @param response The response.
+ * @param addressingContext The current addressing context.
+ */
+ public void response(final TestMessageType response,
+ final AddressingContext addressingContext)
+ {
+ this.response = true ;
+ }
+
+ /**
+ * 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 ;
+ }
+
+ /**
+ * Was a response received?
+ * @return true if a response was received, false otherwise.
+ */
+ boolean isResponse()
+ {
+ return response ;
+ }
+
+ /**
+ * Get the SOAP fault.
+ * @return The SOAP fault or null.
+ */
+ SoapFault getSoapFault()
+ {
+ return soapFault ;
+ }
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/AsyncParticipantStub.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/BAInteropConstants.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/BAInteropConstants.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/BAInteropConstants.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,201 @@
+package com.jboss.transaction.txinterop.webservices.bainterop;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Interface containing WS-TX BA Interop constants.
+ */
+public interface BAInteropConstants
+{
+ /**
+ * The interop test initiator service name.
+ */
+ public String SERVICE_INITIATOR = "TX11BAInitiator" ;
+
+ /**
+ * The interop Namespace.
+ */
+ public String INTEROP_NAMESPACE = "http://fabrikam123.com/wsba" ;
+ /**
+ * The interop namespace prefix.
+ */
+ public String INTEROP_PREFIX = "bainterop" ;
+
+ /**
+ * The participant action prefix.
+ */
+ public String INTEROP_ACTION_PARTICIPANT_PREFIX = INTEROP_NAMESPACE + "/ParticipantPortType/" ;
+ /**
+ * The initiator action prefix.
+ */
+ public String INTEROP_ACTION_INITIATOR_PREFIX = INTEROP_NAMESPACE + "/InitiatorPortType/" ;
+
+ /**
+ * The Cancel element.
+ */
+ public String INTEROP_ELEMENT_CANCEL = "Cancel" ;
+ /**
+ * The Cancel QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_CANCEL = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_CANCEL, INTEROP_PREFIX) ;
+ /**
+ * The Cancel Action.
+ */
+ public String INTEROP_ACTION_CANCEL = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_CANCEL ;
+
+ /**
+ * The Exit element.
+ */
+ public String INTEROP_ELEMENT_EXIT = "Exit" ;
+ /**
+ * The Exit QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_EXIT = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_EXIT, INTEROP_PREFIX) ;
+ /**
+ * The Exit Action.
+ */
+ public String INTEROP_ACTION_EXIT = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_EXIT ;
+
+ /**
+ * The Fail element.
+ */
+ public String INTEROP_ELEMENT_FAIL = "Fail" ;
+ /**
+ * The Fail QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_FAIL = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_FAIL, INTEROP_PREFIX) ;
+ /**
+ * The Fail Action.
+ */
+ public String INTEROP_ACTION_FAIL = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_FAIL ;
+
+ /**
+ * The Cannot Complete element.
+ */
+ public String INTEROP_ELEMENT_CANNOT_COMPLETE = "CannotComplete" ;
+ /**
+ * The Cannot Complete QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_CANNOT_COMPLETE = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_CANNOT_COMPLETE, INTEROP_PREFIX) ;
+ /**
+ * The Cannot Complete Action.
+ */
+ public String INTEROP_ACTION_CANNOT_COMPLETE = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_CANNOT_COMPLETE ;
+
+ /**
+ * The Participant Complete Close element.
+ */
+ public String INTEROP_ELEMENT_PARTICIPANT_COMPLETE_CLOSE = "ParticipantCompleteClose" ;
+ /**
+ * The Participant Complete Close QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_PARTICIPANT_COMPLETE_CLOSE = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_PARTICIPANT_COMPLETE_CLOSE, INTEROP_PREFIX) ;
+ /**
+ * The Participant Complete Close Action.
+ */
+ public String INTEROP_ACTION_PARTICIPANT_COMPLETE_CLOSE = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_PARTICIPANT_COMPLETE_CLOSE ;
+
+ /**
+ * The Coordinator Complete Close element.
+ */
+ public String INTEROP_ELEMENT_COORDINATOR_COMPLETE_CLOSE = "CoordinatorCompleteClose" ;
+ /**
+ * The Coordinator Complete Close QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_COORDINATOR_COMPLETE_CLOSE = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_COORDINATOR_COMPLETE_CLOSE, INTEROP_PREFIX) ;
+ /**
+ * The Coordinator Complete Close Action.
+ */
+ public String INTEROP_ACTION_COORDINATOR_COMPLETE_CLOSE = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_COORDINATOR_COMPLETE_CLOSE ;
+
+ /**
+ * The Unsolicited Complete element.
+ */
+ public String INTEROP_ELEMENT_UNSOLICITED_COMPLETE = "UnsolicitedComplete" ;
+ /**
+ * The Unsolicited Complete QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_UNSOLICITED_COMPLETE = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_UNSOLICITED_COMPLETE, INTEROP_PREFIX) ;
+ /**
+ * The Unsolicited Complete Action.
+ */
+ public String INTEROP_ACTION_UNSOLICITED_COMPLETE = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_UNSOLICITED_COMPLETE ;
+
+ /**
+ * The Compensate element.
+ */
+ public String INTEROP_ELEMENT_COMPENSATE = "Compensate" ;
+ /**
+ * The Compensate QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_COMPENSATE = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_COMPENSATE, INTEROP_PREFIX) ;
+ /**
+ * The Compensate Action.
+ */
+ public String INTEROP_ACTION_COMPENSATE = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_COMPENSATE ;
+
+ /**
+ * The Compensation Fail element.
+ */
+ public String INTEROP_ELEMENT_COMPENSATION_FAIL = "CompensationFail" ;
+ /**
+ * The Compensation Fail QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_COMPENSATION_FAIL = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_COMPENSATION_FAIL, INTEROP_PREFIX) ;
+ /**
+ * The Compensation Fail Action.
+ */
+ public String INTEROP_ACTION_COMPENSATION_FAIL = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_COMPENSATION_FAIL ;
+
+ /**
+ * The Participant Cancel Completed Race element.
+ */
+ public String INTEROP_ELEMENT_PARTICIPANT_CANCEL_COMPLETED_RACE = "ParticipantCancelCompletedRace" ;
+ /**
+ * The Participant Cancel Completed Race QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_PARTICIPANT_CANCEL_COMPLETED_RACE = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_PARTICIPANT_CANCEL_COMPLETED_RACE, INTEROP_PREFIX) ;
+ /**
+ * The Participant Cancel Completed Race Action.
+ */
+ public String INTEROP_ACTION_PARTICIPANT_CANCEL_COMPLETED_RACE = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_PARTICIPANT_CANCEL_COMPLETED_RACE ;
+
+ /**
+ * The Message Loss And Recovery element.
+ */
+ public String INTEROP_ELEMENT_MESSAGE_LOSS_AND_RECOVERY = "MessageLossAndRecovery" ;
+ /**
+ * The Message Loss And Recovery QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_MESSAGE_LOSS_AND_RECOVERY = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_MESSAGE_LOSS_AND_RECOVERY, INTEROP_PREFIX) ;
+ /**
+ * The Message Loss And Recovery Action.
+ */
+ public String INTEROP_ACTION_MESSAGE_LOSS_AND_RECOVERY = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_MESSAGE_LOSS_AND_RECOVERY ;
+
+ /**
+ * The Mixed Outcome element.
+ */
+ public String INTEROP_ELEMENT_MIXED_OUTCOME = "MixedOutcome" ;
+ /**
+ * The Mixed Outcome QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_MIXED_OUTCOME = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_MIXED_OUTCOME, INTEROP_PREFIX) ;
+ /**
+ * The Mixed Outcome Action.
+ */
+ public String INTEROP_ACTION_MIXED_OUTCOME = INTEROP_ACTION_PARTICIPANT_PREFIX + INTEROP_ELEMENT_MIXED_OUTCOME ;
+
+ /**
+ * The response element.
+ */
+ public String INTEROP_ELEMENT_RESPONSE = "Response" ;
+ /**
+ * The response QName.
+ */
+ public QName INTEROP_ELEMENT_QNAME_RESPONSE = new QName(INTEROP_NAMESPACE, INTEROP_ELEMENT_RESPONSE, INTEROP_PREFIX) ;
+ /**
+ * The response Action.
+ */
+ public String INTEROP_ACTION_RESPONSE = INTEROP_ACTION_INITIATOR_PREFIX + INTEROP_ELEMENT_RESPONSE ;
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/BAInteropConstants.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/BAInteropUtil.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/BAInteropUtil.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/BAInteropUtil.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,174 @@
+package com.jboss.transaction.txinterop.webservices.bainterop;
+
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.wsaddr2005.AttributedURIType;
+import com.arjuna.webservices.wsaddr2005.EndpointReferenceType;
+import com.arjuna.webservices.wsba11.BusinessActivityConstants;
+import com.arjuna.webservices.wsba11.processors.CoordinatorCompletionParticipantProcessor;
+import com.arjuna.webservices.wsba11.processors.ParticipantCompletionParticipantProcessor;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.arjuna.webservices.wsjboss.InstanceIdentifier;
+import com.arjuna.webservices.wsjbosstx.JBossTXConstants;
+import com.arjuna.wsc.ActivationCoordinator11;
+import com.arjuna.wsc.RegistrationCoordinator11;
+import com.arjuna.wsc.messaging.MessageId;
+import com.arjuna.wst.BusinessActivityTerminator;
+import com.arjuna.wst.BusinessAgreementWithCoordinatorCompletionParticipant;
+import com.arjuna.wst.BusinessAgreementWithParticipantCompletionParticipant;
+import com.arjuna.wst.messaging.engines.CoordinatorCompletionParticipant11Engine;
+import com.arjuna.wst.messaging.engines.ParticipantCompletionParticipant11Engine;
+import com.arjuna.wst.stub.BusinessActivityTerminator11Stub;
+
+/**
+ * Utility methods
+ */
+public class BAInteropUtil
+{
+ /**
+ * Get an atomic outcome coordination context.
+ * @param coordinatorURI The coordinator URI.
+ * @return The coordination context.
+ * @throws Exception for errors.
+ */
+ public static CoordinationContextType createAtomicOutcomeCoordinationContext(final String coordinatorURI)
+ throws Exception
+ {
+ return createCoordinationContext(coordinatorURI, BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME) ;
+ }
+
+ /**
+ * Get a mixed outcome coordination context.
+ * @param coordinatorURI The coordinator URI.
+ * @return The coordination context.
+ * @throws Exception for errors.
+ */
+ public static CoordinationContextType createMixedOutcomeCoordinationContext(final String coordinatorURI)
+ throws Exception
+ {
+ return createCoordinationContext(coordinatorURI, BusinessActivityConstants.WSBA_PROTOCOL_MIXED_OUTCOME) ;
+ }
+
+ /**
+ * Get a coordination context for the specified protocol.
+ * @param coordinatorURI The coordinator URI.
+ * @param protocol The coordination protocol.
+ * @return The coordination context.
+ * @throws Exception for errors.
+ */
+ private static CoordinationContextType createCoordinationContext(final String coordinatorURI, final String protocol)
+ throws Exception
+ {
+ return ActivationCoordinator11.createCoordinationContext(coordinatorURI, MessageId.getMessageId(), protocol, null, null) ;
+ }
+
+ /**
+ * Register terminator.
+ * @param context The coordination context.
+ * @param id The id of the terminator.
+ * @return The endpoint for communicating with the coordinator.
+ * @throws Exception for errors.
+ */
+ public static BusinessActivityTerminator registerTerminator(final CoordinationContextType context, final String id)
+ throws Exception
+ {
+ final EndpointReferenceType completionCoordinator = register(context, getTerminatorParticipant(id), JBossTXConstants.WSJBOSSTX_PROTOCOL_TERMINATION) ;
+ return new BusinessActivityTerminator11Stub(id, completionCoordinator);
+ }
+
+ /**
+ * Register a participant completion participant in the specified coordination context.
+ * @param context The coordination context.
+ * @param participant The durable 2PC participant
+ * @param id The participant id.
+ * @return The participant engine.
+ * @throws Exception for errors.
+ */
+ public static ParticipantCompletionParticipant11Engine registerParticipantCompletion(final CoordinationContextType context,
+ final BusinessAgreementWithParticipantCompletionParticipant participant, final String id)
+ throws Exception
+ {
+ final EndpointReferenceType coordinator = RegistrationCoordinator11.register(context, MessageId.getMessageId(),
+ getParticipantCompletionParticipant(id), BusinessActivityConstants.WSBA_SUB_PROTOCOL_PARTICIPANT_COMPLETION) ;
+ final ParticipantCompletionParticipant11Engine engine = new ParticipantCompletionParticipant11Engine(id, coordinator, participant) ;
+ ParticipantCompletionParticipantProcessor.getProcessor().activateParticipant(engine, id) ;
+ return engine ;
+ }
+
+ /**
+ * Register a coordinator completion participant in the specified coordination context.
+ * @param context The coordination context.
+ * @param participant The durable 2PC participant
+ * @param id The participant id.
+ * @return The participant engine.
+ * @throws Exception for errors.
+ */
+ public static CoordinatorCompletionParticipant11Engine registerCoordinatorCompletion(final CoordinationContextType context,
+ final BusinessAgreementWithCoordinatorCompletionParticipant participant, final String id)
+ throws Exception
+ {
+ final EndpointReferenceType coordinator = RegistrationCoordinator11.register(context, MessageId.getMessageId(),
+ getCoordinatorCompletionParticipant(id), BusinessActivityConstants.WSBA_SUB_PROTOCOL_COORDINATOR_COMPLETION) ;
+ final CoordinatorCompletionParticipant11Engine engine = new CoordinatorCompletionParticipant11Engine(id, coordinator, participant) ;
+ CoordinatorCompletionParticipantProcessor.getProcessor().activateParticipant(engine, id) ;
+ return engine ;
+ }
+
+ /**
+ * Register for a sub protocol.
+ * @param context The coordination context.
+ * @param participant The participant EPR.
+ * @param protocol The protocol.
+ * @return The coordinator endpoint.
+ * @throws Exception for errors.
+ */
+ private static EndpointReferenceType register(final CoordinationContextType context, final EndpointReferenceType participant, final String protocol)
+ throws Exception
+ {
+ return RegistrationCoordinator11.register(context, MessageId.getMessageId(), participant, protocol) ;
+ }
+
+ /**
+ * Get the endpoint reference for a terminator participant.
+ * @param id The participant id.
+ * @return The endpoint reference.
+ */
+ private static EndpointReferenceType getTerminatorParticipant(final String id)
+ {
+ return getEndpointReference(JBossTXConstants.SERVICE_TERMINATION_PARTICIPANT, id) ;
+ }
+
+ /**
+ * Get the endpoint reference for a participant completion participant.
+ * @param id The participant id.
+ * @return The endpoint reference.
+ */
+ private static EndpointReferenceType getParticipantCompletionParticipant(final String id)
+ {
+ return getEndpointReference(BusinessActivityConstants.SERVICE_PARTICIPANT_COMPLETION_PARTICIPANT, id) ;
+ }
+
+ /**
+ * Get the endpoint reference for a coordinator completion participant.
+ * @param id The participant id.
+ * @return The endpoint reference.
+ */
+ private static EndpointReferenceType getCoordinatorCompletionParticipant(final String id)
+ {
+ return getEndpointReference(BusinessActivityConstants.SERVICE_COORDINATOR_COMPLETION_PARTICIPANT, id) ;
+ }
+
+ /**
+ * Get the endpoint reference for a service.
+ * @param service The service.
+ * @param id The service id.
+ * @return The endpoint reference.
+ */
+ private static EndpointReferenceType getEndpointReference(final String service, final String id)
+ {
+ final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+ final String serviceURI = soapRegistry.getServiceURI(service) ;
+ final EndpointReferenceType participant = new EndpointReferenceType(new AttributedURIType(serviceURI)) ;
+ InstanceIdentifier.setEndpointInstanceIdentifier(participant, id) ;
+ return participant ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/BAInteropUtil.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/ParticipantStub.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/ParticipantStub.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/ParticipantStub.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,132 @@
+package com.jboss.transaction.txinterop.webservices.bainterop;
+
+import java.io.IOException;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+
+/**
+ * The interface for the participant stub.
+ */
+public interface ParticipantStub
+{
+ /**
+ * Send a cancel request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void cancel(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a exit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void exit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a fail request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void fail(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a cannotComplete request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void cannotComplete(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a participantCompleteClose request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void participantCompleteClose(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a coordinatorCompleteClose request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void coordinatorCompleteClose(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a unsolicitedComplete request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void unsolicitedComplete(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a compensate request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void compensate(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a compensationFail request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void compensationFail(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a participantCancelCompletedRace request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void participantCancelCompletedRace(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a messageLossAndRecovery request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void messageLossAndRecovery(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+
+ /**
+ * Send a mixedOutcome request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void mixedOutcome(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException ;
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/ParticipantStub.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/SyncParticipantStub.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/SyncParticipantStub.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/SyncParticipantStub.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,228 @@
+package com.jboss.transaction.txinterop.webservices.bainterop;
+
+import java.io.IOException;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.Soap11Details;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.arjuna.wsc.messaging.MessageId;
+import com.jboss.transaction.txinterop.webservices.bainterop.client.SyncParticipantClient;
+
+/**
+ * The participant stub.
+ */
+public class SyncParticipantStub implements ParticipantStub
+{
+ /**
+ * The SOAP 1.1 details.
+ */
+ private static final SoapDetails SOAP_DETAILS = new Soap11Details() ;
+
+ /***
+ * The participant stub singletong.
+ */
+ private static final ParticipantStub PARTICIPANT_STUB = new SyncParticipantStub() ;
+
+ /**
+ * Get the participant stub singleton.
+ * @return The participant stub singleton.
+ */
+ public static ParticipantStub getParticipantStub()
+ {
+ return PARTICIPANT_STUB ;
+ }
+
+ /**
+ * Send a cancel request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void cancel(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendCancel(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a exit request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void exit(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendExit(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a fail request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void fail(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendFail(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a cannotComplete request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void cannotComplete(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendCannotComplete(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a participantCompleteClose request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void participantCompleteClose(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendParticipantCompleteClose(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a coordinatorCompleteClose request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void coordinatorCompleteClose(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendCoordinatorCompleteClose(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a unsolicitedComplete request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void unsolicitedComplete(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendUnsolicitedComplete(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a compensate request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void compensate(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendCompensate(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a compensationFail request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void compensationFail(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendCompensationFail(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a participantCancelCompletedRace request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void participantCancelCompletedRace(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendParticipantCancelCompletedRace(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a messageLossAndRecovery request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void messageLossAndRecovery(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendMessageLossAndRecovery(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+
+ /**
+ * Send a mixedOutcome request.
+ * @param serviceURI The target service URI.
+ * @param coordinationContext The coordination context.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void mixedOutcome(final String serviceURI, final CoordinationContextType coordinationContext)
+ throws SoapFault, IOException
+ {
+ final String messageId = MessageId.getMessageId() ;
+ final AddressingContext addressingContext = AddressingContext.createRequestContext(serviceURI, messageId) ;
+
+ SyncParticipantClient.getClient().sendMixedOutcome(coordinationContext, addressingContext, SOAP_DETAILS) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/SyncParticipantStub.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/TestMessageType.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/TestMessageType.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/TestMessageType.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,70 @@
+/*
+ * 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.jboss.transaction.txinterop.webservices.bainterop;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.stax.ElementContent;
+
+/*
+ * <xsd:complexType name="TestMessageType">
+ * <xsd:sequence/>
+ * </xsd:complexType>
+ */
+/**
+ * Representation of the Test Message type.
+ * @author kevin
+ */
+public class TestMessageType extends ElementContent
+{
+ /**
+ * Default constructor.
+ */
+ public TestMessageType()
+ {
+ }
+
+ /**
+ * Construct a register response from the input stream.
+ *
+ * @param in The input stream.
+ * @throws XMLStreamException For errors during parsing.
+ */
+ public TestMessageType(final XMLStreamReader in)
+ throws XMLStreamException
+ {
+ parse(in) ;
+ }
+
+ /**
+ * Add the element.
+ * @param in The current input stream.
+ * @param elementName The qualified element name.
+ */
+ protected void putElement(final XMLStreamReader in,
+ final QName elementName)
+ throws XMLStreamException
+ {
+ throw new XMLStreamException("Unexpected element name: " + elementName) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/TestMessageType.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/AsyncParticipantClient.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/AsyncParticipantClient.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/AsyncParticipantClient.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,480 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.client;
+
+import java.io.IOException;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.SoapService;
+import com.arjuna.webservices.base.policy.ClientPolicy;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wsaddr2005.AttributedURIType;
+import com.arjuna.webservices.wsaddr2005.EndpointReferenceType;
+import com.arjuna.webservices.wsaddr2005.client.WSAddr2005Client;
+import com.arjuna.webservices.wsaddr2005.policy.AddressingPolicy;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.arjuna.webservices.wscoor11.policy.CoordinationContextPolicy;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+
+/**
+ * The participant client.
+ * @author kevin
+ */
+public class AsyncParticipantClient
+{
+ /**
+ * The client singleton.
+ */
+ private static final AsyncParticipantClient CLIENT = new AsyncParticipantClient() ;
+
+ /**
+ * The cancel action.
+ */
+ private final String cancelAction = BAInteropConstants.INTEROP_ACTION_CANCEL ;
+ /**
+ * The exit action.
+ */
+ private final String exitAction = BAInteropConstants.INTEROP_ACTION_EXIT ;
+ /**
+ * The fail action.
+ */
+ private final String failAction = BAInteropConstants.INTEROP_ACTION_FAIL ;
+ /**
+ * The cannot complete action.
+ */
+ private final String cannotCompleteAction = BAInteropConstants.INTEROP_ACTION_CANNOT_COMPLETE ;
+ /**
+ * The participant complete close action.
+ */
+ private final String participantCompleteCloseAction = BAInteropConstants.INTEROP_ACTION_PARTICIPANT_COMPLETE_CLOSE ;
+ /**
+ * The coordinator complete close action.
+ */
+ private final String coordinatorCompleteCloseAction = BAInteropConstants.INTEROP_ACTION_COORDINATOR_COMPLETE_CLOSE ;
+ /**
+ * The unsolicited complete action.
+ */
+ private final String unsolicitedCompleteAction = BAInteropConstants.INTEROP_ACTION_UNSOLICITED_COMPLETE ;
+ /**
+ * The compensate action.
+ */
+ private final String compensateAction = BAInteropConstants.INTEROP_ACTION_COMPENSATE ;
+ /**
+ * The compensation fail action.
+ */
+ private final String participantCompensationFailAction = BAInteropConstants.INTEROP_ACTION_COMPENSATION_FAIL ;
+ /**
+ * The participant cancel completed race action.
+ */
+ private final String participantCancelCompletedRaceAction = BAInteropConstants.INTEROP_ACTION_PARTICIPANT_CANCEL_COMPLETED_RACE ;
+ /**
+ * The message loss and recovery action.
+ */
+ private final String messageLossAndRecoveryAction = BAInteropConstants.INTEROP_ACTION_MESSAGE_LOSS_AND_RECOVERY ;
+ /**
+ * The mixed outcome action.
+ */
+ private final String mixedOutcomeAction = BAInteropConstants.INTEROP_ACTION_MIXED_OUTCOME ;
+
+ /**
+ * The SOAP service representing the client.
+ */
+ private final SoapService soapService ;
+ /**
+ * The initiator URI for replies.
+ */
+ private final EndpointReferenceType initiator ;
+
+ /**
+ * Construct the interop synch client.
+ */
+ private AsyncParticipantClient()
+ {
+ final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+ // Add WS-Addressing
+ AddressingPolicy.register(handlerRegistry) ;
+ // Add coordination context
+ CoordinationContextPolicy.register(handlerRegistry) ;
+ // Add client policies
+ ClientPolicy.register(handlerRegistry) ;
+
+ soapService = new SoapService(handlerRegistry) ;
+ final String initiatorURI = SoapRegistry.getRegistry().getServiceURI(BAInteropConstants.SERVICE_INITIATOR) ;
+ initiator = new EndpointReferenceType(new AttributedURIType(initiatorURI)) ;
+ }
+
+ /**
+ * Send a cancel request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendCancel(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType cancel = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_CANCEL, cancel) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(cancelAction) ;
+ addressingContext.setAction(new AttributedURIType(cancelAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a exit request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendExit(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType exit = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_EXIT, exit) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(exitAction) ;
+ addressingContext.setAction(new AttributedURIType(exitAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a fail request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendFail(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType fail = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_FAIL, fail) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(failAction) ;
+ addressingContext.setAction(new AttributedURIType(failAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a cannot complete request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendCannotComplete(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType cannotComplete = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_CANNOT_COMPLETE, cannotComplete) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(cannotCompleteAction) ;
+ addressingContext.setAction(new AttributedURIType(cannotCompleteAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a participant complete close request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendParticipantCompleteClose(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType participantCompleteClose = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_COMPLETE_CLOSE, participantCompleteClose) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(participantCompleteCloseAction) ;
+ addressingContext.setAction(new AttributedURIType(participantCompleteCloseAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a coordinator complete close request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendCoordinatorCompleteClose(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType coordinatorCompleteClose = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_COORDINATOR_COMPLETE_CLOSE, coordinatorCompleteClose) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(coordinatorCompleteCloseAction) ;
+ addressingContext.setAction(new AttributedURIType(coordinatorCompleteCloseAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a unsolicited complete request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendUnsolicitedComplete(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType unsolicitedComplete = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_UNSOLICITED_COMPLETE, unsolicitedComplete) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(unsolicitedCompleteAction) ;
+ addressingContext.setAction(new AttributedURIType(unsolicitedCompleteAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a compensate request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendCompensate(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType compensate = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_COMPENSATE, compensate) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(compensateAction) ;
+ addressingContext.setAction(new AttributedURIType(compensateAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a compensation fail request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendCompensationFail(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType participantCompensationFail = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_COMPENSATION_FAIL, participantCompensationFail) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(participantCompensationFailAction) ;
+ addressingContext.setAction(new AttributedURIType(participantCompensationFailAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a participant cancel completed race request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendParticipantCancelCompletedRace(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType participantCancelCompletedRace = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_CANCEL_COMPLETED_RACE, participantCancelCompletedRace) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(participantCancelCompletedRaceAction) ;
+ addressingContext.setAction(new AttributedURIType(participantCancelCompletedRaceAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a message loss and recovery request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendMessageLossAndRecovery(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType messageLossAndRecovery = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_MESSAGE_LOSS_AND_RECOVERY, messageLossAndRecovery) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(messageLossAndRecoveryAction) ;
+ addressingContext.setAction(new AttributedURIType(messageLossAndRecoveryAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a mixed outcome request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendMixedOutcome(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType mixedOutcome = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_MIXED_OUTCOME, mixedOutcome) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(mixedOutcomeAction) ;
+ addressingContext.setAction(new AttributedURIType(mixedOutcomeAction)) ;
+
+ addressingContext.setReplyTo(initiator) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Get the Interop client singleton.
+ * @return The Interop client singleton.
+ */
+ public static AsyncParticipantClient getClient()
+ {
+ return CLIENT ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/AsyncParticipantClient.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/InitiatorClient.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/InitiatorClient.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/InitiatorClient.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,101 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.client;
+
+import java.io.IOException;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapService;
+import com.arjuna.webservices.base.policy.ClientPolicy;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wsaddr2005.AttributedURIType;
+import com.arjuna.webservices.wsaddr2005.client.WSAddr2005Client;
+import com.arjuna.webservices.wsaddr2005.policy.AddressingPolicy;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+
+/**
+ * The initiator client.
+ * @author kevin
+ */
+public class InitiatorClient
+{
+ /**
+ * The client singleton.
+ */
+ private static final InitiatorClient CLIENT = new InitiatorClient() ;
+
+ /**
+ * The response action.
+ */
+ private final String responseAction = BAInteropConstants.INTEROP_ACTION_RESPONSE ;
+
+ /**
+ * The SOAP service representing the client.
+ */
+ private final SoapService soapService ;
+
+ /**
+ * Construct the interop synch client.
+ */
+ private InitiatorClient()
+ {
+ final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+ // Add WS-Addressing
+ AddressingPolicy.register(handlerRegistry) ;
+ // Add client policies
+ ClientPolicy.register(handlerRegistry) ;
+
+ soapService = new SoapService(handlerRegistry) ;
+ }
+
+ /**
+ * Send a response.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendResponse(final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType response = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(responseAction) ;
+ addressingContext.setAction(new AttributedURIType(responseAction)) ;
+
+ WSAddr2005Client.sendOneWay(soapBody, addressingContext, soapDetails, soapService) ;
+ }
+
+ /**
+ * Send a fault.
+ * @param addressingContext The addressing context.
+ * @param soapDetails The SOAP details.
+ * @param soapFault The SOAP fault.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public void sendSoapFault(final AddressingContext addressingContext, final SoapDetails soapDetails, final SoapFault soapFault)
+ throws SoapFault, IOException
+ {
+ final String soapFaultAction = soapFault.getAction() ;
+ if (soapFaultAction != null)
+ {
+ addressingContext.setAction(new AttributedURIType(soapFaultAction)) ;
+ }
+ WSAddr2005Client.sendSoapFault(soapFault, addressingContext, soapDetails, soapService) ;
+ }
+
+ /**
+ * Get the Interop client singleton.
+ * @return The Interop client singleton.
+ */
+ public static InitiatorClient getClient()
+ {
+ return CLIENT ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/InitiatorClient.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/SyncParticipantClient.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/SyncParticipantClient.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/SyncParticipantClient.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,492 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.client;
+
+import java.io.IOException;
+
+import javax.xml.namespace.QName;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.SoapService;
+import com.arjuna.webservices.base.policy.ClientPolicy;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wsaddr2005.AttributedURIType;
+import com.arjuna.webservices.wsaddr2005.EndpointReferenceType;
+import com.arjuna.webservices.wsaddr2005.client.WSAddr2005Client;
+import com.arjuna.webservices.wsaddr2005.policy.AddressingPolicy;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.arjuna.webservices.wscoor11.policy.CoordinationContextPolicy;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.bainterop.policy.BAInitiatorPolicy;
+
+/**
+ * The participant client.
+ * @author kevin
+ */
+public class SyncParticipantClient
+{
+ /**
+ * The client singleton.
+ */
+ private static final SyncParticipantClient CLIENT = new SyncParticipantClient() ;
+
+ /**
+ * The cancel action.
+ */
+ private final String cancelAction = BAInteropConstants.INTEROP_ACTION_CANCEL ;
+ /**
+ * The exit action.
+ */
+ private final String exitAction = BAInteropConstants.INTEROP_ACTION_EXIT ;
+ /**
+ * The fail action.
+ */
+ private final String failAction = BAInteropConstants.INTEROP_ACTION_FAIL ;
+ /**
+ * The cannot complete action.
+ */
+ private final String cannotCompleteAction = BAInteropConstants.INTEROP_ACTION_CANNOT_COMPLETE ;
+ /**
+ * The participant complete close action.
+ */
+ private final String participantCompleteCloseAction = BAInteropConstants.INTEROP_ACTION_PARTICIPANT_COMPLETE_CLOSE ;
+ /**
+ * The coordinator complete close action.
+ */
+ private final String coordinatorCompleteCloseAction = BAInteropConstants.INTEROP_ACTION_COORDINATOR_COMPLETE_CLOSE ;
+ /**
+ * The unsolicited complete action.
+ */
+ private final String unsolicitedCompleteAction = BAInteropConstants.INTEROP_ACTION_UNSOLICITED_COMPLETE ;
+ /**
+ * The compensate action.
+ */
+ private final String compensateAction = BAInteropConstants.INTEROP_ACTION_COMPENSATE ;
+ /**
+ * The compensation fail action.
+ */
+ private final String participantCompensationFailAction = BAInteropConstants.INTEROP_ACTION_COMPENSATION_FAIL ;
+ /**
+ * The participant cancel completed race action.
+ */
+ private final String participantCancelCompletedRaceAction = BAInteropConstants.INTEROP_ACTION_PARTICIPANT_CANCEL_COMPLETED_RACE ;
+ /**
+ * The message loss and recovery action.
+ */
+ private final String messageLossAndRecoveryAction = BAInteropConstants.INTEROP_ACTION_MESSAGE_LOSS_AND_RECOVERY ;
+ /**
+ * The mixed outcome action.
+ */
+ private final String mixedOutcomeAction = BAInteropConstants.INTEROP_ACTION_MIXED_OUTCOME ;
+
+ /**
+ * The SOAP service representing the client.
+ */
+ private final SoapService soapService ;
+
+ /**
+ * Construct the interop synch client.
+ */
+ private SyncParticipantClient()
+ {
+ final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+ // Add WS-Addressing
+ AddressingPolicy.register(handlerRegistry) ;
+ // Add coordination context
+ CoordinationContextPolicy.register(handlerRegistry) ;
+ // Add the initiator policy
+ BAInitiatorPolicy.register(handlerRegistry) ;
+ // Add client policies
+ ClientPolicy.register(handlerRegistry) ;
+
+ soapService = new SoapService(handlerRegistry) ;
+ }
+
+ /**
+ * Send a cancel request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendCancel(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType cancel = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_CANCEL, cancel) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(cancelAction) ;
+ addressingContext.setAction(new AttributedURIType(cancelAction)) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a exit request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendExit(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType exit = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_EXIT, exit) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(exitAction) ;
+ addressingContext.setAction(new AttributedURIType(exitAction)) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a fail request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendFail(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType fail = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_FAIL, fail) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(failAction) ;
+ addressingContext.setAction(new AttributedURIType(failAction)) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a cannot complete request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendCannotComplete(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType cannotComplete = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_CANNOT_COMPLETE, cannotComplete) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(cannotCompleteAction) ;
+ addressingContext.setAction(new AttributedURIType(cannotCompleteAction)) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a participant complete close request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendParticipantCompleteClose(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType participantCompleteClose = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_COMPLETE_CLOSE, participantCompleteClose) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(participantCompleteCloseAction) ;
+ addressingContext.setAction(new AttributedURIType(participantCompleteCloseAction)) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a coordinator complete close request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendCoordinatorCompleteClose(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType coordinatorCompleteClose = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_COORDINATOR_COMPLETE_CLOSE, coordinatorCompleteClose) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(coordinatorCompleteCloseAction) ;
+ addressingContext.setAction(new AttributedURIType(coordinatorCompleteCloseAction)) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a unsolicited complete request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendUnsolicitedComplete(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType unsolicitedComplete = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_UNSOLICITED_COMPLETE, unsolicitedComplete) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(unsolicitedCompleteAction) ;
+ addressingContext.setAction(new AttributedURIType(unsolicitedCompleteAction)) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a compensate request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendCompensate(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType compensate = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_COMPENSATE, compensate) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(compensateAction) ;
+ addressingContext.setAction(new AttributedURIType(compensateAction)) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a compensation fail request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendCompensationFail(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType participantCompensationFail = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_COMPENSATION_FAIL, participantCompensationFail) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(participantCompensationFailAction) ;
+ addressingContext.setAction(new AttributedURIType(participantCompensationFailAction)) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a participant cancel completed race request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendParticipantCancelCompletedRace(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType participantCancelCompletedRace = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_CANCEL_COMPLETED_RACE, participantCancelCompletedRace) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(participantCancelCompletedRaceAction) ;
+ addressingContext.setAction(new AttributedURIType(participantCancelCompletedRaceAction)) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a message loss and recovery request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendMessageLossAndRecovery(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType messageLossAndRecovery = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_MESSAGE_LOSS_AND_RECOVERY, messageLossAndRecovery) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(messageLossAndRecoveryAction) ;
+ addressingContext.setAction(new AttributedURIType(messageLossAndRecoveryAction)) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Send a mixed outcome request.
+ * @param coordinationContext The coordination context.
+ * @param addressingContext The addressing context initialised with to, message ID and relates to.
+ * @param soapDetails The SOAP details.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ public TestMessageType sendMixedOutcome(final CoordinationContextType coordinationContext, final AddressingContext addressingContext, final SoapDetails soapDetails)
+ throws SoapFault, IOException
+ {
+ final TestMessageType mixedOutcome = new TestMessageType() ;
+ final NamedElement contents = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_MIXED_OUTCOME, mixedOutcome) ;
+ final SoapBody soapBody = new SoapBody(contents) ;
+ soapBody.setAction(mixedOutcomeAction) ;
+ addressingContext.setAction(new AttributedURIType(mixedOutcomeAction)) ;
+
+ CoordinationContext.setThreadContext(coordinationContext) ;
+ try
+ {
+ return processResponse(WSAddr2005Client.send(soapBody, addressingContext, soapDetails, soapService)) ;
+ }
+ finally
+ {
+ CoordinationContext.setThreadContext(null) ;
+ }
+ }
+
+ /**
+ * Process the response.
+ * @param soapBody The soap body.
+ * @return The response.
+ * @throws SoapFault For any errors.
+ * @throws IOException for any transport errors.
+ */
+ private TestMessageType processResponse(final SoapBody soapBody)
+ throws SoapFault, IOException
+ {
+ if (soapBody != null)
+ {
+ final NamedElement responseElement = soapBody.getContents() ;
+ if (responseElement != null)
+ {
+ final QName responseName = responseElement.getName() ;
+ if (BAInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE.equals(responseName))
+ {
+ try
+ {
+ return (TestMessageType)responseElement.getElementContent() ;
+ }
+ catch (final ClassCastException cce)
+ {
+ throw new SoapFault(SoapFaultType.FAULT_RECEIVER, null, "Expected test message response type for element: " + responseName) ;
+ }
+ }
+ else
+ {
+ throw new SoapFault(SoapFaultType.FAULT_RECEIVER, null, "Unexpected response element: " + responseName) ;
+ }
+ }
+ }
+ return null ;
+ }
+
+ /**
+ * Get the Interop client singleton.
+ * @return The Interop client singleton.
+ */
+ public static SyncParticipantClient getClient()
+ {
+ return CLIENT ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/client/SyncParticipantClient.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/InitiatorResponseHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/InitiatorResponseHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/InitiatorResponseHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,42 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor;
+
+/**
+ * The response handler.
+ * @author kevin
+ */
+public class InitiatorResponseHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+
+ BAInitiatorProcessor.getInitiator().handleResponse(message, addressingContext) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/InitiatorResponseHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/InitiatorSoapFaultHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/InitiatorSoapFaultHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/InitiatorSoapFaultHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,46 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.jboss.transaction.txinterop.webservices.atinterop.processors.ATInitiatorProcessor;
+
+/**
+ * The rollback handler.
+ * @author kevin
+ */
+public class InitiatorSoapFaultHandler implements 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
+ {
+ final SoapFault soapFault = soapDetails.parseSoapFault(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ TaskManager.getManager().queueTask(new Task() {
+ public void executeTask() {
+ ATInitiatorProcessor.getInitiator().handleSoapFault(soapFault, addressingContext) ;
+ }
+ }) ;
+ return null ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/InitiatorSoapFaultHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCancelHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCancelHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCancelHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.bainterop.processors.BAParticipantProcessor;
+
+/**
+ * The commit handler.
+ * @author kevin
+ */
+public class ParticipantCancelHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ final TestMessageType response = BAParticipantProcessor.getParticipant().cancel(message, coordinationContext, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, BAInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCancelHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCannotCompleteHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCannotCompleteHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCannotCompleteHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.bainterop.processors.BAParticipantProcessor;
+
+/**
+ * The commit handler.
+ * @author kevin
+ */
+public class ParticipantCannotCompleteHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ final TestMessageType response = BAParticipantProcessor.getParticipant().cannotComplete(message, coordinationContext, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, BAInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCannotCompleteHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCompensateHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCompensateHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCompensateHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.bainterop.processors.BAParticipantProcessor;
+
+/**
+ * The commit handler.
+ * @author kevin
+ */
+public class ParticipantCompensateHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ final TestMessageType response = BAParticipantProcessor.getParticipant().compensate(message, coordinationContext, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, BAInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCompensateHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCompensationFailHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCompensationFailHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCompensationFailHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.bainterop.processors.BAParticipantProcessor;
+
+/**
+ * The commit handler.
+ * @author kevin
+ */
+public class ParticipantCompensationFailHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ final TestMessageType response = BAParticipantProcessor.getParticipant().participantCompensationFail(message, coordinationContext, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, BAInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCompensationFailHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCoordinatorCompleteCloseHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCoordinatorCompleteCloseHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCoordinatorCompleteCloseHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.bainterop.processors.BAParticipantProcessor;
+
+/**
+ * The commit handler.
+ * @author kevin
+ */
+public class ParticipantCoordinatorCompleteCloseHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ final TestMessageType response = BAParticipantProcessor.getParticipant().coordinatorCompleteClose(message, coordinationContext, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, BAInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantCoordinatorCompleteCloseHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantExitHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantExitHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantExitHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.bainterop.processors.BAParticipantProcessor;
+
+/**
+ * The commit handler.
+ * @author kevin
+ */
+public class ParticipantExitHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ final TestMessageType response = BAParticipantProcessor.getParticipant().exit(message, coordinationContext, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, BAInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantExitHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantFailHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantFailHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantFailHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.bainterop.processors.BAParticipantProcessor;
+
+/**
+ * The commit handler.
+ * @author kevin
+ */
+public class ParticipantFailHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ final TestMessageType response = BAParticipantProcessor.getParticipant().fail(message, coordinationContext, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, BAInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantFailHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantMessageLossAndRecoveryHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantMessageLossAndRecoveryHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantMessageLossAndRecoveryHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.bainterop.processors.BAParticipantProcessor;
+
+/**
+ * The commit handler.
+ * @author kevin
+ */
+public class ParticipantMessageLossAndRecoveryHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ final TestMessageType response = BAParticipantProcessor.getParticipant().messageLossAndRecovery(message, coordinationContext, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, BAInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantMessageLossAndRecoveryHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantMixedOutcomeHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantMixedOutcomeHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantMixedOutcomeHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.bainterop.processors.BAParticipantProcessor;
+
+/**
+ * The commit handler.
+ * @author kevin
+ */
+public class ParticipantMixedOutcomeHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ final TestMessageType response = BAParticipantProcessor.getParticipant().mixedOutcome(message, coordinationContext, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, BAInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantMixedOutcomeHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantParticipantCancelCompletedRaceHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantParticipantCancelCompletedRaceHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantParticipantCancelCompletedRaceHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.bainterop.processors.BAParticipantProcessor;
+
+/**
+ * The commit handler.
+ * @author kevin
+ */
+public class ParticipantParticipantCancelCompletedRaceHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ final TestMessageType response = BAParticipantProcessor.getParticipant().participantCancelCompletedRace(message, coordinationContext, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, BAInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantParticipantCancelCompletedRaceHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantParticipantCompleteCloseHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantParticipantCompleteCloseHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantParticipantCompleteCloseHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.bainterop.processors.BAParticipantProcessor;
+
+/**
+ * The commit handler.
+ * @author kevin
+ */
+public class ParticipantParticipantCompleteCloseHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ final TestMessageType response = BAParticipantProcessor.getParticipant().participantCompleteClose(message, coordinationContext, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, BAInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantParticipantCompleteCloseHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantUnsolicitedCompleteHandler.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantUnsolicitedCompleteHandler.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantUnsolicitedCompleteHandler.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.handlers;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.bainterop.processors.BAParticipantProcessor;
+
+/**
+ * The commit handler.
+ * @author kevin
+ */
+public class ParticipantUnsolicitedCompleteHandler implements 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
+ {
+ final TestMessageType message = new TestMessageType(in) ;
+ final AddressingContext addressingContext = AddressingContext.getContext(context) ;
+ final CoordinationContextType coordinationContext = CoordinationContext.getContext(context) ;
+
+ final TestMessageType response = BAParticipantProcessor.getParticipant().unsolicitedComplete(message, coordinationContext, addressingContext) ;
+ final NamedElement responseElement = new NamedElement(BAInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, response) ;
+ return new SoapBody(responseElement, BAInteropConstants.INTEROP_ACTION_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/handlers/ParticipantUnsolicitedCompleteHandler.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CancelParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CancelParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CancelParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,9 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.participant;
+
+
+/**
+ * The Cancel participant completion participant
+ */
+public class CancelParticipant extends ParticipantCompletionParticipantAdapter
+{
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CancelParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CannotCompleteParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CannotCompleteParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CannotCompleteParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,26 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.participant;
+
+import java.util.TimerTask;
+
+import com.arjuna.webservices.util.TransportTimer;
+import com.arjuna.wst.messaging.engines.CoordinatorCompletionParticipant11Engine;
+
+public class CannotCompleteParticipant extends CoordinatorCompletionParticipantAdapter
+{
+ private CoordinatorCompletionParticipant11Engine engine ;
+
+ public void setEngine(final CoordinatorCompletionParticipant11Engine engine)
+ {
+ this.engine = engine ;
+ }
+
+ public void initialiseTimeout()
+ {
+ final TimerTask timerTask = new TimerTask() {
+ public void run() {
+ engine.cannotComplete() ;
+ }
+ } ;
+ TransportTimer.getTimer().schedule(timerTask, 2000) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CannotCompleteParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CompletedParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CompletedParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CompletedParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,26 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.participant;
+
+import java.util.TimerTask;
+
+import com.arjuna.webservices.util.TransportTimer;
+import com.arjuna.wst.messaging.engines.ParticipantCompletionParticipant11Engine;
+
+public class CompletedParticipant extends ParticipantCompletionParticipantAdapter
+{
+ private ParticipantCompletionParticipant11Engine engine ;
+
+ public void setEngine(final ParticipantCompletionParticipant11Engine engine)
+ {
+ this.engine = engine ;
+ }
+
+ public void initialiseTimeout()
+ {
+ final TimerTask timerTask = new TimerTask() {
+ public void run() {
+ engine.completed() ;
+ }
+ } ;
+ TransportTimer.getTimer().schedule(timerTask, 2000) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CompletedParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CoordinatorCompleteCloseParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CoordinatorCompleteCloseParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CoordinatorCompleteCloseParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,6 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.participant;
+
+
+public class CoordinatorCompleteCloseParticipant extends CoordinatorCompletionParticipantAdapter
+{
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CoordinatorCompleteCloseParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CoordinatorCompletionParticipantAdapter.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CoordinatorCompletionParticipantAdapter.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CoordinatorCompletionParticipantAdapter.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,13 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.participant;
+
+import com.arjuna.wst.BusinessAgreementWithCoordinatorCompletionParticipant;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.WrongStateException;
+
+class CoordinatorCompletionParticipantAdapter extends ParticipantCompletionParticipantAdapter implements BusinessAgreementWithCoordinatorCompletionParticipant
+{
+ public void complete()
+ throws WrongStateException, SystemException
+ {
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/CoordinatorCompletionParticipantAdapter.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/DropFirstCompensateParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/DropFirstCompensateParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/DropFirstCompensateParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,20 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.participant;
+
+import com.arjuna.wst.FaultedException;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.WrongStateException;
+
+public class DropFirstCompensateParticipant extends CoordinatorCompletionParticipantAdapter
+{
+ private boolean dropped ;
+
+ public synchronized void compensate()
+ throws FaultedException, WrongStateException, SystemException
+ {
+ if (!dropped)
+ {
+ dropped = true ;
+ throw new SystemException("Dropping compensate") ;
+ }
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/DropFirstCompensateParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/ExitParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/ExitParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/ExitParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,26 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.participant;
+
+import java.util.TimerTask;
+
+import com.arjuna.webservices.util.TransportTimer;
+import com.arjuna.wst.messaging.engines.CoordinatorCompletionParticipant11Engine;
+
+public class ExitParticipant extends CoordinatorCompletionParticipantAdapter
+{
+ private CoordinatorCompletionParticipant11Engine engine ;
+
+ public void setEngine(final CoordinatorCompletionParticipant11Engine engine)
+ {
+ this.engine = engine ;
+ }
+
+ public void initialiseTimeout()
+ {
+ final TimerTask timerTask = new TimerTask() {
+ public void run() {
+ engine.exit() ;
+ }
+ } ;
+ TransportTimer.getTimer().schedule(timerTask, 2000) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/ExitParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/FailParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/FailParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/FailParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,27 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.participant;
+
+import java.util.TimerTask;
+
+import com.arjuna.webservices.util.TransportTimer;
+import com.arjuna.wst.messaging.engines.ParticipantCompletionParticipant11Engine;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+
+public class FailParticipant extends ParticipantCompletionParticipantAdapter
+{
+ private ParticipantCompletionParticipant11Engine engine ;
+
+ public void setEngine(final ParticipantCompletionParticipant11Engine engine)
+ {
+ this.engine = engine ;
+ }
+
+ public void initialiseTimeout()
+ {
+ final TimerTask timerTask = new TimerTask() {
+ public void run() {
+ engine.fail(BAInteropConstants.INTEROP_ELEMENT_QNAME_FAIL) ;
+ }
+ } ;
+ TransportTimer.getTimer().schedule(timerTask, 2000) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/FailParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/FailedCompensateParticipant.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/FailedCompensateParticipant.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/FailedCompensateParticipant.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,14 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.participant;
+
+import com.arjuna.wst.FaultedException;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.WrongStateException;
+
+public class FailedCompensateParticipant extends CompletedParticipant
+{
+ public void compensate()
+ throws FaultedException, WrongStateException, SystemException
+ {
+ throw new FaultedException() ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/FailedCompensateParticipant.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/ParticipantCompletionParticipantAdapter.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/ParticipantCompletionParticipantAdapter.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/ParticipantCompletionParticipantAdapter.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,40 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.participant;
+
+import com.arjuna.wst.BusinessAgreementWithParticipantCompletionParticipant;
+import com.arjuna.wst.FaultedException;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.WrongStateException;
+
+class ParticipantCompletionParticipantAdapter implements BusinessAgreementWithParticipantCompletionParticipant
+{
+ public void cancel()
+ throws WrongStateException, SystemException
+ {
+ }
+
+ public void close()
+ throws WrongStateException, SystemException
+ {
+ }
+
+ public void compensate()
+ throws FaultedException, WrongStateException, SystemException
+ {
+ }
+
+ public void error()
+ throws SystemException
+ {
+ }
+
+ public String status()
+ throws SystemException
+ {
+ return null ;
+ }
+
+ public void unknown()
+ throws SystemException
+ {
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/participant/ParticipantCompletionParticipantAdapter.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/policy/BAInitiatorPolicy.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/policy/BAInitiatorPolicy.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/policy/BAInitiatorPolicy.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,34 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.policy;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.handlers.InitiatorResponseHandler;
+import com.jboss.transaction.txinterop.webservices.bainterop.handlers.InitiatorSoapFaultHandler;
+
+/**
+ * Policy responsible for binding in the WS-TX BA Interop participant server handlers.
+ * @author kevin
+ */
+public class BAInitiatorPolicy
+{
+ /**
+ * Add this policy to the registry.
+ * @param registry The registry containing the policy.
+ */
+ public static void register(final HandlerRegistry registry)
+ {
+ registry.registerBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE, new InitiatorResponseHandler()) ;
+
+ registry.registerFaultHandler(new InitiatorSoapFaultHandler()) ;
+ }
+
+ /**
+ * Remove this policy from the registry.
+ * @param registry The registry containing the policy.
+ */
+ public static void remove(final HandlerRegistry registry)
+ {
+ registry.registerFaultHandler(null) ;
+ registry.removeBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_RESPONSE) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/policy/BAInitiatorPolicy.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/policy/BAParticipantPolicy.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/policy/BAParticipantPolicy.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/policy/BAParticipantPolicy.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,68 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.policy;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.arjuna.webservices.base.handlers.LoggingFaultHandler;
+import com.jboss.transaction.txinterop.webservices.InteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.handlers.ParticipantCancelHandler;
+import com.jboss.transaction.txinterop.webservices.bainterop.handlers.ParticipantCannotCompleteHandler;
+import com.jboss.transaction.txinterop.webservices.bainterop.handlers.ParticipantCompensateHandler;
+import com.jboss.transaction.txinterop.webservices.bainterop.handlers.ParticipantCompensationFailHandler;
+import com.jboss.transaction.txinterop.webservices.bainterop.handlers.ParticipantCoordinatorCompleteCloseHandler;
+import com.jboss.transaction.txinterop.webservices.bainterop.handlers.ParticipantExitHandler;
+import com.jboss.transaction.txinterop.webservices.bainterop.handlers.ParticipantFailHandler;
+import com.jboss.transaction.txinterop.webservices.bainterop.handlers.ParticipantMessageLossAndRecoveryHandler;
+import com.jboss.transaction.txinterop.webservices.bainterop.handlers.ParticipantMixedOutcomeHandler;
+import com.jboss.transaction.txinterop.webservices.bainterop.handlers.ParticipantParticipantCancelCompletedRaceHandler;
+import com.jboss.transaction.txinterop.webservices.bainterop.handlers.ParticipantParticipantCompleteCloseHandler;
+import com.jboss.transaction.txinterop.webservices.bainterop.handlers.ParticipantUnsolicitedCompleteHandler;
+
+/**
+ * Policy responsible for binding in the WS-TX AT Interop participant server handlers.
+ * @author kevin
+ */
+public class BAParticipantPolicy
+{
+ /**
+ * Add this policy to the registry.
+ * @param registry The registry containing the policy.
+ */
+ public static void register(final HandlerRegistry registry)
+ {
+ registry.registerBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_CANCEL, new ParticipantCancelHandler()) ;
+ registry.registerBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_EXIT, new ParticipantExitHandler()) ;
+ registry.registerBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_FAIL, new ParticipantFailHandler()) ;
+ registry.registerBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_CANNOT_COMPLETE, new ParticipantCannotCompleteHandler()) ;
+ registry.registerBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_COMPLETE_CLOSE, new ParticipantParticipantCompleteCloseHandler()) ;
+ registry.registerBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_COORDINATOR_COMPLETE_CLOSE, new ParticipantCoordinatorCompleteCloseHandler()) ;
+ registry.registerBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_UNSOLICITED_COMPLETE, new ParticipantUnsolicitedCompleteHandler()) ;
+ registry.registerBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_COMPENSATE, new ParticipantCompensateHandler()) ;
+ registry.registerBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_COMPENSATION_FAIL, new ParticipantCompensationFailHandler()) ;
+ registry.registerBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_CANCEL_COMPLETED_RACE, new ParticipantParticipantCancelCompletedRaceHandler()) ;
+ registry.registerBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_MESSAGE_LOSS_AND_RECOVERY, new ParticipantMessageLossAndRecoveryHandler()) ;
+ registry.registerBodyHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_MIXED_OUTCOME, new ParticipantMixedOutcomeHandler()) ;
+
+ registry.registerFaultHandler(new LoggingFaultHandler(InteropConstants.SERVICE_PARTICIPANT)) ;
+ }
+
+ /**
+ * Remove this policy from the registry.
+ * @param registry The registry containing the policy.
+ */
+ public static void remove(final HandlerRegistry registry)
+ {
+ registry.registerFaultHandler(null) ;
+ registry.removeHeaderHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_MIXED_OUTCOME) ;
+ registry.removeHeaderHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_MESSAGE_LOSS_AND_RECOVERY) ;
+ registry.removeHeaderHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_CANCEL_COMPLETED_RACE) ;
+ registry.removeHeaderHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_COMPENSATION_FAIL) ;
+ registry.removeHeaderHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_COMPENSATE) ;
+ registry.removeHeaderHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_UNSOLICITED_COMPLETE) ;
+ registry.removeHeaderHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_COORDINATOR_COMPLETE_CLOSE) ;
+ registry.removeHeaderHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_PARTICIPANT_COMPLETE_CLOSE) ;
+ registry.removeHeaderHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_CANNOT_COMPLETE) ;
+ registry.removeHeaderHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_FAIL) ;
+ registry.removeHeaderHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_EXIT) ;
+ registry.removeHeaderHandler(BAInteropConstants.INTEROP_ELEMENT_QNAME_CANCEL) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/policy/BAParticipantPolicy.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAInitiatorCallback.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAInitiatorCallback.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAInitiatorCallback.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,48 @@
+/*
+ * 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.jboss.transaction.txinterop.webservices.bainterop.processors;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.base.processors.Callback;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+
+/**
+ * The callback for the initiator client.
+ * @author kevin
+ */
+public abstract class BAInitiatorCallback extends Callback
+{
+ /**
+ * A response.
+ * @param response The response.
+ * @param addressingContext The current addressing context.
+ */
+ public abstract void response(final TestMessageType response,
+ final AddressingContext addressingContext) ;
+
+ /**
+ * A SOAP fault response.
+ * @param soapFault The SOAP fault response.
+ * @param addressingContext The current addressing context.
+ */
+ public abstract void soapFault(final SoapFault soapFault, final AddressingContext addressingContext) ;
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAInitiatorCallback.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAInitiatorProcessor.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAInitiatorProcessor.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAInitiatorProcessor.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,86 @@
+/*
+ * 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.jboss.transaction.txinterop.webservices.bainterop.processors;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.base.processors.Callback;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wsaddr2005.processor.BaseWSAddr2005ResponseProcessor;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+
+/**
+ * The Initiator processor.
+ * @author kevin
+ */
+public class BAInitiatorProcessor extends BaseWSAddr2005ResponseProcessor
+{
+ /**
+ * The initiator singleton.
+ */
+ private static final BAInitiatorProcessor INITIATOR = new BAInitiatorProcessor() ;
+
+ /**
+ * Get the initiator singleton.
+ * @return The singleton.
+ */
+ public static BAInitiatorProcessor getInitiator()
+ {
+ return INITIATOR ;
+ }
+
+ /**
+ * Handle a response response.
+ * @param response The response.
+ * @param addressingContext The current addressing context.
+ */
+ public void handleResponse(final TestMessageType response, final AddressingContext addressingContext)
+ {
+ handleCallbacks(new CallbackExecutorAdapter() {
+ public void execute(final Callback callback) {
+ ((BAInitiatorCallback)callback).response(response, addressingContext) ;
+ }
+ }, getIDs(addressingContext)) ;
+ }
+
+ /**
+ * Register a SOAP fault response.
+ * @param soapFault The SOAP fault response.
+ * @param addressingContext The current addressing context.
+ */
+ public void handleSoapFault(final SoapFault soapFault, final AddressingContext addressingContext)
+ {
+ handleCallbacks(new CallbackExecutorAdapter() {
+ public void execute(final Callback callback) {
+ ((BAInitiatorCallback)callback).soapFault(soapFault, addressingContext) ;
+ }
+ }, getIDs(addressingContext)) ;
+ }
+
+ /**
+ * Register a callback for the specific message id.
+ * @param messageID The message ID.
+ * @param callback The callback for the response.
+ */
+ public void registerCallback(final String messageID, final BAInitiatorCallback callback)
+ {
+ register(messageID, callback) ;
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAInitiatorProcessor.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAParticipantProcessor.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAParticipantProcessor.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAParticipantProcessor.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,327 @@
+/*
+ * 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.jboss.transaction.txinterop.webservices.bainterop.processors;
+
+import com.arjuna.ats.arjuna.common.Uid;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.wsaddr2005.AddressingContext;
+import com.arjuna.webservices.wscoor11.CoordinationContextType;
+import com.arjuna.wst.messaging.engines.CoordinatorCompletionParticipant11Engine;
+import com.arjuna.wst.messaging.engines.ParticipantCompletionParticipant11Engine;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropUtil;
+import com.jboss.transaction.txinterop.webservices.bainterop.TestMessageType;
+import com.jboss.transaction.txinterop.webservices.bainterop.participant.CancelParticipant;
+import com.jboss.transaction.txinterop.webservices.bainterop.participant.CoordinatorCompleteCloseParticipant;
+import com.jboss.transaction.txinterop.webservices.bainterop.participant.DropFirstCompensateParticipant;
+import com.jboss.transaction.txinterop.webservices.bainterop.participant.ExitParticipant;
+import com.jboss.transaction.txinterop.webservices.bainterop.participant.FailParticipant;
+import com.jboss.transaction.txinterop.webservices.bainterop.participant.CannotCompleteParticipant;
+import com.jboss.transaction.txinterop.webservices.bainterop.participant.CompletedParticipant;
+import com.jboss.transaction.txinterop.webservices.bainterop.participant.FailedCompensateParticipant;
+
+/**
+ * The Participant processor.
+ * @author kevin
+ */
+public class BAParticipantProcessor
+{
+ /**
+ * The participant.
+ */
+ private static BAParticipantProcessor PARTICIPANT = new BAParticipantProcessor() ;
+
+ /**
+ * Get the participant.
+ * @return The participant.
+ */
+ public static BAParticipantProcessor getParticipant()
+ {
+ return PARTICIPANT ;
+ }
+
+ /**
+ * Execute the Cancel
+ * @param cancel The cancel request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType cancel(final TestMessageType cancel, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ try
+ {
+ BAInteropUtil.registerParticipantCompletion(coordinationContext, new CancelParticipant(), new Uid().toString()) ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SoapFault(th) ;
+ }
+ return new TestMessageType() ;
+ }
+
+ /**
+ * Execute the Exit
+ * @param exit The exit request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType exit(final TestMessageType exit, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ try
+ {
+ final ExitParticipant participant = new ExitParticipant() ;
+ final CoordinatorCompletionParticipant11Engine engine = BAInteropUtil.registerCoordinatorCompletion(coordinationContext, participant, new Uid().toString()) ;
+ participant.setEngine(engine) ;
+ participant.initialiseTimeout() ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SoapFault(th) ;
+ }
+ return new TestMessageType() ;
+ }
+
+ /**
+ * Execute the Fail
+ * @param fail The fail request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType fail(final TestMessageType fail, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ try
+ {
+ final FailParticipant participant = new FailParticipant() ;
+ final ParticipantCompletionParticipant11Engine engine = BAInteropUtil.registerParticipantCompletion(coordinationContext, participant, new Uid().toString()) ;
+ participant.setEngine(engine) ;
+ participant.initialiseTimeout() ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SoapFault(th) ;
+ }
+ return new TestMessageType() ;
+ }
+
+ /**
+ * Execute the CannotComplete
+ * @param cannotComplete The cannot complete request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType cannotComplete(final TestMessageType cannotComplete, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ try
+ {
+ final CannotCompleteParticipant participant = new CannotCompleteParticipant() ;
+ final CoordinatorCompletionParticipant11Engine engine = BAInteropUtil.registerCoordinatorCompletion(coordinationContext, participant, new Uid().toString()) ;
+ participant.setEngine(engine) ;
+ participant.initialiseTimeout() ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SoapFault(th) ;
+ }
+ return new TestMessageType() ;
+ }
+
+ /**
+ * Execute the ParticipantCompleteClose
+ * @param participantCompleteClose The participant complete close request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType participantCompleteClose(final TestMessageType participantCompleteClose, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ try
+ {
+ final CompletedParticipant participant = new CompletedParticipant() ;
+ final ParticipantCompletionParticipant11Engine engine = BAInteropUtil.registerParticipantCompletion(coordinationContext, participant, new Uid().toString()) ;
+ participant.setEngine(engine) ;
+ participant.initialiseTimeout() ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SoapFault(th) ;
+ }
+ return new TestMessageType() ;
+ }
+
+ /**
+ * Execute the CoordinatorCompleteClose
+ * @param coordinatorCompleteClose The coordinator complete close request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType coordinatorCompleteClose(final TestMessageType coordinatorCompleteClose, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ try
+ {
+ BAInteropUtil.registerCoordinatorCompletion(coordinationContext, new CoordinatorCompleteCloseParticipant(), new Uid().toString()) ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SoapFault(th) ;
+ }
+ return new TestMessageType() ;
+ }
+
+ /**
+ * Execute the UnsolicitedComplete
+ * @param unsolicitedComplete The unsolicited complete request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType unsolicitedComplete(final TestMessageType unsolicitedComplete, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ try
+ {
+ final CompletedParticipant participant = new CompletedParticipant() ;
+ final ParticipantCompletionParticipant11Engine engine = BAInteropUtil.registerParticipantCompletion(coordinationContext, participant, new Uid().toString()) ;
+ participant.setEngine(engine) ;
+ participant.initialiseTimeout() ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SoapFault(th) ;
+ }
+ return new TestMessageType() ;
+ }
+
+ /**
+ * Execute the Compensate
+ * @param compensate The compensate request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType compensate(final TestMessageType compensate, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ try
+ {
+ final CompletedParticipant participant = new CompletedParticipant() ;
+ final ParticipantCompletionParticipant11Engine engine = BAInteropUtil.registerParticipantCompletion(coordinationContext, participant, new Uid().toString()) ;
+ participant.setEngine(engine) ;
+ participant.initialiseTimeout() ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SoapFault(th) ;
+ }
+ return new TestMessageType() ;
+ }
+
+ /**
+ * Execute the ParticipantCompensationFail
+ * @param participantCompensationFail The participant compensation fail request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType participantCompensationFail(final TestMessageType participantCompensationFail, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ try
+ {
+ final FailedCompensateParticipant participant = new FailedCompensateParticipant() ;
+ final ParticipantCompletionParticipant11Engine engine = BAInteropUtil.registerParticipantCompletion(coordinationContext, participant, new Uid().toString()) ;
+ participant.setEngine(engine) ;
+ participant.initialiseTimeout() ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SoapFault(th) ;
+ }
+ return new TestMessageType() ;
+ }
+
+ /**
+ * Execute the ParticipantCancelCompletedRace
+ * @param participantCancelCompletedRace The participant cancel completed race request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType participantCancelCompletedRace(final TestMessageType participantCancelCompletedRace, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ try
+ {
+ final CompletedParticipant participant = new CompletedParticipant() ;
+ final ParticipantCompletionParticipant11Engine engine = BAInteropUtil.registerParticipantCompletion(coordinationContext, participant, new Uid().toString()) ;
+ participant.setEngine(engine) ;
+ participant.initialiseTimeout() ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SoapFault(th) ;
+ }
+ return new TestMessageType() ;
+ }
+
+ /**
+ * Execute the MessageLossAndRecovery
+ * @param messageLossAndRecovery The message loss and recovery request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType messageLossAndRecovery(final TestMessageType messageLossAndRecovery, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ try
+ {
+ BAInteropUtil.registerCoordinatorCompletion(coordinationContext, new DropFirstCompensateParticipant(), new Uid().toString()) ;
+ }
+ catch (final Throwable th)
+ {
+ throw new SoapFault(th) ;
+ }
+ return new TestMessageType() ;
+ }
+
+ /**
+ * Execute the MixedOutcome
+ * @param mixedOutcome The mixed outcome request.
+ * @param addressingContext The current addressing context.
+ * @return The response.
+ * @throws SoapFault for errors during processing
+ */
+ public TestMessageType mixedOutcome(final TestMessageType mixedOutcome, final CoordinationContextType coordinationContext, final AddressingContext addressingContext)
+ throws SoapFault
+ {
+ return new TestMessageType() ;
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/processors/BAParticipantProcessor.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/server/BAInitiatorInitialisation.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/server/BAInitiatorInitialisation.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/server/BAInitiatorInitialisation.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,44 @@
+package com.jboss.transaction.txinterop.webservices.bainterop.server;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.SoapService;
+import com.arjuna.webservices.wsaddr2005.policy.AddressingPolicy;
+import com.jboss.transaction.txinterop.webservices.bainterop.BAInteropConstants;
+import com.jboss.transaction.txinterop.webservices.bainterop.policy.BAInitiatorPolicy;
+
+/**
+ * Initialise the interop initiator service.
+ * @author kevin
+ */
+public class BAInitiatorInitialisation implements ServletContextListener
+{
+ /**
+ * The context has been initialized.
+ * @param servletContextEvent The servlet context event.
+ */
+ public void contextInitialized(final ServletContextEvent servletContextEvent)
+ {
+ final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+ // Add WS-Addressing
+ AddressingPolicy.register(handlerRegistry) ;
+ // Add endpoint
+ BAInitiatorPolicy.register(handlerRegistry) ;
+
+ final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+ soapRegistry.registerSoapService(BAInteropConstants.SERVICE_INITIATOR,
+ new SoapService(handlerRegistry)) ;
+ }
+
+ /**
+ * The context is about to be destroyed.
+ * @param servletContextEvent The servlet context event.
+ */
+ public void contextDestroyed(final ServletContextEvent servletContextEvent)
+ {
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/bainterop/server/BAInitiatorInitialisation.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/server/ParticipantInitialisation.java
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/server/ParticipantInitialisation.java (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/server/ParticipantInitialisation.java 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,50 @@
+package com.jboss.transaction.txinterop.webservices.server;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+import com.arjuna.webservices.HandlerRegistry;
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.SoapService;
+import com.arjuna.webservices.wsaddr2005.policy.AddressingPolicy;
+import com.arjuna.webservices.wscoor11.policy.CoordinationContextPolicy;
+import com.jboss.transaction.txinterop.webservices.InteropConstants;
+import com.jboss.transaction.txinterop.webservices.atinterop.policy.ATParticipantPolicy;
+import com.jboss.transaction.txinterop.webservices.bainterop.policy.BAParticipantPolicy;
+
+/**
+ * Initialise the interop 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)
+ {
+ final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+ // Add WS-Addressing
+ AddressingPolicy.register(handlerRegistry) ;
+ // Add coordination context
+ CoordinationContextPolicy.register(handlerRegistry) ;
+ // Add AT policy
+ ATParticipantPolicy.register(handlerRegistry) ;
+ // Add BA policy
+ BAParticipantPolicy.register(handlerRegistry) ;
+
+ final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+ soapRegistry.registerSoapService(InteropConstants.SERVICE_PARTICIPANT,
+ new SoapService(handlerRegistry)) ;
+ }
+
+ /**
+ * The context is about to be destroyed.
+ * @param servletContextEvent The servlet context event.
+ */
+ public void contextDestroyed(final ServletContextEvent servletContextEvent)
+ {
+ }
+}
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/com/jboss/transaction/txinterop/webservices/server/ParticipantInitialisation.java
___________________________________________________________________
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/wscf.xml
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/wscf.xml (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/wscf.xml 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/conf/wscf.xml
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/wscf.xml
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/wst.xml
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/wst.xml (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/wst.xml 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/conf/wst.xml
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/wst.xml
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX11-interop/src/wstx.xml
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/src/wstx.xml (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/src/wstx.xml 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1 @@
+link /home/kevin/jbosstm/XTS/xts-install/conf/wstx.xml
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/src/wstx.xml
___________________________________________________________________
Name: svn:special
+ *
Added: labs/jbosstm/workspace/interop/WSTX11-interop/web/details.jsp
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/web/details.jsp (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/web/details.jsp 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,90 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"%>
+<%@page import="com.jboss.transaction.txinterop.test.TestConstants"%>
+<%@page import="java.util.Enumeration"%>
+<%@page import="junit.framework.TestResult"%>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<%@page import="junit.framework.TestFailure"%>
+<%@page import="junit.framework.TestCase"%>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>JBoss Transactions WS-TX Interop detail page</title>
+</head>
+<body>
+<h1>Results</h1>
+<%
+ final TestResult testResult = (TestResult)session.getAttribute(TestConstants.ATTRIBUTE_TEST_RESULT) ;
+ if (testResult == null)
+ {
+%>
+No JUnit test results generated.
+<%
+ }
+ else
+ {
+ final String type = request.getParameter("type") ;
+
+ Enumeration detailEnum = null ;
+ if (type != null)
+ {
+ if ("error".equals(type))
+ {
+ detailEnum = testResult.errors() ;
+ }
+ else if ("failure".equals(type))
+ {
+ detailEnum = testResult.failures() ;
+ }
+ }
+
+ Integer indexInt = null ;
+ if (detailEnum != null)
+ {
+ final String indexVal = request.getParameter("index") ;
+ try
+ {
+ indexInt = Integer.valueOf(indexVal) ;
+ }
+ catch (final NumberFormatException nfe) {}
+ }
+
+ TestFailure testFailure = null ;
+ if (indexInt != null)
+ {
+ int index = indexInt.intValue() ;
+ if (index > 0)
+ {
+ while(detailEnum.hasMoreElements())
+ {
+ final Object current = detailEnum.nextElement() ;
+ if (--index == 0)
+ {
+ testFailure = (TestFailure)current ;
+ break ;
+ }
+ }
+ }
+ }
+
+ if (testFailure == null)
+ {
+%>
+<p>Invalid request parameters</p>
+<%
+ }
+ else
+ {
+ final TestCase failure = (TestCase)testFailure.failedTest() ;
+%>
+<p>Test: <%= failure.getName() %></p>
+<pre>
+<%= testFailure.trace() %>
+</pre>
+<%
+ }
+ }
+%>
+<p>Return to <a href="results.jsp">results page</a></p>
+</body>
+</html>
\ No newline at end of file
Added: labs/jbosstm/workspace/interop/WSTX11-interop/web/index.jsp
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/web/index.jsp (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/web/index.jsp 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,52 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"%>
+<%@page import="java.util.Iterator"%>
+<%@page import="java.util.Map"%>
+<%@page import="com.arjuna.webservices.SoapRegistry"%>
+<%@page import="com.jboss.transaction.txinterop.test.TestConstants"%>
+<%@page import="com.jboss.transaction.txinterop.webservices.InteropConstants"%>
+
+<%!
+private final static String SERVICE_URI = SoapRegistry.getRegistry().getServiceURI(InteropConstants.SERVICE_PARTICIPANT) ;%>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>JBoss Transactions WS-TX Interop</title>
+</head>
+<body>
+<h1>JBoss Transactions WS-TX Interop</h1>
+<h2>Introduction</h2>
+<p>This web application implements a set of interoperability tests specified by the <a href="http://www.oasis-open.org/apps/org/workgroup/ws-tx/">Oasis WS-TX Technical Committee</a> site.</p>
+<p>Please send any queries to the <a href="mailto:kevin.conner at jboss.com?subject=Interop%20query">interop test contact</a></p>
+<h2>Interop tests</h2>
+<form action="test" method="post">
+<p>Service URI: <input name="<%= TestConstants.PARAM_SERVICE_URI %>" maxlength="2000" size="100" value="<%= SERVICE_URI %>"/></p>
+<p>Test timeout: <input name="<%= TestConstants.PARAM_TEST_TIMEOUT %>" maxlength="10" size="10" value="120000"/></p>
+<p>Asynchronous Test application: <input name="<%= TestConstants.PARAM_ASYNC_TEST %>" type="checkbox" checked="checked"/></p>
+<select name="<%= TestConstants.PARAM_TEST %>">
+<option value="<%= TestConstants.NAME_ALL_TESTS %>">All tests</option>
+<option value="<%= TestConstants.NAME_ALL_AT_TESTS %>">All AT tests</option>
+<option value="<%= TestConstants.NAME_ALL_BA_TESTS %>">All BA tests</option>
+<%
+
+ final Map descriptions = TestConstants.DESCRIPTIONS ;
+ final Iterator entryIter = descriptions.entrySet().iterator() ;
+ while(entryIter.hasNext())
+ {
+ final Map.Entry entry = (Map.Entry)entryIter.next() ;
+ final String testName = (String)entry.getKey() ;
+ final String testDescription = (String)entry.getValue() ;
+%>
+<option value="<%= testName %>"><%=testName + " - " + testDescription%></option>
+<%
+
+}
+%>
+</select>
+<p>
+<input type="submit" value="Execute"/>
+</p>
+</form>
+</body>
+</html>
\ No newline at end of file
Added: labs/jbosstm/workspace/interop/WSTX11-interop/web/invalidParameters.html
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/web/invalidParameters.html (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/web/invalidParameters.html 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>JBoss Transactions WS-TX Interop invalid parameters page</title>
+</head>
+<body>
+Unfortunately the parameters specified are invalid, please resubmit the request. If the request repeatedly fails please contact the <a href="mailto:kevin.conner at jboss.com?subject=Interop%20invalid%20parameters">interop test contact</a>
+<p>Return to <a href="index.jsp">main page</a></p>
+</body>
+</html>
\ No newline at end of file
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/web/invalidParameters.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Name: svn:keywords
+ Rev Date
Name: svn:eol-style
+ native
Added: labs/jbosstm/workspace/interop/WSTX11-interop/web/results.jsp
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/web/results.jsp (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/web/results.jsp 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,90 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"%>
+<%@page import="com.jboss.transaction.txinterop.test.TestConstants"%>
+<%@page import="java.util.Enumeration"%>
+<%@page import="junit.framework.TestCase"%>
+<%@page import="junit.framework.TestFailure"%>
+<%@page import="junit.framework.TestResult"%>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>JBoss Transactions WS-TX Interop results page</title>
+</head>
+<body>
+<h1>Results</h1>
+<h2>Processed results</h2>
+<%
+ final String logName = (String)session.getAttribute(TestConstants.ATTRIBUTE_LOG_NAME) ;
+ if (logName != null)
+ {
+%>
+<p>View <a href="logs/<%= logName %>">log file</a></p>
+<%
+ }
+%>
+<h2>JUnit results</h2>
+<%
+ final TestResult testResult = (TestResult)session.getAttribute(TestConstants.ATTRIBUTE_TEST_RESULT) ;
+ if (testResult == null)
+ {
+%>
+No JUnit test results generated.
+<%
+ }
+ else
+ {
+ final int runCount = testResult.runCount() ;
+ final int errorCount = testResult.errorCount() ;
+ final int failureCount = testResult.failureCount() ;
+%>
+<p>Run count: <%= runCount %></p>
+<p>Error count: <%= errorCount %></p>
+<p>Failure count: <%= failureCount %></p>
+<%
+ if ((errorCount > 0) || (failureCount > 0))
+ {
+ if (errorCount > 0)
+ {
+ final Enumeration enumeration = testResult.errors() ;
+%>
+<H3>Errors</H3>
+<%
+ int count = 0 ;
+ while(enumeration.hasMoreElements())
+ {
+ final TestFailure testFailure = (TestFailure)enumeration.nextElement() ;
+ count++ ;
+ final TestCase failedTest = (TestCase)testFailure.failedTest() ;
+ final String name = failedTest.getName() ;
+ final String description = (String)TestConstants.DESCRIPTIONS.get(name) ;
+%>
+<p><a href="details.jsp?type=error&index=<%= count %>"><%= name %></a> <%= description %></p>
+<%
+ }
+ }
+ if (failureCount > 0)
+ {
+ final Enumeration enumeration = testResult.failures() ;
+%>
+<H3>Failures</H3>
+<%
+ int count = 0 ;
+ while(enumeration.hasMoreElements())
+ {
+ final TestFailure testFailure = (TestFailure)enumeration.nextElement() ;
+ count++ ;
+ final TestCase failedTest = (TestCase)testFailure.failedTest() ;
+ final String name = failedTest.getName() ;
+ final String description = (String)TestConstants.DESCRIPTIONS.get(name) ;
+%>
+<p><a href="details.jsp?type=failure&index=<%= count %>"><%= name %></a> <%= description %></p>
+<%
+ }
+ }
+ }
+ }
+%>
+<p>Return to <a href="index.jsp">main page</a></p>
+</body>
+</html>
\ No newline at end of file
Added: labs/jbosstm/workspace/interop/WSTX11-interop/web.xml
===================================================================
--- labs/jbosstm/workspace/interop/WSTX11-interop/web.xml (rev 0)
+++ labs/jbosstm/workspace/interop/WSTX11-interop/web.xml 2007-08-14 13:05:04 UTC (rev 14204)
@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!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>JBoss WSTX1.1 interop</display-name>
+
+ <description>JBoss WSTX1.1 interop</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 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.
+ -->
+ <init-param>
+ <param-name>BaseHttpURI</param-name>
+ <param-value>http://@HOST@:@PORT@/interop/soap/</param-value>
+ </init-param>
+ <!--
+ <init-param>
+ <param-name>BaseHttpsURI</param-name>
+ <param-value>https://localhost:8080/arjuna/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>
+ </servlet>
+
+ <servlet>
+ <servlet-name>HTTP Proxy Servlet</servlet-name>
+ <servlet-class>com.jboss.transaction.txinterop.proxy.ProxyListenerService</servlet-class>
+ <!--
+ The base URI of the proxy servlet.
+ -->
+ <init-param>
+ <param-name>proxyServiceURI</param-name>
+ <param-value>http://@HOST@:@PORT@/interop/proxy</param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet>
+ <servlet-name>JUnit test servlet</servlet-name>
+ <servlet-class>com.jboss.transaction.txinterop.test.TestServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet>
+ <servlet-name>Log servlet</servlet-name>
+ <servlet-class>com.jboss.transaction.txinterop.test.TestLogServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <!-- servlet mappings -->
+ <servlet-mapping>
+ <servlet-name>HTTP SOAP Service Multiplexor Servlet</servlet-name>
+ <url-pattern>/soap/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>HTTP Proxy Servlet</servlet-name>
+ <url-pattern>/proxy/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>JUnit test servlet</servlet-name>
+ <url-pattern>/test</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>Log servlet</servlet-name>
+ <url-pattern>/logs/*</url-pattern>
+ </servlet-mapping>
+
+ <!-- Initialise WS-C services -->
+ <listener>
+ <listener-class>com.arjuna.webservices.wscoor11.server.ActivationCoordinatorInitialisation</listener-class>
+ </listener>
+ <listener>
+ <listener-class>com.arjuna.webservices.wscoor11.server.ActivationRequesterInitialisation</listener-class>
+ </listener>
+ <listener>
+ <listener-class>com.arjuna.webservices.wscoor11.server.RegistrationCoordinatorInitialisation</listener-class>
+ </listener>
+ <listener>
+ <listener-class>com.arjuna.webservices.wscoor11.server.RegistrationRequesterInitialisation</listener-class>
+ </listener>
+
+ <!-- Initialise WS-C -->
+ <listener>
+ <listener-class>com.arjuna.wsc.messaging.deploy.Coordination11Initialisation</listener-class>
+ </listener>
+
+ <!-- Initialise WS-AT services -->
+ <listener>
+ <listener-class>com.arjuna.webservices.wsat11.server.CompletionCoordinatorInitialisation</listener-class>
+ </listener>
+ <listener>
+ <listener-class>com.arjuna.webservices.wsat11.server.CompletionInitiatorInitialisation</listener-class>
+ </listener>
+ <listener>
+ <listener-class>com.arjuna.webservices.wsat11.server.CoordinatorInitialisation</listener-class>
+ </listener>
+ <listener>
+ <listener-class>com.arjuna.webservices.wsat11.server.ParticipantInitialisation</listener-class>
+ </listener>
+
+ <!-- Initialise WS-BA services -->
+ <listener>
+ <listener-class>com.arjuna.webservices.wsba11.server.CoordinatorCompletionCoordinatorInitialisation</listener-class>
+ </listener>
+ <listener>
+ <listener-class>com.arjuna.webservices.wsba11.server.CoordinatorCompletionParticipantInitialisation</listener-class>
+ </listener>
+ <listener>
+ <listener-class>com.arjuna.webservices.wsba11.server.ParticipantCompletionCoordinatorInitialisation</listener-class>
+ </listener>
+ <listener>
+ <listener-class>com.arjuna.webservices.wsba11.server.ParticipantCompletionParticipantInitialisation</listener-class>
+ </listener>
+
+ <!-- Initialise JBossTX services -->
+ <listener>
+ <listener-class>com.arjuna.webservices.wsjbosstx.server.TerminationCoordinatorInitialisation</listener-class>
+ </listener>
+ <listener>
+ <listener-class>com.arjuna.webservices.wsjbosstx.server.TerminationParticipantInitialisation</listener-class>
+ </listener>
+
+ <!-- Initialise WS-T -->
+ <listener>
+ <listener-class>com.arjuna.wst.messaging.deploy.Transaction11Initialisation</listener-class>
+ </listener>
+
+ <!-- Initialise WSCF -->
+ <listener>
+ <listener-class>com.arjuna.mw.wsc.deploy.WSCFInitialisation</listener-class>
+ </listener>
+
+ <!-- Initialise WSTX -->
+ <listener>
+ <listener-class>com.arjuna.mw.wst.deploy.WSTXInitialisation</listener-class>
+ </listener>
+
+ <filter>
+ <filter-name>HTTP Content Type filter</filter-name>
+ <filter-class>com.arjuna.webservices.transport.http.HttpContentTypeFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>HTTP Content Type filter</filter-name>
+ <servlet-name>HTTP SOAP Service Multiplexor Servlet</servlet-name>
+ </filter-mapping>
+
+
+ <!-- Initialise interop services -->
+ <listener>
+ <listener-class>com.jboss.transaction.txinterop.webservices.server.ParticipantInitialisation</listener-class>
+ </listener>
+ <listener>
+ <listener-class>com.jboss.transaction.txinterop.webservices.atinterop.server.ATInitiatorInitialisation</listener-class>
+ </listener>
+ <listener>
+ <listener-class>com.jboss.transaction.txinterop.webservices.bainterop.server.BAInitiatorInitialisation</listener-class>
+ </listener>
+
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ </welcome-file-list>
+</web-app>
Property changes on: labs/jbosstm/workspace/interop/WSTX11-interop/web.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:keywords
+ Rev Date
More information about the jboss-svn-commits
mailing list