1 package org.objectweb.celtix.systest.stress.concurrency; 2 3 4 import java.util.concurrent.Future ; 5 import java.util.concurrent.atomic.AtomicInteger ; 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 greetMeCount = new AtomicInteger (0); 29 protected AtomicInteger greetMeOneWayCount = new AtomicInteger (0); 30 protected AtomicInteger sayHiCount = new AtomicInteger (0); 31 protected AtomicInteger docLitFaultCount = new AtomicInteger (0); 32 protected AtomicInteger docLitBareCount = new AtomicInteger (0); 33 34 35 public String greetMe(String me) { 36 greetMeCount.incrementAndGet(); 37 return "Hello " + me; 38 } 39 40 public void greetMeOneWay(String me) { 41 greetMeOneWayCount.incrementAndGet(); 42 } 43 44 public String sayHi() { 45 sayHiCount.incrementAndGet(); 46 return "Hiya"; 47 } 48 49 public void testDocLitFault(String 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 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 greetMeSometime(String me) { 73 return "How are you " + me; 74 } 75 76 77 public Response<TestDocLitFaultResponse> testDocLitFaultAsync(String faultType) { 78 return null; 79 80 } 81 82 public Future <?> testDocLitFaultAsync(String faultType, 83 AsyncHandler<TestDocLitFaultResponse> asyncHandler) { 84 return null; 85 86 } 87 88 public Future <?> testDocLitBareAsync(String bare, AsyncHandler ah) { 89 return null; 90 91 } 92 93 public Response<BareDocumentResponse> testDocLitBareAsync(String bare) { 94 return null; 95 96 } 97 98 public Future <?> greetMeSometimeAsync(String requestType, 99 AsyncHandler<GreetMeSometimeResponse> asyncHandler) { 100 return null; 101 102 } 103 104 public Response<GreetMeSometimeResponse> greetMeSometimeAsync(String requestType) { 105 return null; 106 107 } 108 109 public Future <?> greetMeAsync(String requestType, AsyncHandler<GreetMeResponse> asyncHandler) { 110 return null; 111 112 } 113 114 public Response<GreetMeResponse> greetMeAsync(String requestType) { 115 return null; 116 117 } 118 119 public Future <?> sayHiAsync(AsyncHandler<SayHiResponse> asyncHandler) { 120 return null; 121 122 } 123 124 public Response<SayHiResponse> sayHiAsync() { 125 return null; 126 127 } 128 129 130 131 } 132 | Popular Tags |