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.
|
Object |
callSync(IRemoteCall call)
Call remote method specified by call parameter synchronously.
|
protected AbstractClientService.UriRequest |
createUriRequest(String endpoint,
IRemoteCall call,
IRemoteCallable callable) |
void |
fireAsync(IRemoteCall call)
Fire remote method specified by call parameter.
|
protected String |
getCallMethodNameForProxyInvoke(Method method,
Object[] args) |
protected Object[] |
getCallParametersForProxyInvoke(String callMethod,
Method proxyMethod,
Object[] args) |
protected AbstractClientContainer |
getClientContainer() |
protected String[] |
getInterfaceClassNames() |
protected long |
getNextRequestID() |
protected RemoteServiceClientRegistration |
getRegistration() |
protected IRemoteServiceID |
getRemoteServiceID() |
protected IRemoteServiceReference |
getRemoteServiceReference() |
protected void |
handleInvokeException(String message,
Throwable e) |
protected abstract Object |
invokeRemoteCall(IRemoteCall call,
IRemoteCallable callable)
Invoke remote call.
|
protected Object |
invokeSync(IRemoteCall remoteCall) |
protected String |
prepareEndpointAddress(IRemoteCall call,
IRemoteCallable callable) |
protected IRemoteCallParameter[] |
prepareParameters(String uri,
IRemoteCall call,
IRemoteCallable callable) |
protected Object |
processResponse(String uri,
IRemoteCall call,
IRemoteCallable callable,
Map responseHeaders,
byte[] responseBody) |
addAsyncProxyClasses, addRemoteServiceProxyToProxy, callAsync, callAsync, callAsyncWithResult, callAsyncWithTimeout, callAsyncWithTimeout, callCompletableAsync, callFutureAsync, callFutureAsync, callSync, convertInterfaceNameToAsyncInterfaceName, createProxy, createProxy, createRCCE, createRCCEFailure, createRCCESuccess, createRemoteCall, dispose, findAsyncRemoteServiceProxyClass, findAsyncRemoteServiceProxyClass, getAsyncArgs, getAsyncInvokeMethodName, getAsyncRemoteCall, getCallTimeoutForProxyInvoke, getDefaultTimeout, getFutureExecutorService, getIFutureExecutor, getProxy, getProxy, getRemoteService, getRemoteServiceProxyCreator, handleInvokeSyncException, handleProxyException, invoke, invokeAsync, invokeObject, invokeReturnAsync, isAsync, isInterfaceAsync, isMethodAsync, isOSGIAsync, loadInterfaceClass, loadInterfaceClass, logWarning, setFutureExecutorService, setIFutureExecutorcallFuture, isReturnAsyncprotected RemoteServiceClientRegistration registration
protected AbstractClientContainer container
public AbstractClientService(AbstractClientContainer container, RemoteServiceClientRegistration registration)
public Object callSync(IRemoteCall call) throws ECFException
IRemoteServicecall - 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)
IRemoteServiceIFuture 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 IRemoteServicecallAsync in class AbstractRemoteServicecall - 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)
IRemoteServicecall - 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,
IRemoteCallCompleteEventpublic void fireAsync(IRemoteCall call) throws ECFException
IRemoteServicecall - the remote call to make. Must not be null .ECFException - if caller not currently connectedprotected Object invokeSync(IRemoteCall remoteCall) throws ECFException
invokeSync in class AbstractRemoteServiceECFExceptionprotected Object[] getCallParametersForProxyInvoke(String callMethod, Method proxyMethod, Object[] args)
getCallParametersForProxyInvoke in class AbstractRemoteServiceprotected String getCallMethodNameForProxyInvoke(Method method, Object[] args)
getCallMethodNameForProxyInvoke in class AbstractRemoteServiceprotected 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(String message, Throwable e) throws ECFException
ECFExceptionprotected AbstractClientContainer getClientContainer()
protected RemoteServiceClientRegistration getRegistration()
protected String prepareEndpointAddress(IRemoteCall call, IRemoteCallable callable)
protected IRemoteCallParameter[] prepareParameters(String uri, IRemoteCall call, IRemoteCallable callable) throws NotSerializableException
NotSerializableExceptionprotected Object processResponse(String uri, IRemoteCall call, IRemoteCallable callable, Map responseHeaders, byte[] responseBody) throws NotSerializableException
uri - uricall - callcallable - callableresponseHeaders - responseHeadersresponseBody - responseBodyNotSerializableException - if response cannot be deserializedprotected IRemoteServiceID getRemoteServiceID()
getRemoteServiceID in class AbstractRemoteServiceprotected IRemoteServiceReference getRemoteServiceReference()
getRemoteServiceReference in class AbstractRemoteServiceprotected String[] getInterfaceClassNames()
getInterfaceClassNames in class AbstractRemoteServiceprotected AbstractClientService.UriRequest createUriRequest(String endpoint, IRemoteCall call, IRemoteCallable callable)
endpoint - endpointcall - callcallable - callableprotected abstract 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.Copyright © 2004–2020 Eclipse Foundation. All rights reserved.