public abstract class AbstractClientService extends AbstractRemoteService
IRemoteService
.Modifier and Type | Class and Description |
---|---|
protected class |
AbstractClientService.AsyncResult
inner class implementing the asynchronous result object.
|
static class |
AbstractClientService.UriRequest |
AbstractRemoteService.AsyncArgs, AbstractRemoteService.ProxyClassLoader
Modifier and Type | Field and Description |
---|---|
protected AbstractClientContainer |
container |
protected RemoteServiceClientRegistration |
registration |
EMPTY_ARGS, futureExecutorService, futureExecutorServiceMaxThreads, iFutureExecutor
Constructor and Description |
---|
AbstractClientService(AbstractClientContainer container,
RemoteServiceClientRegistration registration) |
Modifier and Type | Method and Description |
---|---|
org.eclipse.equinox.concurrent.future.IFuture |
callAsync(IRemoteCall call)
Call remote method specified by call parameter asynchronously, and immediately
return
IFuture instance. |
protected org.eclipse.equinox.concurrent.future.IFuture |
callAsync(IRemoteCall call,
IRemoteCallable callable) |
protected void |
callAsync(IRemoteCall call,
IRemoteCallable restClientCallable,
IRemoteCallListener listener) |
void |
callAsync(IRemoteCall call,
IRemoteCallListener listener)
Call remote method specified by call parameter asynchronously, and notify
specified listener when call starts and completes.
|
java.lang.Object |
callSync(IRemoteCall call)
Call remote method specified by call parameter synchronously.
|
protected AbstractClientService.UriRequest |
createUriRequest(java.lang.String endpoint,
IRemoteCall call,
IRemoteCallable callable) |
void |
fireAsync(IRemoteCall call)
Fire remote method specified by call parameter.
|
protected java.lang.String |
getCallMethodNameForProxyInvoke(java.lang.reflect.Method method,
java.lang.Object[] args) |
protected java.lang.Object[] |
getCallParametersForProxyInvoke(java.lang.String callMethod,
java.lang.reflect.Method proxyMethod,
java.lang.Object[] args) |
protected AbstractClientContainer |
getClientContainer() |
protected java.lang.String[] |
getInterfaceClassNames() |
protected long |
getNextRequestID() |
protected RemoteServiceClientRegistration |
getRegistration() |
protected IRemoteServiceID |
getRemoteServiceID() |
protected IRemoteServiceReference |
getRemoteServiceReference() |
protected void |
handleInvokeException(java.lang.String message,
java.lang.Throwable e) |
protected abstract java.lang.Object |
invokeRemoteCall(IRemoteCall call,
IRemoteCallable callable)
Invoke remote call.
|
protected java.lang.Object |
invokeSync(IRemoteCall remoteCall) |
protected java.lang.String |
prepareEndpointAddress(IRemoteCall call,
IRemoteCallable callable) |
protected IRemoteCallParameter[] |
prepareParameters(java.lang.String uri,
IRemoteCall call,
IRemoteCallable callable) |
protected java.lang.Object |
processResponse(java.lang.String uri,
IRemoteCall call,
IRemoteCallable callable,
java.util.Map responseHeaders,
byte[] responseBody) |
addAsyncProxyClasses, addRemoteServiceProxyToProxy, callAsync, callAsyncWithResult, callCompletableAsync, callFutureAsync, callFutureAsync, convertInterfaceNameToAsyncInterfaceName, createProxy, createProxy, createRemoteCall, dispose, findAsyncRemoteServiceProxyClass, findAsyncRemoteServiceProxyClass, getAsyncArgs, getAsyncInvokeMethodName, getAsyncRemoteCall, getCallTimeoutForProxyInvoke, getDefaultTimeout, getFutureExecutorService, getIFutureExecutor, getProxy, getProxy, getRemoteService, getRemoteServiceProxyCreator, handleInvokeSyncException, handleProxyException, invoke, invokeAsync, invokeObject, isAsync, loadInterfaceClass, loadInterfaceClass, logWarning, setFutureExecutorService, setIFutureExecutor
callFuture
protected RemoteServiceClientRegistration registration
protected AbstractClientContainer container
public AbstractClientService(AbstractClientContainer container, RemoteServiceClientRegistration registration)
public java.lang.Object callSync(IRemoteCall call) throws ECFException
IRemoteService
call
- the remote call to makenull
if
remote provides null
as result.ECFException
- thrown if disconnect occurs, caller not currently connected,
or remote throws Exceptionpublic org.eclipse.equinox.concurrent.future.IFuture callAsync(IRemoteCall call)
IRemoteService
IFuture
instance. Returned IFuture will not be null
,
and allows the caller to retrieve the actual resulting value from the remote call
(or exception).callAsync
in interface IRemoteService
callAsync
in class AbstractRemoteService
call
- the remote call to make. Must not be null
.IFuture.isDone()
, and then to IFuture.get()
the actual result.public void callAsync(IRemoteCall call, IRemoteCallListener listener)
IRemoteService
call
- the remote call to make. Must not be null
.listener
- the listener to notify when call starts and is completed. The
listener will be notified via the two event types
IRemoteCallStartEvent and IRemoteCallCompleteEvent. Must not
be null
.IRemoteCallStartEvent
,
IRemoteCallCompleteEvent
public void fireAsync(IRemoteCall call) throws ECFException
IRemoteService
call
- the remote call to make. Must not be null
.ECFException
- if caller not currently connectedprotected java.lang.Object invokeSync(IRemoteCall remoteCall) throws ECFException
invokeSync
in class AbstractRemoteService
ECFException
protected java.lang.Object[] getCallParametersForProxyInvoke(java.lang.String callMethod, java.lang.reflect.Method proxyMethod, java.lang.Object[] args)
getCallParametersForProxyInvoke
in class AbstractRemoteService
protected java.lang.String getCallMethodNameForProxyInvoke(java.lang.reflect.Method method, java.lang.Object[] args)
getCallMethodNameForProxyInvoke
in class AbstractRemoteService
protected long getNextRequestID()
protected void callAsync(IRemoteCall call, IRemoteCallable restClientCallable, IRemoteCallListener listener)
protected org.eclipse.equinox.concurrent.future.IFuture callAsync(IRemoteCall call, IRemoteCallable callable)
protected void handleInvokeException(java.lang.String message, java.lang.Throwable e) throws ECFException
ECFException
protected AbstractClientContainer getClientContainer()
protected RemoteServiceClientRegistration getRegistration()
protected java.lang.String prepareEndpointAddress(IRemoteCall call, IRemoteCallable callable)
protected IRemoteCallParameter[] prepareParameters(java.lang.String uri, IRemoteCall call, IRemoteCallable callable) throws java.io.NotSerializableException
java.io.NotSerializableException
protected java.lang.Object processResponse(java.lang.String uri, IRemoteCall call, IRemoteCallable callable, java.util.Map responseHeaders, byte[] responseBody) throws java.io.NotSerializableException
uri
- uricall
- callcallable
- callableresponseHeaders
- responseHeadersresponseBody
- responseBodyjava.io.NotSerializableException
- if response cannot be deserializedprotected IRemoteServiceID getRemoteServiceID()
getRemoteServiceID
in class AbstractRemoteService
protected IRemoteServiceReference getRemoteServiceReference()
getRemoteServiceReference
in class AbstractRemoteService
protected java.lang.String[] getInterfaceClassNames()
getInterfaceClassNames
in class AbstractRemoteService
protected AbstractClientService.UriRequest createUriRequest(java.lang.String endpoint, IRemoteCall call, IRemoteCallable callable)
endpoint
- endpointcall
- callcallable
- callableprotected abstract java.lang.Object invokeRemoteCall(IRemoteCall call, IRemoteCallable callable) throws ECFException
call
- the call for the remote call. Will not be null
.callable
- the callable associated with the remote call. Will not be null
.null
.ECFException
- thrown if the call fails.