01: package org.objectweb.celtix.systest.ws.rm;
02:
03: import java.util.concurrent.Future;
04: import java.util.logging.Level;
05: import java.util.logging.Logger;
06:
07: import javax.jws.WebService;
08: import javax.xml.ws.AsyncHandler;
09: import javax.xml.ws.Response;
10:
11: import org.objectweb.celtix.greeter_control.Greeter;
12: import org.objectweb.celtix.greeter_control.PingMeFault;
13: import org.objectweb.celtix.greeter_control.types.FaultDetail;
14: import org.objectweb.celtix.greeter_control.types.GreetMeResponse;
15: import org.objectweb.celtix.greeter_control.types.PingMeResponse;
16: import org.objectweb.celtix.greeter_control.types.SayHiResponse;
17:
18: @WebService(serviceName="GreeterService",portName="GreeterPort",endpointInterface="org.objectweb.celtix.greeter_control.Greeter",targetNamespace="http://celtix.objectweb.org/greeter_control")
19: public class GreeterImpl implements Greeter {
20: private static final Logger LOG = Logger
21: .getLogger(GreeterImpl.class.getName());
22:
23: public String greetMe(String me) {
24: if (LOG.isLoggable(Level.INFO)) {
25: LOG.info("Invoking greetMe with parameters(s): " + me);
26: }
27: return "Hello " + me;
28: }
29:
30: public void greetMeOneWay(String requestType) {
31: if (LOG.isLoggable(Level.INFO)) {
32: LOG.info("Invoking greetMeOneWay with parameters(s): "
33: + requestType);
34: }
35: try {
36: // sleep will ensure a spurious resend if partial response containing
37: // ACK is not completed *before* the implementor is invoked
38: Thread.sleep(15 * 1000);
39: } catch (Exception e) {
40: // ignore
41: }
42: }
43:
44: public String sayHi() {
45: LOG.info("Invoking sayHi");
46: return "Bonjour";
47: }
48:
49: public void pingMe() throws PingMeFault {
50: LOG.info("Invoking pingMe");
51: FaultDetail faultDetail = new FaultDetail();
52: faultDetail.setMajor((short) 2);
53: faultDetail.setMinor((short) 1);
54: throw new PingMeFault("PingMeFault raised by server",
55: faultDetail);
56: }
57:
58: public Future<?> greetMeAsync(String requestType,
59: AsyncHandler<GreetMeResponse> asyncHandler) {
60: // not called
61: return null;
62: }
63:
64: public Response<GreetMeResponse> greetMeAsync(String requestType) {
65: // not called
66: return null;
67: }
68:
69: public Response<PingMeResponse> pingMeAsync() {
70: // not called
71: return null;
72: }
73:
74: public Future<?> pingMeAsync(
75: AsyncHandler<PingMeResponse> asyncHandler) {
76: // not called
77: return null;
78: }
79:
80: public Response<SayHiResponse> sayHiAsync() {
81: // not called
82: return null;
83: }
84:
85: public Future<?> sayHiAsync(AsyncHandler<SayHiResponse> asyncHandler) {
86: // not called
87: return null;
88: }
89:
90: }
|