Permalink
Browse files

Update POM versions. Modify README to conform to new format.

  • Loading branch information...
1 parent 3ba5109 commit 9758c545b3f7cf19e71f136e3d1498d0afa7bc70 @sgilda sgilda committed Feb 1, 2012
@@ -0,0 +1,103 @@
+<h1>wsba-participant-completion-simple: Deployment of a WS-BA (WS Business Activity) - Participant Completion</h1>
+<p>Author: Paul Robinson</p>
+<h2>What is it?</h2>
+<p>This example demonstrates the deployment of a WS-BA (WS Business Activity) enabled JAX-WS Web service bundled in a war
+archive for deployment to <em>JBoss AS 7</em>.</p>
+<p>The Web service exposes a simple 'set' collection as a service. The Service allows items to be added to the set within a
+Business Activity.</p>
+<p>The example demonstrates the basics of implementing a WS-BA enabled Web service. It is beyond the scope of this
+quick start to demonstrate more advanced features. In particular</p>
+<ol>
+<li>The Service does not implement the required hooks to support recovery in the presence of failures.</li>
+<li>It also does not utilize a transactional back end resource.</li>
+<li>Only one Web service participates in the protocol. As WS-BA is a coordination protocol, it is best suited to multi-participant scenarios.</li>
+</ol>
+<p>For a more complete example, please see the XTS demonstrator application that ships with the JBossTS project: http://www.jboss.org/jbosstm.</p>
+<p>It is also assumed tht you have an understanding of WS-BusinessActivity. For more details, read the XTS documentation
+that ships with the JBossTS project, which can be downloaded here: http://www.jboss.org/jbosstm/downloads/JBOSSTS_4_16_0_Final</p>
+<p>The application consists of a single JAX-WS web service that is deployed within a war archive. It is tested with a JBoss
+Arquillian enabled JUnit test.</p>
+<p>When running the org.jboss.as.quickstarts.wsba.participantcompletion.simple.ClientTest#testSuccess() method, the
+following steps occur:</p>
+<ol>
+<li>A new Business Activity is created by the client.</li>
+<li>An operation on a WS-BA enabled Web service is invoked by the client.</li>
+<li>The JaxWSHeaderContextProcessor in the WS Client handler chain inserts the BA context into the outgoing SOAP message</li>
+<li>When the service receives the SOAP request, it's JaxWSHeaderContextProcessor in it's handler chain inspects the BA context and associates the request with this BA.</li>
+<li>The Web service operation is invoked...</li>
+<li>A participant is enlisted in this BA. This allows the Web Service logic to respond to protocol events, such as compensate and close.</li>
+<li>The service invokes the business logic. In this case, a String value is added to the set.</li>
+<li>The backend resource is prepared. This ensures that the Backend resource can undo or make permanent the change when told to do so by the coordinator.</li>
+<li>Providing the above steps where successful, the service notifies the coordinator that it has completed. The service has now made it's changes visible and is not holding any locks. Allowing the service to notify completion is an optimisation that prevents the holding of locks, whilst waiting for other participants to complete. This notification is required as the Service participates in the ParticipantCompletion protocol.</li>
+<li>The client can then decide to complete or cancel the BA. If the client decides to complete, all participants will be told to close. If the participant decides to cancel, all participants will be told to compensate.</li>
+</ol>
+<p>There are other tests that show:</p>
+<h1>What happens when an application exception is thrown by the service.</h1>
+<h1>How the client can cancel a BA.</h1>
+<h2>System requirements</h2>
+<p>All you need to build this project is Java 6.0 (Java SDK 1.6) or better, Maven
+3.0 or better.</p>
+<p>The application this project produces is designed to be run on a JBoss AS 7 or EAP 6.
+The following instructions target JBoss AS 7, but they also apply to JBoss EAP 6.</p>
+<p>With the prerequisites out of the way, you're ready to build and deploy.</p>
+<h2>Deploying the application</h2>
+<p>First you need to start JBoss AS 7 (7.1.0.CR1 or above, or EAP 6), with the XTS sub system enabled, this is enabled through an optional server configuration (standalone-xts.xml). To do this, run the following commands, from within the top-level directory of JBossAS:</p>
+<pre><code>./bin/standalone.sh --server-config=../../docs/examples/configs/standalone-xts.xml | egrep "started|stdout"
+</code></pre>
+<p>Note, the pipe to egrep (| egrep "started|stdout") is useful to just show when the server has started and the output from these tests. For normal operation, this pipe can be removed.</p>
+<p>or if you are using windows</p>
+<pre><code>./bin/standalone.bat --server-config=../../docs/examples/configs/standalone-xts.xml
+</code></pre>
+<p>To test the application run:</p>
+<pre><code>mvn clean test -Parq-jbossas-remote
+</code></pre>
+<p>The following expected output should appear. The output explains what actually went on when these tests ran.</p>
+<p>Test success:</p>
+<pre><code>11:41:02,386 INFO [stdout] (management-handler-threads - 6) Starting 'testSuccess'. This test invokes a WS within a BA. The BA is later closed, which causes the WS call to complete successfully.
+11:41:02,386 INFO [stdout] (management-handler-threads - 6) [CLIENT] Creating a new Business Activity
+11:41:02,386 INFO [stdout] (management-handler-threads - 6) [CLIENT] Beginning Business Activity (All calls to Web services that support WS-BA wil be included in this activity)
+11:41:02,927 INFO [stdout] (management-handler-threads - 6) [CLIENT] invoking addValueToSet(1) on WS
+11:41:03,233 INFO [stdout] (http-localhost-127.0.0.1-8080-1) [SERVICE] invoked addValueToSet('1')
+11:41:03,233 INFO [stdout] (http-localhost-127.0.0.1-8080-1) [SERVICE] Enlisting a participant into the BA
+11:41:03,336 INFO [stdout] (http-localhost-127.0.0.1-8080-1) [SERVICE] Invoking the back-end business logic
+11:41:03,336 INFO [stdout] (http-localhost-127.0.0.1-8080-1) [SERVICE] Prepare the backend resource and if successful notify the coordinator that we have completed our work
+11:41:03,337 INFO [stdout] (http-localhost-127.0.0.1-8080-1) [SERVICE] Prepare successful, notifying coordinator of completion
+11:41:03,660 INFO [stdout] (http-localhost-127.0.0.1-8080-1) SetParticipantBA.confirmCompleted('true')
+11:41:03,660 INFO [stdout] (http-localhost-127.0.0.1-8080-1) [SERVICE] Participant.confirmCompleted('true') (This tells the participant that compensation information has been logged and that it is safe to commit any changes.)
+11:41:03,660 INFO [stdout] (http-localhost-127.0.0.1-8080-1) [SERVICE] Commit the backend resource (e.g. commit any changes to databases so that they are visible to others)
+11:41:03,779 INFO [stdout] (management-handler-threads - 6) [CLIENT] Closing Business Activity (This will cause the BA to complete successfully)
+11:41:04,330 INFO [stdout] (TaskWorker-2) [SERVICE] Participant.close (The participant knows that this BA is now finished and can throw away any temporary state)
+</code></pre>
+<p>Test cancel:</p>
+<pre><code>11:41:04,721 INFO [stdout] (management-handler-threads - 5) Starting 'testCancel'. This test invokes a WS within a BA. The BA is later cancelled, which causes these WS call to be compensated.
+11:41:04,721 INFO [stdout] (management-handler-threads - 5) [CLIENT] Creating a new Business Activity
+11:41:04,721 INFO [stdout] (management-handler-threads - 5) [CLIENT] Beginning Business Activity (All calls to Web services that support WS-BA will be included in this activity)
+11:41:04,781 INFO [stdout] (management-handler-threads - 5) [CLIENT] invoking addValueToSet(1) on WS
+11:41:05,133 INFO [stdout] (http-localhost-127.0.0.1-8080-1) [SERVICE] invoked addValueToSet('1')
+11:41:05,134 INFO [stdout] (http-localhost-127.0.0.1-8080-1) [SERVICE] Enlisting a participant into the BA
+11:41:05,241 INFO [stdout] (http-localhost-127.0.0.1-8080-1) [SERVICE] Invoking the back-end business logic
+11:41:05,242 INFO [stdout] (http-localhost-127.0.0.1-8080-1) [SERVICE] Prepare the backend resource and if successful notify the coordinator that we have completed our work
+11:41:05,242 INFO [stdout] (http-localhost-127.0.0.1-8080-1) [SERVICE] Prepare successful, notifying coordinator of completion
+11:41:05,305 INFO [stdout] (http-localhost-127.0.0.1-8080-1) SetParticipantBA.confirmCompleted('true')
+11:41:05,305 INFO [stdout] (http-localhost-127.0.0.1-8080-1) [SERVICE] Participant.confirmCompleted('true') (This tells the participant that compensation information has been logged and that it is safe to commit any changes.)
+</code></pre>
+<p>You can also start JBoss AS 7 and run the tests within Eclipse. See the JBoss AS 7
+Getting Started Guide for Developers for more information.</p>
+<h1>Importing the project into an IDE</h1>
+<p>If you created the project using the Maven archetype wizard in your IDE
+(Eclipse, NetBeans or IntelliJ IDEA), then there is nothing to do. You should
+already have an IDE project.</p>
+<p>Detailed instructions for using Eclipse with JBoss AS 7 are provided in the
+JBoss AS 7 Getting Started Guide for Developers.</p>
+<p>If you created the project from the commandline using archetype:generate, then
+you need to import the project into your IDE. If you are using NetBeans 6.8 or
+IntelliJ IDEA 9, then all you have to do is open the project as an existing
+project. Both of these IDEs recognize Maven projects natively.</p>
+<h1>Downloading the sources and Javadocs</h1>
+<p>If you want to be able to debug into the source code or look at the Javadocs
+of any library in the project, you can run either of the following two
+commands to pull them into your local repository. The IDE should then detect
+them.</p>
+<pre><code>mvn dependency:sources
+mvn dependency:resolve -Dclassifier=javadoc
+</code></pre>
@@ -1,5 +1,6 @@
-WSBA - Participant Completion
-========================
+wsba-participant-completion-simple: Deployment of a WS-BA (WS Business Activity) - Participant Completion
+=========================================================================================================
+Author: Paul Robinson
What is it?
-----------
@@ -137,14 +137,14 @@ as the API is included in JBoss AS 7 -->
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
- <version>1.0.0.CR4</version>
+ <version>1.0.0.CR7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.protocol</groupId>
<artifactId>arquillian-protocol-servlet</artifactId>
- <version>1.0.0.CR4</version>
+ <version>1.0.0.CR7</version>
<scope>test</scope>
</dependency>
@@ -163,7 +163,7 @@ as the API is included in JBoss AS 7 -->
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
- <version>7.1.0.Beta1b</version>
+ <version>7.1.0.CR1</version>
</plugin>
<!-- Compiler plugin enforces Java 1.6 compatibility and activates
annotation processors -->
@@ -190,7 +190,7 @@ as the API is included in JBoss AS 7 -->
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-arquillian-container-managed</artifactId>
- <version>7.1.0.Beta1b</version>
+ <version>7.1.0.CR1b</version>
<scope>test</scope>
</dependency>
</dependencies>
@@ -206,7 +206,7 @@ as the API is included in JBoss AS 7 -->
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-arquillian-container-remote</artifactId>
- <version>7.1.0.Beta1b</version>
+ <version>7.1.0.CR1b</version>
<scope>test</scope>
</dependency>
</dependencies>

0 comments on commit 9758c54

Please sign in to comment.