Class AbstractRSAClientService
java.lang.Object
org.eclipse.ecf.remoteservice.asyncproxy.AbstractAsyncProxyRemoteService
org.eclipse.ecf.remoteservice.AbstractRemoteService
org.eclipse.ecf.remoteservice.client.AbstractClientService
org.eclipse.ecf.remoteservice.client.AbstractRSAClientService
- All Implemented Interfaces:
InvocationHandler
,IRemoteService
Abstract client remote service instance. This class should be overridden to implement the abstract
invokeAsync, and invokeSync methods, which will be called when the proxy created is called by clients.
- Since:
- 8.9
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.ecf.remoteservice.client.AbstractClientService
AbstractClientService.AsyncResult, AbstractClientService.UriRequest
Nested classes/interfaces inherited from class org.eclipse.ecf.remoteservice.AbstractRemoteService
AbstractRemoteService.AsyncArgs, AbstractRemoteService.ProxyClassLoader
-
Field Summary
Fields inherited from class org.eclipse.ecf.remoteservice.client.AbstractClientService
container, registration
Fields inherited from class org.eclipse.ecf.remoteservice.AbstractRemoteService
EMPTY_ARGS, futureExecutorService, futureExecutorServiceMaxThreads, iFutureExecutor
-
Constructor Summary
ConstructorDescriptionAbstractRSAClientService
(AbstractClientContainer container, RemoteServiceClientRegistration registration) -
Method Summary
Modifier and TypeMethodDescriptionvoid
callAsync
(IRemoteCall call, IRemoteCallListener listener) Call remote method specified by call parameter asynchronously, and notify specified listener when call starts and completes.callSync
(IRemoteCall call) Call remote method specified by call parameter synchronously.protected AbstractRSAClientService.RSARemoteCall
createRemoteCall
(Object proxy, Method method, String methodName, Object[] parameters, long timeout) protected Callable<IRemoteCallCompleteEvent>
protected ExecutorService
protected ExecutorService
protected Object
invokeAsync
(AbstractRSAClientService.RSARemoteCall remoteCall) Invoke a remote call asynchronously.protected Object
invokeRemoteCall
(IRemoteCall call, IRemoteCallable callable) Invoke remote call.protected Object
invokeSync
(AbstractRSAClientService.RSARemoteCall remoteCall) Invoke a remote call synchronously.Methods inherited from class org.eclipse.ecf.remoteservice.client.AbstractClientService
callAsync, callAsync, callAsync, createUriRequest, fireAsync, getCallMethodNameForProxyInvoke, getCallParametersForProxyInvoke, getClientContainer, getInterfaceClassNames, getNextRequestID, getRegistration, getRemoteServiceID, getRemoteServiceReference, handleInvokeException, invokeSync, prepareEndpointAddress, prepareParameters, processResponse
Methods inherited from class org.eclipse.ecf.remoteservice.AbstractRemoteService
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, getIFutureExecutor, getProxy, getProxy, getRemoteService, getRemoteServiceProxyCreator, handleInvokeSyncException, handleProxyException, invokeAsync, invokeObject, invokeReturnAsync, isAsync, isInterfaceAsync, isMethodAsync, isOSGIAsync, loadInterfaceClass, loadInterfaceClass, logWarning, setFutureExecutorService, setIFutureExecutor
Methods inherited from class org.eclipse.ecf.remoteservice.asyncproxy.AbstractAsyncProxyRemoteService
callFuture, isReturnAsync
-
Constructor Details
-
AbstractRSAClientService
public AbstractRSAClientService(AbstractClientContainer container, RemoteServiceClientRegistration registration)
-
-
Method Details
-
invokeRemoteCall
Description copied from class:AbstractClientService
Invoke remote call. The implementation of this method should actually make the remote call for the given call and associated callable.- Specified by:
invokeRemoteCall
in classAbstractClientService
- Parameters:
call
- the remote call to invokecallable
- the remote callable to invoke- Returns:
- Object result of remote call
- Throws:
ECFException
- if invoke fails
-
invokeAsync
Invoke a remote call asynchronously. This method should not block and should return either aIFuture
,Future
, orCompletableFuture
or a CompletableFuture based upon the return type defined in the asynchronous service interface.- Parameters:
remoteCall
- the RSARemoteCall to use to make the asynchronous remote call. Will not benull
.- Returns:
- Object. Should return a non-null instance of
IFuture
,Future
, orCompletableFuture
- Throws:
ECFException
- if async cannot be invoked
-
invokeSync
Invoke a remote call synchronously. This method should block until a value may be returned, or the remote call has failed or timed out.- Parameters:
remoteCall
- the RSARemoteCall to synchronously invoke. Will not benull
.- Returns:
- the result (of appropriate type)
- Throws:
ECFException
- if some exception occurred during invocation
-
createRemoteCall
protected AbstractRSAClientService.RSARemoteCall createRemoteCall(Object proxy, Method method, String methodName, Object[] parameters, long timeout) -
invoke
- Specified by:
invoke
in interfaceInvocationHandler
- Overrides:
invoke
in classAbstractRemoteService
- Throws:
Throwable
-
getFutureExecutorService
- Overrides:
getFutureExecutorService
in classAbstractRemoteService
- Parameters:
call
- the remote call to get the ExecutorService for- Returns:
- ExecutorService
-
callAsync
Description copied from interface:IRemoteService
Call remote method specified by call parameter asynchronously, and notify specified listener when call starts and completes.- Specified by:
callAsync
in interfaceIRemoteService
- Overrides:
callAsync
in classAbstractClientService
- Parameters:
call
- the remote call to make. Must not benull
.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 benull
.- See Also:
-
callSync
Description copied from interface:IRemoteService
Call remote method specified by call parameter synchronously.- Specified by:
callSync
in interfaceIRemoteService
- Overrides:
callSync
in classAbstractClientService
- Parameters:
call
- the remote call to make- Returns:
- Object the result of the call. Will be
null
if remote providesnull
as result. - Throws:
ECFException
- thrown if disconnect occurs, caller not currently connected, or remote throws Exception
-
getExecutorService
- Since:
- 8.13
-
getAsyncCallable
protected Callable<IRemoteCallCompleteEvent> getAsyncCallable(AbstractRSAClientService.RSARemoteCall call) - Since:
- 8.13
-
getSyncCallable
- Since:
- 8.13
-