01: package org.objectweb.celtix.bindings;
02:
03: import java.io.IOException;
04: import java.util.concurrent.Executor;
05: import java.util.concurrent.Future;
06:
07: import org.objectweb.celtix.context.ObjectMessageContext;
08:
09: /**
10: * Provides methods for invoking operations on an endpoint.
11: * @author dkulp
12: *
13: */
14: public interface ClientBinding extends BindingBase {
15:
16: /**
17: * Makes a one way request using the contents of the <code>ObjectMessageContext</code>.
18: * @param context Holds the method and parameters for the request.
19: * @param callback Callback object to handle the IO of the objects in the context
20: * @throws IOException
21: */
22: void invokeOneWay(ObjectMessageContext context,
23: DataBindingCallback callback) throws IOException;
24:
25: /**
26: * Makes a synchronous request and returns the context containing the response.
27: * @param context Holds the method and parameters for the request.
28: * @param callback Callback object to handle the IO of the objects in the context
29: * @return ObjectMessageContext containing the request response.
30: * @throws IOException
31: */
32: ObjectMessageContext invoke(ObjectMessageContext context,
33: DataBindingCallback callback) throws IOException;
34:
35: /**
36: * Makes an asynchronous request using the contents of the <code>ObjectMessageContext</code>.
37: * @param context Holds the method and parameters for the request.
38: * @param callback Callback object to handle the IO of the objects in the context
39: * @return Future for accessing the result of the request.
40: * @throws IOException
41: */
42: Future<ObjectMessageContext> invokeAsync(
43: ObjectMessageContext context, DataBindingCallback callback,
44: Executor executor) throws IOException;
45:
46: /**
47: * Create a response callback for dispatch and correlation of decoupled
48: * responses.
49: * Called by an associated ClientTransport instance when it determines
50: * that a new decoupled response endpoint is required (if a preexisting
51: * decoupled response endpoint is available, then the response correlator
52: * associated with that is used instead).
53: *
54: * @return a new ResponseCallback
55: */
56: ResponseCallback createResponseCallback();
57: }
|