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 ClassesNested classes/interfaces inherited from class org.eclipse.ecf.remoteservice.client.AbstractClientService
AbstractClientService.AsyncResult, AbstractClientService.UriRequestNested 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, registrationFields inherited from class org.eclipse.ecf.remoteservice.AbstractRemoteService
EMPTY_ARGS, futureExecutorService, futureExecutorServiceMaxThreads, iFutureExecutor -
Constructor Summary
ConstructorsConstructorDescriptionAbstractRSAClientService(AbstractClientContainer container, RemoteServiceClientRegistration registration) -
Method Summary
Modifier and TypeMethodDescriptionvoidcallAsync(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.RSARemoteCallcreateRemoteCall(Object proxy, Method method, String methodName, Object[] parameters, long timeout) protected Callable<IRemoteCallCompleteEvent>protected ExecutorServiceprotected ExecutorServiceprotected ObjectinvokeAsync(AbstractRSAClientService.RSARemoteCall remoteCall) Invoke a remote call asynchronously.protected ObjectinvokeRemoteCall(IRemoteCall call, IRemoteCallable callable) Invoke remote call.protected ObjectinvokeSync(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, processResponseMethods 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, setIFutureExecutorMethods 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:AbstractClientServiceInvoke remote call. The implementation of this method should actually make the remote call for the given call and associated callable.- Specified by:
invokeRemoteCallin 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, orCompletableFutureor 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:
invokein interfaceInvocationHandler- Overrides:
invokein classAbstractRemoteService- Throws:
Throwable
-
getFutureExecutorService
- Overrides:
getFutureExecutorServicein classAbstractRemoteService- Parameters:
call- the remote call to get the ExecutorService for- Returns:
- ExecutorService
-
callAsync
Description copied from interface:IRemoteServiceCall remote method specified by call parameter asynchronously, and notify specified listener when call starts and completes.- Specified by:
callAsyncin interfaceIRemoteService- Overrides:
callAsyncin 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:IRemoteServiceCall remote method specified by call parameter synchronously.- Specified by:
callSyncin interfaceIRemoteService- Overrides:
callSyncin classAbstractClientService- Parameters:
call- the remote call to make- Returns:
- Object the result of the call. Will be
nullif remote providesnullas 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
-