KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > celtix > systest > stress > concurrency > GreeterImpl


1 package org.objectweb.celtix.systest.stress.concurrency;
2
3
4 import java.util.concurrent.Future JavaDoc;
5 import java.util.concurrent.atomic.AtomicInteger JavaDoc;
6
7 import javax.jws.WebService;
8 import javax.xml.ws.AsyncHandler;
9 import javax.xml.ws.Response;
10
11 import org.objectweb.hello_world_soap_http.BadRecordLitFault;
12 import org.objectweb.hello_world_soap_http.Greeter;
13 import org.objectweb.hello_world_soap_http.NoSuchCodeLitFault;
14 import org.objectweb.hello_world_soap_http.types.BareDocumentResponse;
15 import org.objectweb.hello_world_soap_http.types.ErrorCode;
16 import org.objectweb.hello_world_soap_http.types.GreetMeResponse;
17 import org.objectweb.hello_world_soap_http.types.GreetMeSometimeResponse;
18 import org.objectweb.hello_world_soap_http.types.NoSuchCodeLit;
19 import org.objectweb.hello_world_soap_http.types.SayHiResponse;
20 import org.objectweb.hello_world_soap_http.types.TestDocLitFaultResponse;
21
22 @WebService(serviceName = "SOAPServiceConcurrencyTest",
23             portName = "SoapPort",
24             endpointInterface = "org.objectweb.hello_world_soap_http.Greeter",
25             targetNamespace = "http://objectweb.org/hello_world_soap_http")
26 public class GreeterImpl implements Greeter {
27
28     protected AtomicInteger JavaDoc greetMeCount = new AtomicInteger JavaDoc(0);
29     protected AtomicInteger JavaDoc greetMeOneWayCount = new AtomicInteger JavaDoc(0);
30     protected AtomicInteger JavaDoc sayHiCount = new AtomicInteger JavaDoc(0);
31     protected AtomicInteger JavaDoc docLitFaultCount = new AtomicInteger JavaDoc(0);
32     protected AtomicInteger JavaDoc docLitBareCount = new AtomicInteger JavaDoc(0);
33
34
35     public String JavaDoc greetMe(String JavaDoc me) {
36         greetMeCount.incrementAndGet();
37         return "Hello " + me;
38     }
39
40     public void greetMeOneWay(String JavaDoc me) {
41         greetMeOneWayCount.incrementAndGet();
42     }
43
44     public String JavaDoc sayHi() {
45         sayHiCount.incrementAndGet();
46         return "Hiya";
47     }
48
49     public void testDocLitFault(String JavaDoc faultType) throws BadRecordLitFault, NoSuchCodeLitFault {
50         docLitFaultCount.incrementAndGet();
51         if (faultType.equals(BadRecordLitFault.class.getSimpleName())) {
52             throw new BadRecordLitFault("TestBadRecordLit", "BadRecordLitFault");
53         }
54         if (faultType.equals(NoSuchCodeLitFault.class.getSimpleName())) {
55             ErrorCode ec = new ErrorCode();
56             ec.setMajor((short)1);
57             ec.setMinor((short)1);
58             NoSuchCodeLit nscl = new NoSuchCodeLit();
59             nscl.setCode(ec);
60             throw new NoSuchCodeLitFault("TestNoSuchCodeLit", nscl);
61         }
62     }
63
64     public BareDocumentResponse testDocLitBare(String JavaDoc in) {
65         docLitBareCount.incrementAndGet();
66         BareDocumentResponse res = new BareDocumentResponse();
67         res.setCompany("Celtix");
68         res.setId(1);
69         return res;
70     }
71     
72     public String JavaDoc greetMeSometime(String JavaDoc me) {
73         return "How are you " + me;
74     }
75     
76     
77     public Response<TestDocLitFaultResponse> testDocLitFaultAsync(String JavaDoc faultType) {
78         return null;
79         /*not called */
80     }
81     
82     public Future JavaDoc<?> testDocLitFaultAsync(String JavaDoc faultType,
83                                           AsyncHandler<TestDocLitFaultResponse> asyncHandler) {
84         return null;
85         /*not called */
86     }
87     
88     public Future JavaDoc<?> testDocLitBareAsync(String JavaDoc bare, AsyncHandler ah) {
89         return null;
90         /* not called */
91     }
92     
93     public Response<BareDocumentResponse> testDocLitBareAsync(String JavaDoc bare) {
94         return null;
95         /* not called */
96     }
97     
98     public Future JavaDoc<?> greetMeSometimeAsync(String JavaDoc requestType,
99                                            AsyncHandler<GreetMeSometimeResponse> asyncHandler) {
100         return null;
101         /*not called */
102     }
103     
104     public Response<GreetMeSometimeResponse> greetMeSometimeAsync(String JavaDoc requestType) {
105         return null;
106         /*not called */
107     }
108     
109     public Future JavaDoc<?> greetMeAsync(String JavaDoc requestType, AsyncHandler<GreetMeResponse> asyncHandler) {
110         return null;
111         /*not called */
112     }
113     
114     public Response<GreetMeResponse> greetMeAsync(String JavaDoc requestType) {
115         return null;
116         /*not called */
117     }
118     
119     public Future JavaDoc<?> sayHiAsync(AsyncHandler<SayHiResponse> asyncHandler) {
120         return null;
121         /*not called */
122     }
123     
124     public Response<SayHiResponse> sayHiAsync() {
125         return null;
126         /*not called */
127     }
128     
129     
130     
131 }
132
Popular Tags