01: package org.objectweb.celtix.transports;
02:
03: import java.io.IOException;
04: import java.util.concurrent.Executor;
05: import java.util.concurrent.Future;
06:
07: import javax.wsdl.Port;
08:
09: import org.objectweb.celtix.bindings.ResponseCallback;
10: import org.objectweb.celtix.context.InputStreamMessageContext;
11: import org.objectweb.celtix.context.OutputStreamMessageContext;
12: import org.objectweb.celtix.ws.addressing.EndpointReferenceType;
13:
14: /**
15: * ClientTransport
16: * @author dkulp
17: *
18: */
19: public interface ClientTransport extends Transport {
20:
21: /**
22: * Get target endpoint.
23: *
24: * @return EPR for target endpoint
25: * @throws IOException if there is an error creating the endpoint.
26: */
27: EndpointReferenceType getTargetEndpoint();
28:
29: /**
30: * Get decoupled endpoint.
31: *
32: * @return EPR for decoupled endpoint
33: * @throws IOException if there is an error creating the endpoint.
34: */
35: EndpointReferenceType getDecoupledEndpoint() throws IOException;
36:
37: /**
38: * Get WSDL port.
39: *
40: * @return WSDL port
41: */
42: Port getPort();
43:
44: /**
45: * invoke on a oneway operation on a remote service.
46: * @param context
47: */
48: void invokeOneway(OutputStreamMessageContext context)
49: throws IOException;
50:
51: /**
52: * Invoke on a two-way operation on the remote service. The transport
53: * should provide a context that returns a valid InputStream containing
54: * the response in one of two ways:
55: * <ol>
56: * <li>if tightly coupled, via the return value of this method
57: * <li>if decoupled, via the <code>ResponseCallback</code>
58: * </ol>
59: * @param context containg in the request
60: * @return context containing resonse if tightly coupled, null otherwise
61: */
62: InputStreamMessageContext invoke(OutputStreamMessageContext context)
63: throws IOException;
64:
65: /**
66: * invoke on a two-way operation on the remote service asyncronously.
67: *
68: * @param context
69: * @return the context containing the InputStream response payload
70: */
71: Future<InputStreamMessageContext> invokeAsync(
72: OutputStreamMessageContext context, Executor executor)
73: throws IOException;
74:
75: /**
76: * Retrieve the ResponseCallback used to dispatch decoupled responses.
77: * This may be either a new ResponseCallback created via the ClientBinding
78: * or a preexisting instance, if the decoupled response endpoint is
79: * being reused.
80: *
81: * @return a ResponseCallback instance
82: */
83: ResponseCallback getResponseCallback();
84: }
|