|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gcube.common.clients.delegates.AsyncProxyDelegate<S>
S - the type of service stubspublic class AsyncProxyDelegate<S>
A ProxyDelegate that delivers the outcome of Calls asynchronously, either through polling or
notifications.
The delegates use ExecutorServices to make calls in separate threads. If required, clients may provide their own
ExecutorServices at the point of call submission.
| Constructor Summary | |
|---|---|
AsyncProxyDelegate(ProxyDelegate<S> delegate)
Creates an instance with a (synchronous) ProxyDelegate |
|
| Method Summary | ||
|---|---|---|
ProxyConfig<?,S> |
config()
Returns the configuration of the proxy. |
|
|
make(Call<S,V> call)
Makes a Call to a given service endpoint. |
|
|
makeAsync(Call<S,V> call)
Makes a Call to a service endpoint asynchronously, returning a Future that clients can use to
poll for and obtain the call outcome, or to cancel the call (assuming that the call is designed for cancellation
or has not been made yet). |
|
|
makeAsync(Call<S,V> call,
Callback<V> callback)
Makes a Call to a service endpoint asynchronously, notifying a Callback of its outcome. |
|
|
makeAsync(Call<S,V> call,
Callback<V> callback,
ExecutorService service)
Makes a Call to a service endpoint asynchronously, notifying a Callback of its outcome. |
|
|
makeAsync(Call<S,V> call,
ExecutorService service)
Makes a Call to a service endpoint asynchronously, returning a Future that clients can use to
poll for and obtain the call outcome, or to cancel the call (assuming that the call is designed for cancellation
or has not been made yet). |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AsyncProxyDelegate(ProxyDelegate<S> delegate)
ProxyDelegate
delegate - the delegate| Method Detail |
|---|
public <V> V make(Call<S,V> call)
throws Exception
ProxyDelegateCall to a given service endpoint.
make in interface ProxyDelegate<S>V - the type of the value returned from the callcall - the call
Exception - if the call failspublic ProxyConfig<?,S> config()
ProxyDelegate
config in interface ProxyDelegate<S>
public <V> Future<V> makeAsync(Call<S,V> call)
throws RejectedExecutionException
Call to a service endpoint asynchronously, returning a Future that clients can use to
poll for and obtain the call outcome, or to cancel the call (assuming that the call is designed for cancellation
or has not been made yet).
V - the type of the value returned from the Callcall - the Call to be made asynchronously
Future of the Call outcome
RejectedExecutionException - if the call cannot not be submitted for asynchronous execution
public <V> Future<V> makeAsync(Call<S,V> call,
ExecutorService service)
throws RejectedExecutionException
Call to a service endpoint asynchronously, returning a Future that clients can use to
poll for and obtain the call outcome, or to cancel the call (assuming that the call is designed for cancellation
or has not been made yet).
V - the type of the value returned from the Callcall - the Call to be executed asynchronouslyservice - a ExecutorService to which the Call should be submitted for execution
Future of the Call outcome
RejectedExecutionException - if the call cannot not be submitted for asynchronous execution
public <V> Future<?> makeAsync(Call<S,V> call,
Callback<V> callback)
throws RejectedExecutionException
Call to a service endpoint asynchronously, notifying a Callback of its outcome. Returns a
Future that clients can use to cancel the execution of the call (assuming that the call is designed for
cancellation or has not been made yet).
call - the Callcallback - the Callback
Future of call submission
RejectedExecutionException - if the call cannot not be submitted for asynchronous execution
public <V> Future<?> makeAsync(Call<S,V> call,
Callback<V> callback,
ExecutorService service)
throws RejectedExecutionException
Call to a service endpoint asynchronously, notifying a Callback of its outcome. Returns a
Future that clients can use to cancel the execution of the call (assuming that the call is designed for
cancellation or has not been made yet).
call - the Callcallback - the Callbackservice - the ExecutorService that executes the call
Future of call submission
RejectedExecutionException - if the call cannot not be submitted for asynchronous execution
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||