Adding the test-cases & the necessary build scripts for the ws-ba implementation
diff --git a/conf/ActivationCoordinator/META-INF/services.xml b/conf/ActivationCoordinator/META-INF/services.xml
index 1729cc7..62c287e 100644
--- a/conf/ActivationCoordinator/META-INF/services.xml
+++ b/conf/ActivationCoordinator/META-INF/services.xml
@@ -1,22 +1,17 @@
-<!--service name="ActivationCoordinator">
- <description>
- Coordination service.
- </description>
- <parameter name="ServiceClass" locked="xsd:false">org.apache.kandula.wscoor.ActivationPortTypeRawXMLSkeleton</parameter>
- <operation name="createCoordinationContextOperation">
- <actionMapping>http://docs.oasis-open.org/ws-tx/wscoor/2006/06/CreateCoordinationContext</actionMapping>
- <messageReceiver class="org.apache.kandula.wscoor.ActivationPortTypeRawXMLSyncMessageReceiver"/>
- </operation>
-</service-->
-
<serviceGroup>
-<service name="ActivationCoordinator">
-<messageReceivers>
-<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.kandula.wscoor.ActivationServiceMessageReceiverInOut"/>
-</messageReceivers>
-<parameter name="ServiceClass" locked="false">org.apache.kandula.wscoor.ActivationServiceSkeleton</parameter>
-<operation name="CreateCoordinationContextOperation" mep="http://www.w3.org/2004/08/wsdl/in-out">
-<actionMapping>http://docs.oasis-open.org/ws-tx/wscoor/2006/06/CreateCoordinationContext</actionMapping>
-</operation>
-</service>
+ <service name="ActivationCoordinator">
+ <messageReceivers>
+ <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-out"
+ class="org.apache.kandula.wscoor.ActivationServiceMessageReceiverInOut" />
+ </messageReceivers>
+ <parameter name="ServiceClass" locked="false">
+ org.apache.kandula.wscoor.ActivationServiceSkeleton
+ </parameter>
+ <operation name="CreateCoordinationContextOperation"
+ mep="http://www.w3.org/2006/01/wsdl/in-out">
+ <actionMapping>
+ http://docs.oasis-open.org/ws-tx/wscoor/2006/06/CreateCoordinationContext
+ </actionMapping>
+ </operation>
+ </service>
</serviceGroup>
\ No newline at end of file
diff --git a/conf/BACoordinator/META-INF/services.xml b/conf/BACoordinator/META-INF/services.xml
new file mode 100644
index 0000000..1ad82b2
--- /dev/null
+++ b/conf/BACoordinator/META-INF/services.xml
@@ -0,0 +1,70 @@
+<!-- This file was auto-generated from WSDL -->
+<!-- by the Apache Axis2 version: #axisVersion# #today# -->
+<serviceGroup>
+<service name="BACoordinatorCompletionCoordinatorService">
+<messageReceivers>
+<messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-only" class="org.apache.kandula.wsba.BACoordinatorCompletionCoordinatorServiceMessageReceiverInOnly"/>
+</messageReceivers>
+<parameter name="ServiceClass" locked="false">org.apache.kandula.wsba.BACoordinatorCompletionCoordinatorServiceSkeleton</parameter>
+<operation name="CompensatedOperation" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/CompensatedOperation</actionMapping>
+</operation>
+<operation name="ClosedOperation" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/ClosedOperation</actionMapping>
+</operation>
+<operation name="ExitOperation" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/ExitOperation</actionMapping>
+</operation>
+<operation name="CompletedOperation" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/CompletedOperation</actionMapping>
+</operation>
+<operation name="CannotComplete" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/CannotComplete</actionMapping>
+</operation>
+<operation name="GetStatusOperation" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/GetStatusOperation</actionMapping>
+</operation>
+<operation name="FailOperation" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/FailOperation</actionMapping>
+</operation>
+<operation name="StatusOperation" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/StatusOperation</actionMapping>
+</operation>
+<operation name="CanceledOperation" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/CanceledOperation</actionMapping>
+</operation>
+</service>
+<service name="BAParticipantCompletionCoordinatorService">
+<messageReceivers>
+<messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-only" class="org.apache.kandula.wsba.BAParticipantCompletionCoordinatorServiceMessageReceiverInOnly"/>
+</messageReceivers>
+<parameter name="ServiceClass" locked="false">org.apache.kandula.wsba.BAParticipantCompletionCoordinatorServiceSkeleton</parameter>
+<operation name="CompensatedOperation" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/CompensatedOperation</actionMapping>
+</operation>
+<operation name="ClosedOperation" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/ClosedOperation</actionMapping>
+</operation>
+<operation name="ExitOperation" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/ExitOperation</actionMapping>
+</operation>
+<operation name="CompletedOperation" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/CompletedOperation</actionMapping>
+</operation>
+<operation name="CannotComplete" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/CannotComplete</actionMapping>
+</operation>
+<operation name="GetStatusOperation" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/GetStatusOperation</actionMapping>
+</operation>
+<operation name="FailOperation" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/FailOperation</actionMapping>
+</operation>
+<operation name="StatusOperation" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/StatusOperation</actionMapping>
+</operation>
+<operation name="CanceledOperation" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/CanceledOperation</actionMapping>
+</operation>
+</service>
+</serviceGroup>
diff --git a/conf/BACoordinatorCompletionParticipant/META-INF/services.xml b/conf/BACoordinatorCompletionParticipant/META-INF/services.xml
new file mode 100644
index 0000000..0f2ce1b
--- /dev/null
+++ b/conf/BACoordinatorCompletionParticipant/META-INF/services.xml
@@ -0,0 +1,37 @@
+<!-- This file was auto-generated from WSDL -->
+<!-- by the Apache Axis2 version: #axisVersion# #today# -->
+<serviceGroup>
+<service name="BACoordinatorCompletionParticipantService">
+<messageReceivers>
+<messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-only" class="org.apache.kandula.wsba.BACoordinatorCompletionParticipantServiceMessageReceiverInOnly"/>
+</messageReceivers>
+<parameter name="ServiceClass" locked="false">org.apache.kandula.wsba.BACoordinatorCompletionParticipantServiceSkeleton</parameter>
+<operation name="FailedOperation" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/FailedOperation</actionMapping>
+</operation>
+<operation name="CloseOperation" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/CloseOperation</actionMapping>
+</operation>
+<operation name="CompensateOperation" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/CompensateOperation</actionMapping>
+</operation>
+<operation name="CancelOperation" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/CancelOperation</actionMapping>
+</operation>
+<operation name="CompleteOperation" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/CompleteOperation</actionMapping>
+</operation>
+<operation name="GetStatusOperation" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/GetStatusOperation</actionMapping>
+</operation>
+<operation name="NotCompleted" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/NotCompleted</actionMapping>
+</operation>
+<operation name="StatusOperation" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/StatusOperation</actionMapping>
+</operation>
+<operation name="ExitedOperation" mep="http://www.w3.org/2006/01/wsdl/in-only">
+<actionMapping>http://docs.oasis-open.org/ws-tx/wsba/2006/06/ExitedOperation</actionMapping>
+</operation>
+</service>
+</serviceGroup>
diff --git a/conf/RegistrationCoordinator/META-INF/services.xml b/conf/RegistrationCoordinator/META-INF/services.xml
index 0bcab3e..9cfe2b3 100644
--- a/conf/RegistrationCoordinator/META-INF/services.xml
+++ b/conf/RegistrationCoordinator/META-INF/services.xml
@@ -1,12 +1,20 @@
<serviceGroup>
-<service name="RegistrationCoordinator">
-<messageReceivers>
-<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.kandula.wscoor.RegistrationServiceMessageReceiverInOut"/>
-</messageReceivers>
-<parameter name="ServiceClass" locked="false">org.apache.kandula.wscoor.RegistrationServiceSkeleton</parameter>
-<operation name="RegisterOperation" mep="http://www.w3.org/2004/08/wsdl/in-out">
-<actionMapping>http://docs.oasis-open.org/ws-tx/wscoor/2006/06/Register</actionMapping>
-<outputActionMapping>http://docs.oasis-open.org/ws-tx/wscoor/2006/06/RegistrationPortType/RegisterOperationResponse</outputActionMapping>
-</operation>
-</service>
+ <service name="RegistrationCoordinator">
+ <messageReceivers>
+ <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-out"
+ class="org.apache.kandula.wscoor.RegistrationServiceMessageReceiverInOut" />
+ </messageReceivers>
+ <parameter name="ServiceClass" locked="false">
+ org.apache.kandula.wscoor.RegistrationServiceSkeleton
+ </parameter>
+ <operation name="RegisterOperation"
+ mep="http://www.w3.org/2006/01/wsdl/in-out">
+ <actionMapping>
+ http://docs.oasis-open.org/ws-tx/wscoor/2006/06/Register
+ </actionMapping>
+ <outputActionMapping>
+ http://docs.oasis-open.org/ws-tx/wscoor/2006/06/RegistrationPortType/RegisterOperationResponse
+ </outputActionMapping>
+ </operation>
+ </service>
</serviceGroup>
diff --git a/conf/coordinator-axis2.xml b/conf/coordinator-axis2.xml
index ea045ae..7f0f055 100644
--- a/conf/coordinator-axis2.xml
+++ b/conf/coordinator-axis2.xml
@@ -35,7 +35,7 @@
<!--During a fault, stacktrace can be sent with the fault message. The following flag will control -->
<!--that behaviour.-->
- <parameter name="sendStacktraceDetailsWithFaults" locked="false">false</parameter>
+ <parameter name="sendStacktraceDetailsWithFaults" locked="false">true</parameter>
<!--If there aren't any information available to find out the fault reason, we set the message of the expcetion-->
<!--as the faultreason/Reason. But when a fault is thrown from a service or some where, it will be -->
diff --git a/conf/inflow-module.xml b/conf/inflow-module.xml
index 0a81794..c7f0576 100644
--- a/conf/inflow-module.xml
+++ b/conf/inflow-module.xml
@@ -3,5 +3,15 @@
<handler name="TransactionInHandler" class="org.apache.kandula.participant.TransactionInHandler">
<order phase="OperationInPhase"/>
</handler>
- </inflow>
+ </inflow>
+ <outflow>
+ <handler name="ParticipantOutHandler" class="org.apache.kandula.participant.ba.ParticipantOutHandler">
+ <order phase="OperationOutPhase"/>
+ </handler>
+ </outflow>
+ <OutFaultFlow>
+ <handler name="ParticipantOutFaultHandler" class="org.apache.kandula.participant.ba.ParticipantOutFaultHandler">
+ <order phase="OperationOutFaultPhase"/>
+ </handler>
+ </OutFaultFlow>
</module>
\ No newline at end of file
diff --git a/conf/initiator-axis2.xml b/conf/initiator-axis2.xml
index 5e2729d..cfe121a 100644
--- a/conf/initiator-axis2.xml
+++ b/conf/initiator-axis2.xml
@@ -1,304 +1,307 @@
<!--
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- -->
-
+ /*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+
<axisconfig name="AxisJava2.0">
- <!-- ================================================= -->
- <!-- Parameters -->
- <!-- ================================================= -->
- <parameter name="hotdeployment" locked="false">true</parameter>
- <parameter name="hotupdate" locked="false">false</parameter>
- <parameter name="enableMTOM" locked="false">false</parameter>
- <parameter name="enableSwA" locked="false">false</parameter>
+ <!-- ================================================= -->
+ <!-- Parameters -->
+ <!-- ================================================= -->
+ <parameter name="hotdeployment" locked="false">true</parameter>
+ <parameter name="hotupdate" locked="false">false</parameter>
+ <parameter name="enableMTOM" locked="false">false</parameter>
+ <parameter name="enableSwA" locked="false">false</parameter>
- <!--Uncomment if you want to enable file caching for attachments -->
- <!--parameter name="cacheAttachments" locked="false">true</parameter>
- <parameter name="attachmentDIR" locked="false"></parameter>
- <parameter name="sizeThreshold" locked="false">4000</parameter-->
+ <!--Uncomment if you want to enable file caching for attachments -->
+ <!--parameter name="cacheAttachments" locked="false">true</parameter>
+ <parameter name="attachmentDIR" locked="false"></parameter>
+ <parameter name="sizeThreshold" locked="false">4000</parameter-->
- <!--This will give out the timout of the configuration contexts, in seconds-->
- <parameter name="ConfigContextTimeoutInterval" locked="false">30</parameter>
+ <!--This will give out the timout of the configuration contexts, in seconds-->
+ <parameter name="ConfigContextTimeoutInterval" locked="false">30</parameter>
- <!--During a fault, stacktrace can be sent with the fault message. The following flag will control -->
- <!--that behaviour.-->
- <parameter name="sendStacktraceDetailsWithFaults" locked="false">false</parameter>
+ <!--During a fault, stacktrace can be sent with the fault message. The following flag will control -->
+ <!--that behaviour.-->
+ <parameter name="sendStacktraceDetailsWithFaults" locked="false">false</parameter>
- <!--If there aren't any information available to find out the fault reason, we set the message of the expcetion-->
- <!--as the faultreason/Reason. But when a fault is thrown from a service or some where, it will be -->
- <!--wrapped by different levels. Due to this the initial exception message can be lost. If this flag-->
- <!--is set then, Axis2 tries to get the first exception and set its message as the faultreason/Reason.-->
- <parameter name="DrillDownToRootCauseForFaultReason" locked="false">false</parameter>
+ <!--If there aren't any information available to find out the fault reason, we set the message of the expcetion-->
+ <!--as the faultreason/Reason. But when a fault is thrown from a service or some where, it will be -->
+ <!--wrapped by different levels. Due to this the initial exception message can be lost. If this flag-->
+ <!--is set then, Axis2 tries to get the first exception and set its message as the faultreason/Reason.-->
+ <parameter name="DrillDownToRootCauseForFaultReason" locked="false">false</parameter>
- <parameter name="userName" locked="false">admin</parameter>
- <parameter name="password" locked="false">axis2</parameter>
+ <parameter name="userName" locked="false">admin</parameter>
+ <parameter name="password" locked="false">axis2</parameter>
- <!--To override repository/services you need to uncomment following parameter and value SHOULD be absolute file path.-->
- <!--<parameter name="ServicesDirectory" locked="false">service</parameter>-->
- <!--To override repository/modules you need to uncomment following parameter and value SHOULD be absolute file path-->
- <!--<parameter name="ModulesDirectory" locked="false">modules</parameter>-->
+ <!--To override repository/services you need to uncomment following parameter and value SHOULD be absolute file path.-->
+ <!--<parameter name="ServicesDirectory" locked="false">service</parameter>-->
+ <!--To override repository/modules you need to uncomment following parameter and value SHOULD be absolute file path-->
+ <!--<parameter name="ModulesDirectory" locked="false">modules</parameter>-->
- <!--Following params will set the proper context paths for invocations. All the endpoints will have a commons context-->
- <!--root which can configured using the following contextRoot parameter-->
- <!--<parameter name="contextRoot" locked="false">axis2</parameter>-->
+ <!--Following params will set the proper context paths for invocations. All the endpoints will have a commons context-->
+ <!--root which can configured using the following contextRoot parameter-->
+ <!--<parameter name="contextRoot" locked="false">axis2</parameter>-->
- <!--Our HTTP endpoints can handle both REST and SOAP. Following parameters can be used to distingiush those endpoints-->
- <!--In case of a servlet, if you change this you have to manually change the settings of your servlet container to map this -->
- <!--context path to proper Axis2 servlets-->
- <!--<parameter name="servicePath" locked="false">services</parameter>-->
- <!--<parameter name="restPath" locked="false">rest</parameter>-->
+ <!--Our HTTP endpoints can handle both REST and SOAP. Following parameters can be used to distingiush those endpoints-->
+ <!--In case of a servlet, if you change this you have to manually change the settings of your servlet container to map this -->
+ <!--context path to proper Axis2 servlets-->
+ <!--<parameter name="servicePath" locked="false">services</parameter>-->
+ <!--<parameter name="restPath" locked="false">rest</parameter>-->
- <!--Set the flag to true if you want to enable transport level session mangment-->
- <parameter name="manageTransportSession" locked="false">false</parameter>
+ <!--Set the flag to true if you want to enable transport level session mangment-->
+ <parameter name="manageTransportSession" locked="false">false</parameter>
- <!--Following two parameters will be used to handle REST in Axis2. The default settings will make Axis2 to have two-->
- <!--different endpoints, one for REST (AxisRESTServlet) one for SOAP message handling (AxisServlet). But following-->
- <!--parameters help to tweak the message handling of two main servlets. -->
+ <!--Following two parameters will be used to handle REST in Axis2. The default settings will make Axis2 to have two-->
+ <!--different endpoints, one for REST (AxisRESTServlet) one for SOAP message handling (AxisServlet). But following-->
+ <!--parameters help to tweak the message handling of two main servlets. -->
- <!-- If the enableRESTInAxis2MainServlet is true, then Axis2MainServlet will handle both SOAP and REST messages -->
- <parameter name="enableRESTInAxis2MainServlet" locked="true">false</parameter>
+ <!-- If the enableRESTInAxis2MainServlet is true, then Axis2MainServlet will handle both SOAP and REST messages -->
+ <parameter name="enableRESTInAxis2MainServlet" locked="true">false</parameter>
- <!-- Following parameter will completely disable REST handling in both the servlets-->
- <parameter name="disableREST" locked="true">false</parameter>
+ <!-- Following parameter will completely disable REST handling in both the servlets-->
+ <parameter name="disableREST" locked="true">false</parameter>
- <!-- This will disable the separate servlet we have for REST handling. -->
- <parameter name="disableSeparateEndpointForREST" locked="true">false</parameter>
+ <!-- This will disable the separate servlet we have for REST handling. -->
+ <parameter name="disableSeparateEndpointForREST" locked="true">false</parameter>
- <!-- If you have a frontend host which exposes this webservice using a different public URL -->
- <!-- use this parameter to override autodetected url -->
- <!--<parameter name="httpFrontendHostUrl" locked="false">https://someotherhost/context</parameter>-->
+ <!-- If you have a frontend host which exposes this webservice using a different public URL -->
+ <!-- use this parameter to override autodetected url -->
+ <!--<parameter name="httpFrontendHostUrl" locked="false">https://someotherhost/context</parameter>-->
- <!-- The way of adding listener to the system-->
- <!-- <listener class="org.apache.axis2.ObserverIMPL">-->
- <!-- <parameter name="RSS_URL" locked="false">http://127.0.0.1/rss</parameter>-->
- <!-- </listener>-->
+ <!-- The way of adding listener to the system-->
+ <!-- <listener class="org.apache.axis2.ObserverIMPL">-->
+ <!-- <parameter name="RSS_URL" locked="false">http://127.0.0.1/rss</parameter>-->
+ <!-- </listener>-->
- <!-- ================================================= -->
- <!-- Message Receivers -->
- <!-- ================================================= -->
- <!--This is the Deafult Message Receiver for the system , if you want to have MessageReceivers for -->
- <!--all the other MEP implement it and add the correct entry to here , so that you can refer from-->
- <!--any operation -->
- <!--Note : You can ovride this for particular service by adding the same element with your requirement-->
- <messageReceivers>
- <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
- class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
- <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
- class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
- </messageReceivers>
- <!-- ================================================= -->
- <!-- Transport Ins -->
- <!-- ================================================= -->
- <transportReceiver name="http"
- class="org.apache.axis2.transport.http.SimpleHTTPServer">
- <parameter name="port" locked="false">8080</parameter>
- <!-- Here is the complete list of supported parameters (see example settings further below):
- port: the port to listen on (default 6060)
- hostname: if non-null, url prefix used in reply-to endpoint references (default null)
- originServer: value of http Server header in outgoing messages (default "Simple-Server/1.1")
- requestTimeout: value in millis of time that requests can wait for data (default 20000)
- requestTcpNoDelay: true to maximize performance and minimize latency (default true)
- false to minimize bandwidth consumption by combining segments
- requestCoreThreadPoolSize: number of threads available for request processing (unless queue fills up) (default 25)
- requestMaxThreadPoolSize: number of threads available for request processing if queue fills us (default 150)
- note that default queue never fills up: see HttpFactory
- threadKeepAliveTime: time to keep threads in excess of core size alive while inactive (default 180)
- note that no such threads can exist with default unbounded request queue
- threadKeepAliveTimeUnit: TimeUnit of value in threadKeepAliveTime (default SECONDS) (default SECONDS)
- -->
- <!-- <parameter name="hostname" locked="false">http://www.myApp.com/ws</parameter> -->
- <!-- <parameter name="originServer" locked="false">My-Server/1.1</parameter> -->
- <!-- <parameter name="requestTimeout" locked="false">10000</parameter> -->
- <!-- <parameter name="requestTcpNoDelay" locked="false">false</parameter> -->
- <!-- <parameter name="requestCoreThreadPoolSize" locked="false">50</parameter> -->
- <!-- <parameter name="RequestMaxThreadPoolSize" locked="false">100</parameter> -->
- <!-- <parameter name="threadKeepAliveTime" locked="false">240000</parameter> -->
- <!-- <parameter name="threadKeepAliveTimeUnit" locked="false">MILLISECONDS</parameter> -->
- </transportReceiver>
-
- <!--Uncomment this and configure as appropriate for JMS transport support, after setting up your JMS environment (e.g. ActiveMQ)
- <transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
- <parameter name="myTopicConnectionFactory" locked="false">
- <parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
- <parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>
- <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">TopicConnectionFactory</parameter>
- </parameter>
+ <!-- ================================================= -->
+ <!-- Message Receivers -->
+ <!-- ================================================= -->
+ <!--This is the Deafult Message Receiver for the system , if you want to have MessageReceivers for -->
+ <!--all the other MEP implement it and add the correct entry to here , so that you can refer from-->
+ <!--any operation -->
+ <!--Note : You can ovride this for particular service by adding the same element with your requirement-->
+ <messageReceivers>
+ <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
+ class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver" />
+ <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
+ class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver" />
+ </messageReceivers>
+ <!-- ================================================= -->
+ <!-- Transport Ins -->
+ <!-- ================================================= -->
+ <transportReceiver name="http"
+ class="org.apache.axis2.transport.http.SimpleHTTPServer">
+ <parameter name="port" locked="false">8080</parameter>
+ <!-- Here is the complete list of supported parameters (see example settings further below):
+ port: the port to listen on (default 6060)
+ hostname: if non-null, url prefix used in reply-to endpoint references (default null)
+ originServer: value of http Server header in outgoing messages (default "Simple-Server/1.1")
+ requestTimeout: value in millis of time that requests can wait for data (default 20000)
+ requestTcpNoDelay: true to maximize performance and minimize latency (default true)
+ false to minimize bandwidth consumption by combining segments
+ requestCoreThreadPoolSize: number of threads available for request processing (unless queue fills up) (default 25)
+ requestMaxThreadPoolSize: number of threads available for request processing if queue fills us (default 150)
+ note that default queue never fills up: see HttpFactory
+ threadKeepAliveTime: time to keep threads in excess of core size alive while inactive (default 180)
+ note that no such threads can exist with default unbounded request queue
+ threadKeepAliveTimeUnit: TimeUnit of value in threadKeepAliveTime (default SECONDS) (default SECONDS)
+ -->
+ <!-- <parameter name="hostname" locked="false">http://www.myApp.com/ws</parameter> -->
+ <!-- <parameter name="originServer" locked="false">My-Server/1.1</parameter> -->
+ <!-- <parameter name="requestTimeout" locked="false">10000</parameter> -->
+ <!-- <parameter name="requestTcpNoDelay" locked="false">false</parameter> -->
+ <!-- <parameter name="requestCoreThreadPoolSize" locked="false">50</parameter> -->
+ <!-- <parameter name="RequestMaxThreadPoolSize" locked="false">100</parameter> -->
+ <!-- <parameter name="threadKeepAliveTime" locked="false">240000</parameter> -->
+ <!-- <parameter name="threadKeepAliveTimeUnit" locked="false">MILLISECONDS</parameter> -->
+ </transportReceiver>
- <parameter name="myQueueConnectionFactory" locked="false">
- <parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
- <parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>
- <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
- </parameter>
+ <!--Uncomment this and configure as appropriate for JMS transport support, after setting up your JMS environment (e.g. ActiveMQ)
+ <transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
+ <parameter name="myTopicConnectionFactory" locked="false">
+ <parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+ <parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>
+ <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">TopicConnectionFactory</parameter>
+ </parameter>
+
+ <parameter name="myQueueConnectionFactory" locked="false">
+ <parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+ <parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>
+ <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
+ </parameter>
+
+ <parameter name="default" locked="false">
+ <parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+ <parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>
+ <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
+ </parameter>
+ </transportReceiver>-->
- <parameter name="default" locked="false">
- <parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
- <parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>
- <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
- </parameter>
- </transportReceiver>-->
-
- <!--Uncomment if you want to have SMTP transport support-->
- <!--<transportReceiver name="mail" class="org.apache.axis2.transport.mail.SimpleMailListener">-->
- <!--<parameter name="transport.mail.pop3.host" locked="false">127.0.0.1</parameter>-->
- <!--<parameter name="transport.mail.pop3.user" locked="false">axis2</parameter>-->
- <!--<parameter name="transport.mail.pop3.password" locked="false">axis2</parameter>-->
- <!--<parameter name="transport.mail.pop3.port" locked="false">110</parameter>-->
- <!--<parameter name="transport.mail.replyToAddress" locked="false">axis2@127.0.0.1</parameter>-->
- <!--</transportReceiver>-->
+ <!--Uncomment if you want to have SMTP transport support-->
+ <!--<transportReceiver name="mail" class="org.apache.axis2.transport.mail.SimpleMailListener">-->
+ <!--<parameter name="transport.mail.pop3.host" locked="false">127.0.0.1</parameter>-->
+ <!--<parameter name="transport.mail.pop3.user" locked="false">axis2</parameter>-->
+ <!--<parameter name="transport.mail.pop3.password" locked="false">axis2</parameter>-->
+ <!--<parameter name="transport.mail.pop3.port" locked="false">110</parameter>-->
+ <!--<parameter name="transport.mail.replyToAddress" locked="false">axis2@127.0.0.1</parameter>-->
+ <!--</transportReceiver>-->
<!--Uncomment if you want to have TCP transport support-->
- <!--transportReceiver name="tcp"
- class="org.apache.axis2.transport.tcp.TCPServer">
- <parameter name="port" locked="false">6060</parameter-->>
- <!--If you want to give your own host address for EPR generation-->
- <!--uncommet following paramter , and set as you required.-->
- <!--<parameter name="hostname" locked="false">tcp://myApp.com/ws</parameter>-->
- <!-- /transportReceiver -->
+ <!--transportReceiver name="tcp"
+ class="org.apache.axis2.transport.tcp.TCPServer">
+ <parameter name="port" locked="false">6060</parameter-->
+ >
+ <!--If you want to give your own host address for EPR generation-->
+ <!--uncommet following paramter , and set as you required.-->
+ <!--<parameter name="hostname" locked="false">tcp://myApp.com/ws</parameter>-->
+ <!-- /transportReceiver -->
- <!-- ================================================= -->
- <!-- Transport Outs -->
- <!-- ================================================= -->
+ <!-- ================================================= -->
+ <!-- Transport Outs -->
+ <!-- ================================================= -->
- <transportSender name="tcp"
- class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
- <transportSender name="local"
- class="org.apache.axis2.transport.local.LocalTransportSender"/>
- <transportSender name="http"
- class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
- <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
- <parameter name="Transfer-Encoding" locked="false">chunked</parameter>
- </transportSender>
- <transportSender name="https"
- class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
- <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
- <parameter name="Transfer-Encoding" locked="false">chunked</parameter>
- </transportSender>
- <!--Uncomment this and configure as appropriate for JMS transport support, after setting up your JMS environment (e.g. ActiveMQ)
- <transportSender name="jms"
- class="org.apache.axis2.transport.jms.JMSSender"/>
- -->
+ <transportSender name="tcp"
+ class="org.apache.axis2.transport.tcp.TCPTransportSender" />
+ <transportSender name="local"
+ class="org.apache.axis2.transport.local.LocalTransportSender" />
+ <transportSender name="http"
+ class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+ <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
+ <parameter name="Transfer-Encoding" locked="false">chunked</parameter>
+ </transportSender>
+ <transportSender name="https"
+ class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+ <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
+ <parameter name="Transfer-Encoding" locked="false">chunked</parameter>
+ </transportSender>
+ <!--Uncomment this and configure as appropriate for JMS transport support, after setting up your JMS environment (e.g. ActiveMQ)
+ <transportSender name="jms"
+ class="org.apache.axis2.transport.jms.JMSSender"/>
+ -->
- <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport Receiver
- <transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
- <parameter name="transport.mail.smtp.host" locked="false">127.0.0.1</parameter>
- <parameter name="transport.mail.smtp.user" locked="false">axis2</parameter>
- <parameter name="transport.mail.smtp.password" locked="false">axis2</parameter>
- <parameter name="transport.mail.smtp.port" locked="false">25</parameter>
- </transportSender>
- -->
+ <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport Receiver
+ <transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
+ <parameter name="transport.mail.smtp.host" locked="false">127.0.0.1</parameter>
+ <parameter name="transport.mail.smtp.user" locked="false">axis2</parameter>
+ <parameter name="transport.mail.smtp.password" locked="false">axis2</parameter>
+ <parameter name="transport.mail.smtp.port" locked="false">25</parameter>
+ </transportSender>
+ -->
- <!-- ================================================= -->
- <!-- Global Modules -->
- <!-- ================================================= -->
- <!-- Comment this to disable Addressing -->
- <module ref="addressing"/>
- <module ref="kandula-outflow"/>
+ <!-- ================================================= -->
+ <!-- Global Modules -->
+ <!-- ================================================= -->
+ <!-- Comment this to disable Addressing -->
+ <module ref="addressing" />
+ <module ref="kandula-outflow" />
- <!--Configuring module , providing parameters for modules whether they refer or not-->
- <!--<moduleConfig name="addressing">-->
- <!--<parameter name="addressingPara" locked="false">N/A</parameter>-->
- <!--</moduleConfig>-->
+ <!--Configuring module , providing parameters for modules whether they refer or not-->
+ <!--<moduleConfig name="addressing">-->
+ <!--<parameter name="addressingPara" locked="false">N/A</parameter>-->
+ <!--</moduleConfig>-->
- <!-- ================================================= -->
- <!-- Phases -->
- <!-- ================================================= -->
- <phaseOrder type="InFlow">
- <!-- System pre defined phases -->
- <phase name="Transport">
- <handler name="RequestURIBasedDispatcher"
- class="org.apache.axis2.engine.RequestURIBasedDispatcher">
- <order phase="Transport"/>
- </handler>
- <handler name="SOAPActionBasedDispatcher"
- class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
- <order phase="Transport"/>
- </handler>
- </phase>
- <phase name="Security"/>
- <phase name="PreDispatch"/>
- <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
- <handler name="AddressingBasedDispatcher"
- class="org.apache.axis2.engine.AddressingBasedDispatcher">
- <order phase="Dispatch"/>
- </handler>
+ <!-- ================================================= -->
+ <!-- Phases -->
+ <!-- ================================================= -->
+ <phaseOrder type="InFlow">
+ <!-- System pre defined phases -->
+ <phase name="Transport">
+ <handler name="RequestURIBasedDispatcher"
+ class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+ <order phase="Transport" />
+ </handler>
+ <handler name="SOAPActionBasedDispatcher"
+ class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+ <order phase="Transport" />
+ </handler>
+ </phase>
+ <phase name="Security" />
+ <phase name="PreDispatch" />
+ <phase name="Dispatch"
+ class="org.apache.axis2.engine.DispatchPhase">
+ <handler name="AddressingBasedDispatcher"
+ class="org.apache.axis2.engine.AddressingBasedDispatcher">
+ <order phase="Dispatch" />
+ </handler>
- <handler name="SOAPMessageBodyBasedDispatcher"
- class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
- <order phase="Dispatch"/>
- </handler>
- <handler name="InstanceDispatcher"
- class="org.apache.axis2.engine.InstanceDispatcher">
- <order phase="Dispatch"/>
- </handler>
- </phase>
- <!-- System pre defined phases -->
- <!-- After Postdispatch phase module author or or service author can add any phase he want -->
- <phase name="OperationInPhase"/>
- <phase name="soapmonitorPhase"/>
- </phaseOrder>
- <phaseOrder type="OutFlow">
- <!-- user can add his own phases to this area -->
- <phase name="soapmonitorPhase"/>
- <phase name="OperationOutPhase"/>
- <!--system predefined phase-->
- <!--these phase will run irrespective of the service-->
- <phase name="PolicyDetermination"/>
- <phase name="MessageOut"/>
- <phase name="Security"/>
- </phaseOrder>
- <phaseOrder type="InFaultFlow">
- <phase name="PreDispatch"/>
- <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
- <handler name="RequestURIBasedDispatcher"
- class="org.apache.axis2.engine.RequestURIBasedDispatcher">
- <order phase="Dispatch"/>
- </handler>
+ <handler name="SOAPMessageBodyBasedDispatcher"
+ class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
+ <order phase="Dispatch" />
+ </handler>
+ <handler name="InstanceDispatcher"
+ class="org.apache.axis2.engine.InstanceDispatcher">
+ <order phase="Dispatch" />
+ </handler>
+ </phase>
+ <!-- System pre defined phases -->
+ <!-- After Postdispatch phase module author or or service author can add any phase he want -->
+ <phase name="OperationInPhase" />
+ <phase name="soapmonitorPhase" />
+ </phaseOrder>
+ <phaseOrder type="OutFlow">
+ <!-- user can add his own phases to this area -->
+ <phase name="soapmonitorPhase" />
+ <phase name="OperationOutPhase" />
+ <!--system predefined phase-->
+ <!--these phase will run irrespective of the service-->
+ <phase name="PolicyDetermination" />
+ <phase name="MessageOut" />
+ <phase name="Security" />
+ </phaseOrder>
+ <phaseOrder type="InFaultFlow">
+ <phase name="PreDispatch" />
+ <phase name="Dispatch"
+ class="org.apache.axis2.engine.DispatchPhase">
+ <handler name="RequestURIBasedDispatcher"
+ class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+ <order phase="Dispatch" />
+ </handler>
- <handler name="SOAPActionBasedDispatcher"
- class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
- <order phase="Dispatch"/>
- </handler>
+ <handler name="SOAPActionBasedDispatcher"
+ class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+ <order phase="Dispatch" />
+ </handler>
- <handler name="AddressingBasedDispatcher"
- class="org.apache.axis2.engine.AddressingBasedDispatcher">
- <order phase="Dispatch"/>
- </handler>
+ <handler name="AddressingBasedDispatcher"
+ class="org.apache.axis2.engine.AddressingBasedDispatcher">
+ <order phase="Dispatch" />
+ </handler>
- <handler name="SOAPMessageBodyBasedDispatcher"
- class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
- <order phase="Dispatch"/>
- </handler>
- <handler name="InstanceDispatcher"
- class="org.apache.axis2.engine.InstanceDispatcher">
- <order phase="PostDispatch"/>
- </handler>
- </phase>
- <!-- user can add his own phases to this area -->
- <phase name="OperationInFaultPhase"/>
- <phase name="soapmonitorPhase"/>
- </phaseOrder>
- <phaseOrder type="OutFaultFlow">
- <!-- user can add his own phases to this area -->
- <phase name="soapmonitorPhase"/>
- <phase name="OperationOutFaultPhase"/>
- <phase name="PolicyDetermination"/>
- <phase name="MessageOut"/>
- </phaseOrder>
+ <handler name="SOAPMessageBodyBasedDispatcher"
+ class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
+ <order phase="Dispatch" />
+ </handler>
+ <handler name="InstanceDispatcher"
+ class="org.apache.axis2.engine.InstanceDispatcher">
+ <order phase="PostDispatch" />
+ </handler>
+ </phase>
+ <!-- user can add his own phases to this area -->
+ <phase name="OperationInFaultPhase" />
+ <phase name="soapmonitorPhase" />
+ </phaseOrder>
+ <phaseOrder type="OutFaultFlow">
+ <!-- user can add his own phases to this area -->
+ <phase name="soapmonitorPhase" />
+ <phase name="OperationOutFaultPhase" />
+ <phase name="PolicyDetermination" />
+ <phase name="MessageOut" />
+ </phaseOrder>
</axisconfig>
\ No newline at end of file
diff --git a/maven.xml b/maven.xml
index 551394a..a04375d 100644
--- a/maven.xml
+++ b/maven.xml
@@ -18,7 +18,7 @@
</path>
<maven:addPath id="maven.compile.src.set" refid="generated.src.path" />
</preGoal>
-
+
<goal name="generate:code">
<!-- Code generating for the WS-Coordination WSDL -->
<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
@@ -54,23 +54,38 @@
<!-- Code generating for the WS-BA WSDL -->
<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
<classpath refid="maven.dependency.classpath" />
- <arg line=" -o target -p org.apache.kandula.wsba -g -ss -sd -sn BAParticipantCompletionParticipantService -uri schema/wsba.wsdl" />
+ <arg line=" -o target -p org.apache.kandula.wsba -g -ss -a -sd -sn BAParticipantCompletionParticipantService -uri schema/wsba.wsdl" />
</java>
<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
<classpath refid="maven.dependency.classpath" />
- <arg line=" -o target -p org.apache.kandula.wsba -g -ss -sd -sn BACoordinatorCompletionCoordinatorService -uri schema/wsba.wsdl" />
+ <arg line=" -o target -p org.apache.kandula.wsba -g -ss -a -sd -sn BACoordinatorCompletionCoordinatorService -uri schema/wsba.wsdl" />
</java>
<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
<classpath refid="maven.dependency.classpath" />
- <arg line=" -o target -p org.apache.kandula.wsba -g -ss -sd -sn BACoordinatorCompletionParticipantService -uri schema/wsba.wsdl" />
+ <arg line=" -o target -p org.apache.kandula.wsba -g -ss -a -sd -sn BACoordinatorCompletionParticipantService -uri schema/wsba.wsdl" />
</java>
<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
<classpath refid="maven.dependency.classpath" />
- <arg line=" -o target -p org.apache.kandula.wsba -g -ss -sd -sn BAParticipantCompletionCoordinatorService -uri schema/wsba.wsdl" />
+ <arg line=" -o target -p org.apache.kandula.wsba -g -ss -a -sd -sn BAParticipantCompletionCoordinatorService -uri schema/wsba.wsdl" />
+ </java>
+ <delete>
+ <fileset dir="target/src/org/apache/kandula/wsba">
+ <include name="*Skeleton.java" />
+ </fileset>
+ </delete>
+
+ <!-- Code generating for the Testing Service -->
+ <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
+ <classpath refid="maven.dependency.classpath" />
+ <arg line=" -o target -p org.apache.kandula.integration -g -ss -sd -uri test-resources/KandulaDemoService/KandulaDemoService.wsdl" />
</java>
</goal>
-
+
<postGoal name="test:compile">
+ <attainGoal name="create:packages" />
+ </postGoal>
+
+ <goal name="create:packages">
<mkdir dir="${basedir}/target/lib" />
<deploy:copy-deps todir="${basedir}/target/lib" />
@@ -111,6 +126,20 @@
<jar jarfile="target/RegistrationCoordinator.aar" basedir="target/services/RegistrationCoordinator">
<include name="**" />
</jar>
+
+ <echo message="----------------Creating BACoordinator.aar----------------" />
+ <mkdir dir="target/services/BACoordinator/META-INF" />
+ <copy file="conf/BACoordinator/META-INF/services.xml" tofile="target/services/BACoordinator/META-INF/services.xml" />
+ <jar jarfile="target/BACoordinator.aar" basedir="target/services/BACoordinator">
+ <include name="**" />
+ </jar>
+
+ <echo message="----------------Creating BACoordinatorCompletionParticipant.aar----------------" />
+ <mkdir dir="target/services/BACoordinatorCompletionParticipant/META-INF" />
+ <copy file="conf/BACoordinatorCompletionParticipant/META-INF/services.xml" tofile="target/services/BACoordinatorCompletionParticipant/META-INF/services.xml" />
+ <jar jarfile="target/BACoordinatorCompletionParticipant.aar" basedir="target/services/BACoordinatorCompletionParticipant">
+ <include name="**" />
+ </jar>
<echo message="----------------Creating Kandula-inflow.mar----------------" />
<mkdir dir="target/modules/kandula-inflow/META-INF" />
@@ -134,17 +163,14 @@
<copy file="target/AtomicTransactionParticipant.aar" tofile="target/testing-repository/services/AtomicTransactionParticipant.aar" />
<copy file="target/CompletionCoordinator.aar" tofile="target/testing-repository/services/CompletionCoordinator.aar" />
<copy file="target/RegistrationCoordinator.aar" tofile="target/testing-repository/services/RegistrationCoordinator.aar" />
+ <copy file="target/BACoordinator.aar" tofile="target/testing-repository/services/BACoordinator.aar" />
+ <copy file="target/BACoordinatorCompletionParticipant.aar" tofile="target/testing-repository/services/BACoordinatorCompletionParticipant.aar" />
<mkdir dir="target/testing-repository/modules" />
<copy file="target/kandula-inflow-${pom.currentVersion}.mar" tofile="target/testing-repository/modules/kandula-inflow-${pom.currentVersion}.mar" />
<copy file="${repo.addressing.mar}" toDir="target/testing-repository/modules/" />
<copy file="conf/coordinator-axis2.xml" tofile="target/testing-repository/axis2.xml" />
<echo message="----------------Creating KandulaDemoService.aar----------------" />
- <ant:copy todir="${samples.dir}/version/src">
- <ant:fileset dir="src">
- <ant:include name="sample/axisversion/**" />
- </ant:fileset>
- </ant:copy>
<mkdir dir="target/services/KandulaDemoService/META-INF" />
<copy file="test-resources/KandulaDemoService/META-INF/services.xml" tofile="target/services/KandulaDemoService/META-INF/services.xml" />
<jar jarfile="target/KandulaDemoService.aar" basedir="target/services/KandulaDemoService">
@@ -152,6 +178,14 @@
</jar>
<copy file="target/KandulaDemoService.aar" tofile="target/testing-repository/services/KandulaDemoService.aar" />
+ <echo message="----------------Creating KandulaBADemoService.aar----------------" />
+ <mkdir dir="target/services/KandulaBADemoService/META-INF" />
+ <copy file="test-resources/KandulaDemoService/META-INF/services1.xml" tofile="target/services/KandulaBADemoService/META-INF/services.xml" />
+ <jar jarfile="target/KandulaBADemoService.aar" basedir="target/services/KandulaBADemoService">
+ <include name="**" />
+ </jar>
+ <copy file="target/KandulaBADemoService.aar" tofile="target/testing-repository/services/KandulaBADemoService.aar" />
+
<echo message="-----------Creating Initiator test repository----------" />
<mkdir dir="target/initiator-repository" />
<mkdir dir="target/initiator-repository/modules" />
@@ -159,6 +193,6 @@
<copy file="${repo.addressing.mar}" toDir="target/initiator-repository/modules/" />
<copy file="conf/initiator-axis2.xml" tofile="target/initiator-repository/axis2.xml" />
- </postGoal>
+ </goal>
</project>
diff --git a/project.xml b/project.xml
index 5687428..9e0ff38 100644
--- a/project.xml
+++ b/project.xml
@@ -10,7 +10,6 @@
<!-- a short but descriptive name for the project -->
<name>Apache Kandula2</name>
- <!-- The version of the project under development, e.g. 1.1, 1.2, 2.0-SNAPSHOT -->
<currentVersion>SNAPSHOT</currentVersion>
<!-- details about the organization that 'owns' the project -->
@@ -25,14 +24,17 @@
<package>org.apache.kandula</package>
<logo />
<description>
- Kandula will provide an open-source implementation of WS-Coordination,
- WS-AtomicTransaction and WS-BusinessActivity based on Axis. The initial
- implementation will be in Java using Axis/Java. In addition to providing
- an implementation, a major focus of this project would be to ensure
- interoperability with other implementations of above specifications.
+ Kandula will provide an open-source implementation of
+ WS-Coordination, WS-AtomicTransaction and WS-BusinessActivity
+ based on Axis. The initial implementation will be in Java using
+ Axis/Java. In addition to providing an implementation, a major
+ focus of this project would be to ensure interoperability with
+ other implementations of above specifications.
</description>
<!-- a short description of what the project does -->
- <shortDescription>WS-Coor, WS-AT and WS-BA implementation</shortDescription>
+ <shortDescription>
+ WS-Coor, WS-AT and WS-BA implementation
+ </shortDescription>
<!-- the project home page -->
<url>http://ws.apache.org/kandula/</url>
@@ -41,7 +43,9 @@
</issueTrackingUrl>
<siteAddress>ws.apache.org</siteAddress>
<siteDirectory>/kandula/</siteDirectory>
- <distributionDirectory>/www/ws.apache.org/builds/</distributionDirectory>
+ <distributionDirectory>
+ /www/ws.apache.org/builds/
+ </distributionDirectory>
<repository>
<connection>
@@ -61,7 +65,9 @@
<mailingList>
<name>Kandula Developer List</name>
<subscribe>kandula-dev-subscribe@ws.apache.org</subscribe>
- <unsubscribe>kandula-dev-unsubscribe@ws.apache.org</unsubscribe>
+ <unsubscribe>
+ kandula-dev-unsubscribe@ws.apache.org
+ </unsubscribe>
<archive>
http://nagoya.apache.org/eyebrowse/SummarizeList?listId=221
</archive>
@@ -179,11 +185,11 @@
<version>${axis2.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.axis2</groupId>
- <artifactId>addressing</artifactId>
- <version>${axis2.version}</version>
- <type>mar</type>
- </dependency>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>addressing</artifactId>
+ <version>${axis2.version}</version>
+ <type>mar</type>
+ </dependency>
<!-- Following dependency was required due to the EndpointReferenceHelper class-->
<!-- dependency>
@@ -239,6 +245,14 @@
<module>true</module>
</properties>
</dependency>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ <version>${commons.fileupload.version}</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
<dependency>
<groupId>httpcomponents-httpcore</groupId>
<artifactId>jakarta-httpcore</artifactId>
@@ -293,9 +307,8 @@
<unitTest>
<includes>
<include>**/CompletionCommitTest.java</include>
+ <include>**/BA*Test.java</include>
</includes>
-
-
<resources>
<resource>
<directory>${basedir}/test-resources</directory>
diff --git a/test-resources/KandulaDemoService/KandulaDemoService.wsdl b/test-resources/KandulaDemoService/KandulaDemoService.wsdl
new file mode 100644
index 0000000..61ed9d3
--- /dev/null
+++ b/test-resources/KandulaDemoService/KandulaDemoService.wsdl
@@ -0,0 +1,140 @@
+<wsdl:definitions xmlns:axis2="http://integration.kandula.apache.org"
+ xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
+ xmlns:ns0="http://integration.kandula.apache.org/xsd"
+ xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
+ xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+ xmlns:ns1="http://org.apache.axis2/xsd"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ targetNamespace="http://integration.kandula.apache.org">
+ <wsdl:documentation>Sample service for Testing</wsdl:documentation>
+ <wsdl:types>
+ <xs:schema xmlns:ns="http://integration.kandula.apache.org/xsd"
+ attributeFormDefault="qualified" elementFormDefault="qualified"
+ targetNamespace="http://integration.kandula.apache.org/xsd">
+ <xs:element name="creditOperation">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="element" nillable="true"
+ type="xs:anyType" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="creditOperationResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="return" nillable="true"
+ type="xs:anyType" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="debitOperation">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="element" nillable="true"
+ type="xs:anyType" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="debitOperationResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="return" nillable="true"
+ type="xs:anyType" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:schema>
+ </wsdl:types>
+ <wsdl:message name="debitOperationMessage">
+ <wsdl:part name="part1" element="ns0:debitOperation" />
+ </wsdl:message>
+ <wsdl:message name="debitOperationResponse">
+ <wsdl:part name="part1" element="ns0:debitOperationResponse" />
+ </wsdl:message>
+ <wsdl:message name="creditOperationMessage">
+ <wsdl:part name="part1" element="ns0:creditOperation" />
+ </wsdl:message>
+ <wsdl:message name="creditOperationResponse">
+ <wsdl:part name="part1" element="ns0:creditOperationResponse" />
+ </wsdl:message>
+ <wsdl:portType name="KandulaDemoServicePortType">
+ <wsdl:operation name="debitOperation">
+ <wsdl:input
+ xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
+ message="axis2:debitOperationMessage"
+ wsaw:Action="urn:debitOperation" />
+ <wsdl:output message="axis2:debitOperationResponse" />
+ </wsdl:operation>
+ <wsdl:operation name="creditOperation">
+ <wsdl:input
+ xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
+ message="axis2:creditOperationMessage"
+ wsaw:Action="urn:creditOperation" />
+ <wsdl:output message="axis2:creditOperationResponse" />
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="KandulaDemoServiceSOAP11Binding"
+ type="axis2:KandulaDemoServicePortType">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
+ style="document" />
+ <wsdl:operation name="debitOperation">
+ <soap:operation soapAction="urn:debitOperation"
+ style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="creditOperation">
+ <soap:operation soapAction="urn:creditOperation"
+ style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="KandulaDemoServiceSOAP12Binding"
+ type="axis2:KandulaDemoServicePortType">
+ <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"
+ style="document" />
+ <wsdl:operation name="debitOperation">
+ <soap12:operation soapAction="urn:debitOperation"
+ style="document" />
+ <wsdl:input>
+ <soap12:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="creditOperation">
+ <soap12:operation soapAction="urn:creditOperation"
+ style="document" />
+ <wsdl:input>
+ <soap12:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="KandulaDemoService">
+ <wsdl:port name="KandulaDemoServiceSOAP11port_http"
+ binding="axis2:KandulaDemoServiceSOAP11Binding">
+ <soap:address
+ location="http://localhost:8081/axis2/services/KandulaDemoService" />
+ </wsdl:port>
+ <wsdl:port name="KandulaDemoServiceSOAP12port_http"
+ binding="axis2:KandulaDemoServiceSOAP12Binding">
+ <soap12:address
+ location="http://localhost:8081/axis2/services/KandulaDemoService" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file
diff --git a/test-resources/KandulaDemoService/META-INF/services.xml b/test-resources/KandulaDemoService/META-INF/services.xml
index ccd4293..e317bc5 100644
--- a/test-resources/KandulaDemoService/META-INF/services.xml
+++ b/test-resources/KandulaDemoService/META-INF/services.xml
@@ -6,6 +6,10 @@
<parameter name="ServiceClass" locked="xsd:false">org.apache.kandula.integration.KandulaDemoService</parameter>
<operation name="creditOperation">
<parameter name="KandulaResource" locked="xsd:false">org.apache.kandula.integration.DummyResource</parameter>
- <messageReceiver class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+ <messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
+ </operation>
+ <operation name="debitOperation">
+ <parameter name="KandulaResource" locked="xsd:false">org.apache.kandula.integration.DummyResource</parameter>
+ <messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</operation>
</service>
diff --git a/test-resources/KandulaDemoService/META-INF/services1.xml b/test-resources/KandulaDemoService/META-INF/services1.xml
new file mode 100644
index 0000000..a0eeada
--- /dev/null
+++ b/test-resources/KandulaDemoService/META-INF/services1.xml
@@ -0,0 +1,15 @@
+<service name="KandulaBADemoService">
+ <description>
+ Sample service for Testing
+ </description>
+ <module ref="kandula-inflow"/>
+ <parameter name="ServiceClass" locked="xsd:false">org.apache.kandula.integration.KandulaDemoService</parameter>
+ <operation name="creditOperation">
+ <parameter name="KandulaResource" locked="xsd:false">org.apache.kandula.integration.ba.DummyBAResource</parameter>
+ <messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
+ </operation>
+ <operation name="debitOperation">
+ <parameter name="KandulaResource" locked="xsd:false">org.apache.kandula.integration.ba.DummyBAResource</parameter>
+ <messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
+ </operation>
+</service>
diff --git a/test/interop/CommitTestResource.java b/test/interop/CommitTestResource.java
index 4000a5c..d63382c 100644
--- a/test/interop/CommitTestResource.java
+++ b/test/interop/CommitTestResource.java
@@ -18,12 +18,13 @@
import org.apache.kandula.Constants;
import org.apache.kandula.participant.KandulaResource;
-import org.apache.kandula.participant.Vote;
+import org.apache.kandula.participant.at.KandulaAtomicResource;
+import org.apache.kandula.participant.at.Vote;
/**
* @author <a href="mailto:thilina@opensource.lk"> Thilina Gunarathne </a>
*/
-public class CommitTestResource implements KandulaResource {
+public class CommitTestResource extends KandulaAtomicResource{
/**
*
diff --git a/test/interop/DurableReadOnlyResource.java b/test/interop/DurableReadOnlyResource.java
index 3031d83..21774f1 100644
--- a/test/interop/DurableReadOnlyResource.java
+++ b/test/interop/DurableReadOnlyResource.java
@@ -18,12 +18,13 @@
import org.apache.kandula.Constants;
import org.apache.kandula.participant.KandulaResource;
-import org.apache.kandula.participant.Vote;
+import org.apache.kandula.participant.at.KandulaAtomicResource;
+import org.apache.kandula.participant.at.Vote;
/**
* @author <a href="mailto:thilina@opensource.lk"> Thilina Gunarathne </a>
*/
-public class DurableReadOnlyResource implements KandulaResource {
+public class DurableReadOnlyResource extends KandulaAtomicResource{
/**
*
diff --git a/test/interop/Phase2RollbackTestVolatileResource.java b/test/interop/Phase2RollbackTestVolatileResource.java
index c513c95..50f1b0f 100644
--- a/test/interop/Phase2RollbackTestVolatileResource.java
+++ b/test/interop/Phase2RollbackTestVolatileResource.java
@@ -18,12 +18,13 @@
import org.apache.kandula.Constants;
import org.apache.kandula.participant.KandulaResource;
-import org.apache.kandula.participant.Vote;
+import org.apache.kandula.participant.at.KandulaAtomicResource;
+import org.apache.kandula.participant.at.Vote;
/**
* @author <a href="mailto:thilina@opensource.lk"> Thilina Gunarathne </a>
*/
-public class Phase2RollbackTestVolatileResource implements KandulaResource {
+public class Phase2RollbackTestVolatileResource extends KandulaAtomicResource {
/**
*
diff --git a/test/interop/RollbackTestResource.java b/test/interop/RollbackTestResource.java
index 863215c..7418f77 100644
--- a/test/interop/RollbackTestResource.java
+++ b/test/interop/RollbackTestResource.java
@@ -18,12 +18,13 @@
import org.apache.kandula.Constants;
import org.apache.kandula.participant.KandulaResource;
-import org.apache.kandula.participant.Vote;
+import org.apache.kandula.participant.at.KandulaAtomicResource;
+import org.apache.kandula.participant.at.Vote;
/**
* @author <a href="mailto:thilina@opensource.lk"> Thilina Gunarathne </a>
*/
-public class RollbackTestResource implements KandulaResource {
+public class RollbackTestResource extends KandulaAtomicResource {
/**
*
diff --git a/test/interop/VolatileAndDurableTestVolatileResource.java b/test/interop/VolatileAndDurableTestVolatileResource.java
index db8ea10..bcab5c2 100644
--- a/test/interop/VolatileAndDurableTestVolatileResource.java
+++ b/test/interop/VolatileAndDurableTestVolatileResource.java
@@ -18,12 +18,13 @@
import org.apache.kandula.Constants;
import org.apache.kandula.participant.KandulaResource;
-import org.apache.kandula.participant.Vote;
+import org.apache.kandula.participant.at.KandulaAtomicResource;
+import org.apache.kandula.participant.at.Vote;
/**
* @author <a href="mailto:thilina@opensource.lk"> Thilina Gunarathne </a>
*/
-public class VolatileAndDurableTestVolatileResource implements KandulaResource {
+public class VolatileAndDurableTestVolatileResource extends KandulaAtomicResource {
/**
*
diff --git a/test/interop/VolatileReadOnlyResource.java b/test/interop/VolatileReadOnlyResource.java
index f32a466..c09280b 100644
--- a/test/interop/VolatileReadOnlyResource.java
+++ b/test/interop/VolatileReadOnlyResource.java
@@ -18,12 +18,13 @@
import org.apache.kandula.Constants;
import org.apache.kandula.participant.KandulaResource;
-import org.apache.kandula.participant.Vote;
+import org.apache.kandula.participant.at.KandulaAtomicResource;
+import org.apache.kandula.participant.at.Vote;
/**
* @author <a href="mailto:thilina@opensource.lk"> Thilina Gunarathne </a>
*/
-public class VolatileReadOnlyResource implements KandulaResource {
+public class VolatileReadOnlyResource extends KandulaAtomicResource {
/**
*
diff --git a/test/interop/testService.java b/test/interop/testService.java
index 6f54f52..1fdd008 100644
--- a/test/interop/testService.java
+++ b/test/interop/testService.java
@@ -25,13 +25,15 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.MessageContext;
import org.apache.axis2.context.OperationContext;
+import org.apache.axis2.engine.AxisError;
import org.apache.axis2.wsdl.WSDLConstants;
import org.apache.kandula.Constants;
import org.apache.kandula.Status;
import org.apache.kandula.context.AbstractContext;
import org.apache.kandula.context.CoordinationContext;
-import org.apache.kandula.context.impl.ATParticipantContext;
+import org.apache.kandula.context.impl.ParticipantContext;
import org.apache.kandula.faults.AbstractKandulaException;
+import org.apache.kandula.faults.KandulaGeneralException;
import org.apache.kandula.participant.KandulaResource;
import org.apache.kandula.participant.ParticipantUtility;
import org.apache.kandula.storage.Store;
@@ -42,164 +44,169 @@
* @author <a href="mailto:thilina@opensource.lk"> Thilina Gunarathne </a>
*/
public class testService {
-
+
private MessageContext msgcts;
-
+
public testService() {
-
+
}
-
+
public void setOperationContext(OperationContext oc) throws AxisFault {
msgcts = oc.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
}
-
+
public OMElement Commit(OMElement element) {
return getResponseElement();
}
-
+
public OMElement Rollback(OMElement element) {
return getResponseElement();
}
-
+
public OMElement Phase2Rollback(OMElement element) throws AxisFault {
-
- String reqID = (String) msgcts
- .getProperty(AbstractContext.REQUESTER_ID);
- ATParticipantContext participantContext = (ATParticipantContext) StorageUtils
- .getContext(reqID);
- CoordinationContext coordinationContext = participantContext
- .getCoordinationContext();
-
- ATParticipantContext participantContext2 = new ATParticipantContext();
- participantContext2.setCoordinationContext(coordinationContext);
- KandulaResource resource1 = new Phase2RollbackTestVolatileResource();
- participantContext2.setResource(resource1);
- StorageUtils.putContext(participantContext2);
- MessageContext currentMessageContext = MessageContext.getCurrentMessageContext();
- ParticipantUtility.registerParticipant(participantContext2,currentMessageContext);
-
- ATParticipantContext participantContext1 = new ATParticipantContext();
- participantContext1.setCoordinationContext(coordinationContext);
- KandulaResource resource = new RollbackTestResource();
- participantContext1.setResource(resource);
- StorageUtils.putContext(participantContext1);
- ParticipantUtility.registerParticipant(participantContext1,currentMessageContext);
-
- return getResponseElement();
- }
-
- public OMElement Readonly(OMElement element) throws AxisFault {
-
- String reqID = (String) msgcts
- .getProperty(AbstractContext.REQUESTER_ID);
- ATParticipantContext participantContext = (ATParticipantContext) StorageUtils
- .getContext(reqID);
- CoordinationContext coordinationContext = participantContext
- .getCoordinationContext();
-
- ATParticipantContext participantContext2 = new ATParticipantContext();
- participantContext2.setCoordinationContext(coordinationContext);
- KandulaResource resource1 = new DurableReadOnlyResource();
- participantContext2.setResource(resource1);
- StorageUtils.putContext(participantContext2);
- MessageContext messageContext = MessageContext.getCurrentMessageContext();
- ParticipantUtility.registerParticipant(participantContext2,messageContext);
-
- ATParticipantContext participantContext1 = new ATParticipantContext();
- participantContext1.setCoordinationContext(coordinationContext);
- KandulaResource resource = new CommitTestResource();
- participantContext1.setResource(resource);
- StorageUtils.putContext(participantContext1);
- ParticipantUtility.registerParticipant(participantContext1,messageContext);
-
- return getResponseElement();
- }
-
- public OMElement VolatileAndDurable(OMElement element) throws AxisFault {
-
- String reqID = (String) msgcts
- .getProperty(AbstractContext.REQUESTER_ID);
- ATParticipantContext participantContext = (ATParticipantContext) StorageUtils
- .getContext(reqID);
- final CoordinationContext coordinationContext = participantContext
- .getCoordinationContext();
-
- final ATParticipantContext participantContext2 = new ATParticipantContext();
- participantContext2.setCoordinationContext(coordinationContext);
- KandulaResource resource1 = new VolatileAndDurableTestVolatileResource();
- participantContext2.setResource(resource1);
- StorageUtils.putContext(participantContext2);
- final MessageContext messageContext = MessageContext.getCurrentMessageContext();
- ParticipantUtility.registerParticipant(participantContext2,messageContext);
- Thread thread = new Thread(new Runnable() {
- public void run() {
- try {
- ATParticipantContext participantContext1 = new ATParticipantContext();
- participantContext1
- .setCoordinationContext(coordinationContext);
- KandulaResource resource = new CommitTestResource();
- participantContext1.setResource(resource);
- StorageUtils.putContext(participantContext1);
-
- Map referenceParametersmap = participantContext2
- .getCoordinationEPR().getAllReferenceParameters();
- String id = ((OMElement) referenceParametersmap
- .get(Constants.TRANSACTION_ID_PARAMETER)).getText();
- AbstractContext transaction = (AbstractContext) StorageUtils
- .getContext(id);
- while (!(transaction.getStatus() == Status.CoordinatorStatus.STATUS_PREPARING_VOLATILE)) {
- }
- ParticipantUtility.registerParticipant(participantContext1,messageContext);
-
- } catch (AxisFault e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- });
- thread.start();
- return getResponseElement();
- }
-
- public OMElement EarlyAborted(OMElement element) throws AxisFault {
-
- String reqID = (String) msgcts
- .getProperty(AbstractContext.REQUESTER_ID);
- ATParticipantContext participantContext = (ATParticipantContext) StorageUtils.getContext(reqID);
- CoordinationContext coordinationContext = participantContext
- .getCoordinationContext();
-
- ATParticipantContext participantContext2 = new ATParticipantContext();
- participantContext2.setCoordinationContext(coordinationContext);
- KandulaResource resource1 = new CommitTestResource();
- participantContext2.setResource(resource1);
- StorageUtils.putContext( participantContext2);
- MessageContext messageContext = MessageContext.getCurrentMessageContext();
- ParticipantUtility.registerParticipant(participantContext2,messageContext);
-
- ATParticipantContext participantContext1 = new ATParticipantContext();
- participantContext1.setCoordinationContext(coordinationContext);
- KandulaResource resource = new VolatileReadOnlyResource();
- participantContext1.setResource(resource);
- StorageUtils.putContext(participantContext1);
- ParticipantUtility.registerParticipant(participantContext1,messageContext);
-
- CoordinatorPortTypeRawXMLStub stub;
try {
- stub = new CoordinatorPortTypeRawXMLStub(participantContext1
- .getCoordinationEPR());
- stub.abortedOperation();
- } catch (AbstractKandulaException e) {
+ String reqID = (String) msgcts.getProperty(AbstractContext.REQUESTER_ID);
+ ParticipantContext participantContext = (ParticipantContext) StorageUtils
+ .getContext(reqID);
+ CoordinationContext coordinationContext = participantContext.getCoordinationContext();
+
+ ParticipantContext participantContext2 = new ParticipantContext();
+ participantContext2.setCoordinationContext(coordinationContext);
+ KandulaResource resource1 = new Phase2RollbackTestVolatileResource();
+ participantContext2.setResource(resource1);
+ StorageUtils.putContext(participantContext2);
+ MessageContext currentMessageContext = MessageContext.getCurrentMessageContext();
+ ParticipantUtility.registerParticipant(participantContext2, currentMessageContext);
+
+ ParticipantContext participantContext1 = new ParticipantContext();
+ participantContext1.setCoordinationContext(coordinationContext);
+ KandulaResource resource = new RollbackTestResource();
+ participantContext1.setResource(resource);
+ StorageUtils.putContext(participantContext1);
+ ParticipantUtility.registerParticipant(participantContext1, currentMessageContext);
+
+ return getResponseElement();
+ } catch (KandulaGeneralException e) {
throw new AxisFault(e);
}
-
- return getResponseElement();
}
- private OMElement getResponseElement()
- {
+
+ public OMElement Readonly(OMElement element) throws AxisFault {
+ try {
+ String reqID = (String) msgcts.getProperty(AbstractContext.REQUESTER_ID);
+ ParticipantContext participantContext = (ParticipantContext) StorageUtils
+ .getContext(reqID);
+ CoordinationContext coordinationContext = participantContext.getCoordinationContext();
+
+ ParticipantContext participantContext2 = new ParticipantContext();
+ participantContext2.setCoordinationContext(coordinationContext);
+ KandulaResource resource1 = new DurableReadOnlyResource();
+ participantContext2.setResource(resource1);
+ StorageUtils.putContext(participantContext2);
+ MessageContext messageContext = MessageContext.getCurrentMessageContext();
+ ParticipantUtility.registerParticipant(participantContext2, messageContext);
+
+ ParticipantContext participantContext1 = new ParticipantContext();
+ participantContext1.setCoordinationContext(coordinationContext);
+ KandulaResource resource = new CommitTestResource();
+ participantContext1.setResource(resource);
+ StorageUtils.putContext(participantContext1);
+ ParticipantUtility.registerParticipant(participantContext1, messageContext);
+
+ return getResponseElement();
+ } catch (KandulaGeneralException e) {
+ throw new AxisFault(e);
+ }
+ }
+
+ public OMElement VolatileAndDurable(OMElement element) throws AxisFault {
+ try {
+ String reqID = (String) msgcts
+ .getProperty(AbstractContext.REQUESTER_ID);
+ ParticipantContext participantContext = (ParticipantContext) StorageUtils
+ .getContext(reqID);
+ final CoordinationContext coordinationContext = participantContext
+ .getCoordinationContext();
+
+ final ParticipantContext participantContext2 = new ParticipantContext();
+ participantContext2.setCoordinationContext(coordinationContext);
+ KandulaResource resource1 = new VolatileAndDurableTestVolatileResource();
+ participantContext2.setResource(resource1);
+ StorageUtils.putContext(participantContext2);
+ final MessageContext messageContext = MessageContext.getCurrentMessageContext();
+ ParticipantUtility.registerParticipant(participantContext2,messageContext);
+ Thread thread = new Thread(new Runnable() {
+ public void run() {
+ try {
+ ParticipantContext participantContext1 = new ParticipantContext();
+ participantContext1
+ .setCoordinationContext(coordinationContext);
+ KandulaResource resource = new CommitTestResource();
+ participantContext1.setResource(resource);
+ StorageUtils.putContext(participantContext1);
+
+ Map referenceParametersmap = participantContext2
+ .getCoordinationEPR().getAllReferenceParameters();
+ String id = ((OMElement) referenceParametersmap
+ .get(Constants.TRANSACTION_ID_PARAMETER)).getText();
+ AbstractContext transaction = (AbstractContext) StorageUtils
+ .getContext(id);
+ while (!(transaction.getStatus() == Status.CoordinatorStatus.STATUS_PREPARING_VOLATILE)) {
+ }
+ ParticipantUtility.registerParticipant(participantContext1,messageContext);
+
+ } catch (AxisFault e) {
+ throw new AxisError(e.getMessage());
+ } catch (KandulaGeneralException e) {
+ throw new AxisError(e.getMessage());
+ }
+ }
+ });
+ thread.start();
+ return getResponseElement();
+ } catch (KandulaGeneralException e) {
+ throw new AxisFault(e);
+ }
+ }
+ public OMElement EarlyAborted(OMElement element) throws AxisFault {
+ try {
+ String reqID = (String) msgcts
+ .getProperty(AbstractContext.REQUESTER_ID);
+ ParticipantContext participantContext = (ParticipantContext) StorageUtils.getContext(reqID);
+ CoordinationContext coordinationContext = participantContext
+ .getCoordinationContext();
+
+ ParticipantContext participantContext2 = new ParticipantContext();
+ participantContext2.setCoordinationContext(coordinationContext);
+ KandulaResource resource1 = new CommitTestResource();
+ participantContext2.setResource(resource1);
+ StorageUtils.putContext( participantContext2);
+ MessageContext messageContext = MessageContext.getCurrentMessageContext();
+ ParticipantUtility.registerParticipant(participantContext2,messageContext);
+
+ ParticipantContext participantContext1 = new ParticipantContext();
+ participantContext1.setCoordinationContext(coordinationContext);
+ KandulaResource resource = new VolatileReadOnlyResource();
+ participantContext1.setResource(resource);
+ StorageUtils.putContext(participantContext1);
+ ParticipantUtility.registerParticipant(participantContext1,messageContext);
+
+ CoordinatorPortTypeRawXMLStub stub;
+ try {
+ stub = new CoordinatorPortTypeRawXMLStub(participantContext1
+ .getCoordinationEPR());
+ stub.abortedOperation();
+ } catch (AbstractKandulaException e) {
+ throw new AxisFault(e);
+ }
+ return getResponseElement();
+ } catch (KandulaGeneralException e) {
+ throw new AxisFault(e);
+ }
+ } private OMElement getResponseElement() {
SOAPFactory factory = OMAbstractFactory.getSOAP12Factory();
- OMNamespace namespace = factory.createOMNamespace("http://fabrikam123.com",null);
- OMElement testType = factory.createOMElement("Response",namespace);
+ OMNamespace namespace = factory.createOMNamespace("http://fabrikam123.com", null);
+ OMElement testType = factory.createOMElement("Response", namespace);
return testType;
}
}
\ No newline at end of file
diff --git a/test/org/apache/kandula/integration/CompletionCommitTest.java b/test/org/apache/kandula/integration/CompletionCommitTest.java
index 67dd55a..6df5e3b 100644
--- a/test/org/apache/kandula/integration/CompletionCommitTest.java
+++ b/test/org/apache/kandula/integration/CompletionCommitTest.java
@@ -29,6 +29,8 @@
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.transport.http.SimpleHTTPServer;
import org.apache.kandula.initiator.TransactionManager;
+import org.apache.kandula.integration.xsd.CreditOperation;
+import org.apache.kandula.integration.xsd.DebitOperation;
public class CompletionCommitTest extends TestCase {
@@ -39,15 +41,16 @@
private SimpleHTTPServer server;
public CompletionCommitTest() throws Exception {
- super(CompletionCommitTest.class.getName());
- stub = new KandulaDemoServiceStub("target/initiator-repository", new EndpointReference(
- "http://localhost:8081/axis2/services/KandulaDemoService"));
+ this(CompletionCommitTest.class.getName());
}
public CompletionCommitTest(String testName) throws Exception {
super(testName);
- stub = new KandulaDemoServiceStub("target/initiator-repository", new EndpointReference(
- "http://localhost:8081/axis2/services/KandulaDemoService"));
+ ConfigurationContext configurationContext = ConfigurationContextFactory
+ .createConfigurationContextFromFileSystem("target/initiator-repository", "target/initiator-repository"
+ + "/axis2.xml");
+
+ stub = new KandulaDemoServiceStub(configurationContext, "http://localhost:8081/axis2/services/KandulaDemoService");
}
protected void setUp() throws Exception {
@@ -74,15 +77,23 @@
protected void tearDown() throws Exception {
server.stop();
}
+
+// public void testRegistration() throws Exception {
+// TransactionManager tm = new TransactionManager("target/initiator-repository",
+// "target/initiator-repository/axis2.xml");
+// tm.begin("http://localhost:8082/axis2/services/ActivationCoordinator");
+// tm.commit();
+// Thread.sleep(5000);
+// }
- public void testEchoXMLASync() throws Exception {
+ public void testCompletionCommit() throws Exception {
TransactionManager tm = new TransactionManager("target/initiator-repository",
"target/initiator-repository/axis2.xml");
tm.begin("http://localhost:8081/axis2/services/ActivationCoordinator");
- stub.creditOperation();
+ stub.creditOperation(new CreditOperation());
+ stub.debitOperation(new DebitOperation());
tm.commit();
Thread.sleep(5000);
-
}
// public void testEchoXMLSync() throws Exception {
diff --git a/test/org/apache/kandula/integration/DummyResource.java b/test/org/apache/kandula/integration/DummyResource.java
index 7890f7c..c822d9c 100644
--- a/test/org/apache/kandula/integration/DummyResource.java
+++ b/test/org/apache/kandula/integration/DummyResource.java
@@ -18,9 +18,10 @@
import org.apache.kandula.Constants;
import org.apache.kandula.participant.KandulaResource;
-import org.apache.kandula.participant.Vote;
+import org.apache.kandula.participant.at.KandulaAtomicResource;
+import org.apache.kandula.participant.at.Vote;
-public class DummyResource implements KandulaResource {
+public class DummyResource extends KandulaAtomicResource {
/**
*
diff --git a/test/org/apache/kandula/integration/KandulaDemoService.java b/test/org/apache/kandula/integration/KandulaDemoService.java
index b0c4060..296651a 100644
--- a/test/org/apache/kandula/integration/KandulaDemoService.java
+++ b/test/org/apache/kandula/integration/KandulaDemoService.java
@@ -17,6 +17,7 @@
package org.apache.kandula.integration;
import org.apache.axiom.om.OMElement;
+import org.apache.axis2.AxisFault;
public class KandulaDemoService {
@@ -35,10 +36,20 @@
}
- public OMElement debitOperation(OMElement element) {
+ public OMElement debitOperation(OMElement element) throws AxisFault {
element.build();
element.detach();
-// System.out.println("done com");
+// MessageContext msgcts = MessageContext.getCurrentMessageContext();
+// String reqID = (String) msgcts.getProperty(AbstractContext.REQUESTER_ID);
+// ParticipantContext participantContext = (ParticipantContext) StorageUtils
+// .getContext(reqID);
+// KandulaBusinessActivityResource resource = (KandulaBusinessActivityResource)participantContext.getResource();
+// try {
+// resource.exit();
+// } catch (AbstractKandulaException e) {
+// throw new AxisFault(e);
+// }
+// throw new AxisFault("thilina");
return element;
}
diff --git a/test/org/apache/kandula/integration/KandulaDemoServiceStub.java b/test/org/apache/kandula/integration/KandulaDemoServiceStub.java
deleted file mode 100644
index 728131d..0000000
--- a/test/org/apache/kandula/integration/KandulaDemoServiceStub.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.kandula.integration;
-
-import java.io.IOException;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.soap.SOAPFactory;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.AddressingConstants;
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.OperationClient;
-import org.apache.axis2.client.Options;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.ConfigurationContextFactory;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.context.ServiceContext;
-import org.apache.axis2.context.ServiceGroupContext;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.AxisServiceGroup;
-import org.apache.axis2.description.OutOnlyAxisOperation;
-
-public class KandulaDemoServiceStub extends org.apache.axis2.client.Stub {
-
- public static final String AXIS2_HOME = ".";
-
- // private AxisService service;
- private ConfigurationContext configurationContext;
-
- private ServiceContext serviceContext;
-
- private EndpointReference toEPR;
-
- private static org.apache.axis2.description.AxisOperation[] operations;
-
- {// creating the Service
- _service = new AxisService("KandulaDemoService");
-
- // creating the operations
- AxisOperation operationDesc;
- operations = new org.apache.axis2.description.AxisOperation[1];
-
- operationDesc = new OutOnlyAxisOperation();
- operationDesc.setName(new javax.xml.namespace.QName("creditOperation"));
- operations[0] = operationDesc;
- _service.addOperation(operationDesc);
- }
-
- /**
- * Constructor
- */
- public KandulaDemoServiceStub(String axis2Home,
- EndpointReference targetEndpoint) throws java.lang.Exception {
- this.toEPR = targetEndpoint;
- // creating the configuration
- configurationContext = ConfigurationContextFactory
- .createConfigurationContextFromFileSystem(axis2Home, axis2Home
- + "/axis2.xml");
- configurationContext.getAxisConfiguration().addService(_service);
- ServiceGroupContext sgc = new ServiceGroupContext(
- this.configurationContext, (AxisServiceGroup) _service
- .getParent());
- this.serviceContext = new ServiceContext(_service, sgc);
-
- }
-
- public void creditOperation() throws IOException, AxisFault {
-
- Options options = new Options();
- MessageContext messageContext = new MessageContext();
- messageContext.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,
- AddressingConstants.Submission.WSA_NAMESPACE);
- SOAPEnvelope env = createSOAPEnvelope();
- messageContext.setEnvelope(env);
-
- // _service.engageModule("addressing");
-
- options.setAction("creditOperation");
- options.setTo(this.toEPR);
-
- // messageSender
- // .setSenderTransport(org.apache.axis2.Constants.TRANSPORT_HTTP);
- OperationClient client = operations[0].createClient(serviceContext,
- options);
- client.addMessageContext(messageContext);
- client.execute(true);
-
- }
-
- public void debitOperation() throws IOException, AxisFault {
-
- Options options = new Options();
- MessageContext messageContext = new MessageContext();
- messageContext.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,
- AddressingConstants.Submission.WSA_NAMESPACE);
- SOAPEnvelope env = createSOAPEnvelope();
- messageContext.setEnvelope(env);
-
- // _service.engageModule("addressing");
-
- options.setAction("debitOperation");
- options.setTo(this.toEPR);
-
- // messageSender
- // .setSenderTransport(org.apache.axis2.Constants.TRANSPORT_HTTP);
- OperationClient client = operations[0].createClient(serviceContext,
- options);
- client.addMessageContext(messageContext);
- client.execute(true);
- }
-
- private SOAPEnvelope createSOAPEnvelope() {
-
- SOAPFactory factory = OMAbstractFactory.getSOAP12Factory();
- SOAPEnvelope env = factory.getDefaultEnvelope();
-// SOAPBody body = factory.createSOAPBody();
-// env.addChild(body);
- OMElement test = factory.createOMElement("test","urn://temp", "tmp");
- env.getBody().addChild(test);
- return env;
- }
-
-}
diff --git a/test/org/apache/kandula/integration/ba/BAParticipantRegistrationTest.java b/test/org/apache/kandula/integration/ba/BAParticipantRegistrationTest.java
new file mode 100644
index 0000000..58fc04a
--- /dev/null
+++ b/test/org/apache/kandula/integration/ba/BAParticipantRegistrationTest.java
@@ -0,0 +1,146 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kandula.integration.ba;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.transport.http.SimpleHTTPServer;
+import org.apache.kandula.Constants;
+import org.apache.kandula.ba.MixedBusinessActivity;
+import org.apache.kandula.integration.KandulaDemoServiceStub;
+import org.apache.kandula.integration.xsd.CreditOperation;
+import org.apache.kandula.integration.xsd.DebitOperation;
+
+public class BAParticipantRegistrationTest extends TestCase {
+
+ private String repository = "target/testing-repository";
+
+ private KandulaDemoServiceStub stub;
+
+ private SimpleHTTPServer server;
+
+ public BAParticipantRegistrationTest() throws Exception {
+ this(BAParticipantRegistrationTest.class.getName());
+ }
+
+ public BAParticipantRegistrationTest(String testName) throws Exception {
+ super(testName);
+ ConfigurationContext configurationContext = ConfigurationContextFactory
+ .createConfigurationContextFromFileSystem("target/initiator-repository",
+ "target/initiator-repository" + "/axis2.xml");
+
+ stub = new KandulaDemoServiceStub(configurationContext,
+ "http://localhost:8081/axis2/services/KandulaBADemoService");
+ }
+
+ protected void setUp() throws Exception {
+ File file = new File(repository);
+ File configFile = new File(repository + "/axis2.xml");
+ if (!file.exists()) {
+ throw new Exception("repository directory " + file.getAbsolutePath()
+ + " does not exists");
+ }
+ ConfigurationContext er = ConfigurationContextFactory
+ .createConfigurationContextFromFileSystem(file.getAbsolutePath(), configFile
+ .getAbsolutePath());
+
+ server = new SimpleHTTPServer(er, 8081);
+
+ try {
+ server.start();
+ System.out.print("Server started on port " + 8081 + ".....");
+ } finally {
+
+ }
+ }
+
+ protected void tearDown() throws Exception {
+ server.stop();
+ }
+
+ public void testRegistration() throws Exception {
+ MixedBusinessActivity businessActivity = null;
+ businessActivity = new MixedBusinessActivity(0);
+ stub._getServiceClient().getOptions().setProperty(
+ Constants.Configuration.TRANSACTION_CONTEXT, businessActivity.getContext());
+ stub._getServiceClient().getOptions().setProperty(
+ Constants.Configuration.PARTICIPANT_IDENTIFIER, "creditingBank");
+ stub.creditOperation(new CreditOperation());
+ try{
+ stub._getServiceClient().getOptions().setProperty(
+ Constants.Configuration.PARTICIPANT_IDENTIFIER, "debitingBank");
+ stub.debitOperation(new DebitOperation());
+ }catch (Exception e){
+
+ }
+ assertNotNull(businessActivity.getParticipant("debitingBank"));
+ assertNotNull(businessActivity.getParticipant("creditingBank"));
+// businessActivity.cancelParticipant("debitingBank");
+// Thread.sleep(1000);
+ businessActivity.setCallBack(new DemoServiceActivityMixedCallBack());
+ businessActivity.complete();
+ }
+/* public void testAtomicOutcome() throws Exception {
+ AtomicBusinessActivity businessActivity = null;
+ businessActivity = new AtomicBusinessActivity( 0);
+ stub._getServiceClient().getOptions().setProperty(
+ Constants.Configuration.TRANSACTION_CONTEXT, businessActivity.getContext());
+ stub._getServiceClient().getOptions().setProperty(
+ Constants.Configuration.PARTICIPANT_IDENTIFIER, "creditingBank");
+ stub.creditOperation(new CreditOperation());
+ try{
+ stub._getServiceClient().getOptions().setProperty(
+ Constants.Configuration.PARTICIPANT_IDENTIFIER, "debitingBank");
+ stub.debitOperation(new DebitOperation());
+ }catch (Exception e){
+
+ }
+ assertNotNull(businessActivity.getParticipant("debitingBank"));
+ assertNotNull(businessActivity.getParticipant("creditingBank"));
+// businessActivity.cancelParticipant("debitingBank");
+ Thread.sleep(1000);
+ businessActivity.setCallBack(new DemoServiceActivityCallBack());
+ businessActivity.complete();
+ }*/
+/* public void testCancelParticipant() throws Exception {
+ AtomicBusinessActivity businessActivity = null;
+ businessActivity = new AtomicBusinessActivity( 0);
+ stub._getServiceClient().getOptions().setProperty(
+ Constants.Configuration.TRANSACTION_CONTEXT, businessActivity.getContext());
+ stub._getServiceClient().getOptions().setProperty(
+ Constants.Configuration.PARTICIPANT_IDENTIFIER, "creditingBank");
+ stub.creditOperation(new CreditOperation());
+ try{
+ stub._getServiceClient().getOptions().setProperty(
+ Constants.Configuration.PARTICIPANT_IDENTIFIER, "debitingBank");
+ stub.debitOperation(new DebitOperation());
+ }catch (Exception e){
+
+ }
+ assertNotNull(businessActivity.getParticipant("debitingBank"));
+ assertNotNull(businessActivity.getParticipant("creditingBank"));
+ businessActivity.cancelParticipant("debitingBank");
+ assertNull(businessActivity.getParticipant("debitingBank"));
+ Thread.sleep(1000);
+ businessActivity.setCallBack(new DemoServiceActivityCallBack());
+ businessActivity.complete();
+ }*/
+}
\ No newline at end of file
diff --git a/test/org/apache/kandula/integration/ba/BARegistrationTest.java b/test/org/apache/kandula/integration/ba/BARegistrationTest.java
new file mode 100644
index 0000000..470a04a
--- /dev/null
+++ b/test/org/apache/kandula/integration/ba/BARegistrationTest.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kandula.integration.ba;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.transport.http.SimpleHTTPServer;
+import org.apache.kandula.Constants;
+import org.apache.kandula.ba.AtomicBusinessActivity;
+import org.apache.kandula.coordinator.Coordinator;
+
+public class BARegistrationTest extends TestCase {
+
+ private String repository = "target/testing-repository";
+
+ private SimpleHTTPServer server;
+
+ public BARegistrationTest() throws Exception {
+ super(BARegistrationTest.class.getName());
+ }
+
+ public BARegistrationTest(String testName) throws Exception {
+ super(testName);
+ }
+
+ protected void setUp() throws Exception {
+ File file = new File(repository);
+ File configFile = new File(repository + "/axis2.xml");
+ if (!file.exists()) {
+ throw new Exception("repository directory "
+ + file.getAbsolutePath() + " does not exists");
+ }
+ ConfigurationContext er = ConfigurationContextFactory
+ .createConfigurationContextFromFileSystem(file
+ .getAbsolutePath(), configFile.getAbsolutePath());
+
+ server = new SimpleHTTPServer(er, 8081);
+
+ try {
+ server.start();
+ System.out.print("Server started on port " + 8081 + ".....");
+ } finally {
+
+ }
+ }
+
+ protected void tearDown() throws Exception {
+ server.stop();
+ }
+
+ public void testRegisteration() throws Exception {
+ AtomicBusinessActivity businessActivity = new AtomicBusinessActivity(1000);
+ Coordinator coordinator = new Coordinator();
+ EndpointReference epr= coordinator.registerParticipant(businessActivity.getContext(),Constants.WS_BA_CC,new EndpointReference("http://ws.apache.org/axis2"),null);
+ assertNotNull(epr);
+ }
+
+
+// public void testEchoXMLSync() throws Exception {
+// // TransactionManager tm = new TransactionManager(
+// // Constants.WS_AT,
+// // new EndpointReference(
+// // "http://localhost:8081/axis2/services/ActivationCoordinator"));
+// // tm.begin("target/initiator-repository",
+// // "target/initiator-repository/axis2.xml", false);
+// // try {
+// // stub.creditOperation();
+// // } catch (Exception e) {
+// // tm.rollback();
+// // }
+// // tm.commit();
+// }
+}
\ No newline at end of file
diff --git a/test/org/apache/kandula/integration/ba/DemoServiceActivityCallBack.java b/test/org/apache/kandula/integration/ba/DemoServiceActivityCallBack.java
new file mode 100644
index 0000000..c2772a9
--- /dev/null
+++ b/test/org/apache/kandula/integration/ba/DemoServiceActivityCallBack.java
@@ -0,0 +1,78 @@
+package org.apache.kandula.integration.ba;
+
+import org.apache.kandula.Status;
+import org.apache.kandula.ba.BusinessActivityCallBack;
+import org.apache.kandula.ba.MixedBusinessActivity;
+import org.apache.kandula.coordinator.ba.BAParticipantInformation;
+
+public class DemoServiceActivityCallBack extends BusinessActivityCallBack {
+
+ public DemoServiceActivityCallBack() {
+ super();
+ }
+
+ public void onComplete() {
+ try {
+ MixedBusinessActivity mixedBusinessActivity = (MixedBusinessActivity)businessActivity;
+ //choose just one airline
+ BAParticipantInformation emirates = mixedBusinessActivity.getParticipant("EmiratesAirlineBooking");
+ BAParticipantInformation srilankan = mixedBusinessActivity.getParticipant("SriLankanAirlineBooking");
+ BAParticipantInformation singapore = mixedBusinessActivity.getParticipant("SingaporeAirlineBooking");
+
+ if (srilankan!=null && (srilankan.getStatus()==Status.BACoordinatorStatus.STATUS_COMPLETED)){
+ mixedBusinessActivity.addParticipantToCloseList(srilankan);
+ mixedBusinessActivity.addParticipantToCompensateList(emirates);
+ mixedBusinessActivity.addParticipantToCompensateList(singapore);
+ }else if (emirates!=null && (emirates.getStatus()==Status.BACoordinatorStatus.STATUS_COMPLETED)){
+ mixedBusinessActivity.addParticipantToCloseList(emirates);
+ mixedBusinessActivity.addParticipantToCompensateList(srilankan);
+ mixedBusinessActivity.addParticipantToCompensateList(singapore);
+ }else if (singapore!=null && (singapore.getStatus()==Status.BACoordinatorStatus.STATUS_COMPLETED)){
+ mixedBusinessActivity.addParticipantToCloseList(singapore);
+ mixedBusinessActivity.addParticipantToCompensateList(emirates);
+ mixedBusinessActivity.addParticipantToCompensateList(srilankan);
+ }
+
+ BAParticipantInformation taj = mixedBusinessActivity.getParticipant("TajHotelBooking");
+ BAParticipantInformation hilton = mixedBusinessActivity.getParticipant("HiltonHotelBooking");
+
+ if (taj!=null && (taj.getStatus()==Status.BACoordinatorStatus.STATUS_COMPLETED)){
+ mixedBusinessActivity.addParticipantToCloseList(taj);
+ mixedBusinessActivity.addParticipantToCompensateList(hilton);
+ }else if (hilton!=null && (hilton.getStatus()==Status.BACoordinatorStatus.STATUS_COMPLETED)){
+ mixedBusinessActivity.addParticipantToCloseList(hilton);
+ mixedBusinessActivity.addParticipantToCompensateList(taj);
+ }
+
+ BAParticipantInformation hertz = mixedBusinessActivity.getParticipant("HertzCarBooking");
+ BAParticipantInformation malkey = mixedBusinessActivity.getParticipant("MalkeyCarBooking");
+ if (hertz!=null && (hertz.getStatus()==Status.BACoordinatorStatus.STATUS_COMPLETED)){
+ mixedBusinessActivity.addParticipantToCloseList(hertz);
+ mixedBusinessActivity.addParticipantToCompensateList(malkey);
+ }else if (malkey!=null && (malkey.getStatus()==Status.BACoordinatorStatus.STATUS_COMPLETED)){
+ mixedBusinessActivity.addParticipantToCloseList(malkey);
+ mixedBusinessActivity.addParticipantToCompensateList(hertz);
+ }
+
+ BAParticipantInformation map = mixedBusinessActivity.getParticipant("MapOrder");
+ if (map!=null && (map.getStatus()==Status.BACoordinatorStatus.STATUS_COMPLETED)){
+ mixedBusinessActivity.addParticipantToCloseList(map);
+ }else
+ {
+ mixedBusinessActivity.addParticipantToCompensateList(map);
+ }
+
+ mixedBusinessActivity.finalizeActivity();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+/* public void onComplete() {
+ try {
+ ((AtomicBusinessActivity)businessActivity).closeActivity();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }*/
+}
diff --git a/test/org/apache/kandula/integration/ba/DemoServiceActivityMixedCallBack.java b/test/org/apache/kandula/integration/ba/DemoServiceActivityMixedCallBack.java
new file mode 100644
index 0000000..daa4653
--- /dev/null
+++ b/test/org/apache/kandula/integration/ba/DemoServiceActivityMixedCallBack.java
@@ -0,0 +1,23 @@
+package org.apache.kandula.integration.ba;
+
+import org.apache.kandula.ba.BusinessActivityCallBack;
+import org.apache.kandula.ba.MixedBusinessActivity;
+
+public class DemoServiceActivityMixedCallBack extends BusinessActivityCallBack {
+
+ public DemoServiceActivityMixedCallBack() {
+ super();
+ }
+
+ public void onComplete() {
+ try {
+ MixedBusinessActivity mixedBusinessActivity = ((MixedBusinessActivity)businessActivity);
+ mixedBusinessActivity.addParticipantToCloseList("creditingBank");
+ mixedBusinessActivity.addParticipantToCompensateList("debitingBank");
+ mixedBusinessActivity.finalizeActivity();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+}
diff --git a/test/org/apache/kandula/integration/ba/DummyBAResource.java b/test/org/apache/kandula/integration/ba/DummyBAResource.java
new file mode 100644
index 0000000..8608e77
--- /dev/null
+++ b/test/org/apache/kandula/integration/ba/DummyBAResource.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.kandula.integration.ba;
+
+import org.apache.kandula.Constants;
+import org.apache.kandula.faults.AbstractKandulaException;
+import org.apache.kandula.participant.ba.KandulaBusinessActivityResource;
+
+public class DummyBAResource extends KandulaBusinessActivityResource {
+
+ /**
+ *
+ */
+ public DummyBAResource() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+ public String getProtocol() {
+ return Constants.WS_BA_CC;
+ }
+
+ public boolean compensate() {
+ System.out.println("Compensated");
+ return true;
+ }
+
+ public void complete() throws AbstractKandulaException{
+ System.out.println("Complete");
+ return;
+ }
+
+ public void close() {
+ System.out.println("Close");
+ }
+
+ public void cancel() {
+ System.out.println("Cancel");
+ }
+
+}
\ No newline at end of file