Package org.eclipse.ecf.remoteservice.client

## 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`

    public abstract class AbstractRSAClientService
    extends AbstractClientService

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
`static class` `AbstractRSAClientService.RSARemoteCall`

### 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

Constructors
`AbstractRSAClientService​(AbstractClientContainer container, RemoteServiceClientRegistration registration)`

### Method Summary

All Methods Instance Methods Concrete Methods
`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 AbstractRSAClientService.RSARemoteCall` `createRemoteCall​(Object proxy, Method method, String methodName, Object[] parameters, long timeout)`
`protected Callable<IRemoteCallCompleteEvent>` `getAsyncCallable​(AbstractRSAClientService.RSARemoteCall call)`
`protected ExecutorService` `getExecutorService()`
`protected ExecutorService` `getFutureExecutorService​(IRemoteCall call)`
`protected Callable<Object>` `getSyncCallable​(AbstractRSAClientService.RSARemoteCall call)`
`Object` `invoke​(Object proxy, Method method, Object[] args)`
`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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### AbstractRSAClientService

    public AbstractRSAClientService​(AbstractClientContainer container,
                                    RemoteServiceClientRegistration registration)

### Method Detail

#### invokeRemoteCall

    protected Object invokeRemoteCall​(IRemoteCall call,
                                      IRemoteCallable callable)
                               throws ECFException

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 class `AbstractClientService`
Parameters:
  `call` - the remote call to invoke
  `callable` - the remote callable to invoke
Returns:
  Object result of remote call
Throws:
  `ECFException` - if invoke fails

#### invokeAsync

    protected Object invokeAsync​(AbstractRSAClientService.RSARemoteCall remoteCall)
                          throws ECFException

Invoke a remote call asynchronously. This method should not block and should return either a `IFuture`, `Future`, or `CompletableFuture` 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 be `null`.
Returns:
  Object. Should return a non-null instance of `IFuture`, `Future`, or `CompletableFuture`
Throws:
  `ECFException` - if async cannot be invoked

#### invokeSync

    protected Object invokeSync​(AbstractRSAClientService.RSARemoteCall remoteCall)
                         throws ECFException

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 be `null`.
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

    public Object invoke​(Object proxy,
                         Method method,
                         Object[] args)
                  throws Throwable

Specified by:
  `invoke` in interface `InvocationHandler`
Overrides:
  `invoke` in class `AbstractRemoteService`
Throws:
  `Throwable`

#### getFutureExecutorService

    protected ExecutorService getFutureExecutorService​(IRemoteCall call)

Overrides:
  `getFutureExecutorService` in class `AbstractRemoteService`
Parameters:
  `call` - the remote call to get the ExecutorService for
Returns:
  ExecutorService

#### callAsync

    public void callAsync​(IRemoteCall call,
                          IRemoteCallListener listener)

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 interface `IRemoteService`
Overrides:
  `callAsync` in class `AbstractClientService`
Parameters:
  `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` .
See Also:
  `IRemoteCallStartEvent`, `IRemoteCallCompleteEvent`

#### callSync

    public Object callSync​(IRemoteCall call)
                    throws ECFException

Description copied from interface: `IRemoteService`
Call remote method specified by call parameter synchronously.

Specified by:
  `callSync` in interface `IRemoteService`
Overrides:
  `callSync` in class `AbstractClientService`
Parameters:
  `call` - the remote call to make
Returns:
  Object the result of the call. Will be `null` if remote provides `null` as result.
Throws:
  `ECFException` - thrown if disconnect occurs, caller not currently connected, or remote throws Exception

#### getExecutorService

    protected ExecutorService getExecutorService()

Since:
  8.13

#### getAsyncCallable

    protected Callable<IRemoteCallCompleteEvent> getAsyncCallable​(AbstractRSAClientService.RSARemoteCall call)

Since:
  8.13

#### getSyncCallable

    protected Callable<Object> getSyncCallable​(AbstractRSAClientService.RSARemoteCall call)

Since:
  8.13