1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.kandula.wsat.twopc;
18
19 import org.apache.axis2.addressing.EndpointReference;
20 import org.apache.axis2.description.AxisOperation;
21 import org.apache.axis2.description.AxisService;
22 import org.apache.axis2.description.OutOnlyAxisOperation;
23 import org.apache.kandula.Constants;
24 import org.apache.kandula.faults.AbstractKandulaException;
25 import org.apache.kandula.utility.KandulaConfiguration;
26 import org.apache.kandula.wsat.AbstractATNotifierStub;
27
28 /***
29 * @author <a href="mailto:thilina@opensource.lk"> Thilina Gunarathne </a>
30 */
31 public class ParticipantPortTypeRawXMLStub extends AbstractATNotifierStub {
32 public static final String AXIS2_HOME = ".";
33
34 /***
35 * Constructor
36 *
37 * @throws AbstractKandulaException
38 */
39 public ParticipantPortTypeRawXMLStub() throws AbstractKandulaException {
40 super(KandulaConfiguration.getInstance().getCoordinatorRepo(),
41 KandulaConfiguration.getInstance().getCoordinatorAxis2Conf(),
42 new AxisService("ParticipantPortType"));
43
44
45 AxisOperation operation;
46 operations = new AxisOperation[3];
47
48 operation = new OutOnlyAxisOperation();
49 operation.setName(new javax.xml.namespace.QName(Constants.WS_AT,
50 "prepareOperation"));
51 operations[0] = operation;
52 service.addOperation(operation);
53
54 operation = new OutOnlyAxisOperation();
55 operation.setName(new javax.xml.namespace.QName(Constants.WS_AT,
56 "commitOperation"));
57 operations[1] = operation;
58 service.addOperation(operation);
59
60 operation = new OutOnlyAxisOperation();
61 operation.setName(new javax.xml.namespace.QName(Constants.WS_AT,
62 "rollbackOperation"));
63 operations[2] = operation;
64 service.addOperation(operation);
65 }
66
67 public void prepareOperation(EndpointReference targetEndpoint)
68 throws AbstractKandulaException {
69
70 this.toEPR = targetEndpoint;
71 this.notify("Prepare", Constants.WS_AT_PREPARE, 0, null);
72
73 }
74
75 public void commitOperation(EndpointReference targetEndpoint)
76 throws AbstractKandulaException {
77
78 this.toEPR = targetEndpoint;
79 this.notify("Commit", Constants.WS_AT_COMMIT, 1, null);
80
81 }
82
83 public void rollbackOperation(EndpointReference targetEndpoint)
84 throws AbstractKandulaException {
85
86 this.toEPR = targetEndpoint;
87 this.notify("Rollback", Constants.WS_AT_ROLLBACK, 2, null);
88 }
89
90 }