Class AbstractClientService
- java.lang.Object
- 
- org.eclipse.ecf.remoteservice.asyncproxy.AbstractAsyncProxyRemoteService
- 
- org.eclipse.ecf.remoteservice.AbstractRemoteService
- 
- org.eclipse.ecf.remoteservice.client.AbstractClientService
 
 
 
- 
- All Implemented Interfaces:
- InvocationHandler,- IRemoteService
 - Direct Known Subclasses:
- AbstractRestClientService,- AbstractRSAClientService
 
 public abstract class AbstractClientService extends AbstractRemoteService Remote service client service. ImplementsIRemoteService.- Since:
- 4.0
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected classAbstractClientService.AsyncResultinner class implementing the asynchronous result object.static classAbstractClientService.UriRequest- 
Nested classes/interfaces inherited from class org.eclipse.ecf.remoteservice.AbstractRemoteServiceAbstractRemoteService.AsyncArgs, AbstractRemoteService.ProxyClassLoader
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected AbstractClientContainercontainerprotected RemoteServiceClientRegistrationregistration- 
Fields inherited from class org.eclipse.ecf.remoteservice.AbstractRemoteServiceEMPTY_ARGS, futureExecutorService, futureExecutorServiceMaxThreads, iFutureExecutor
 
- 
 - 
Constructor SummaryConstructors Constructor Description AbstractClientService(AbstractClientContainer container, RemoteServiceClientRegistration registration)
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description org.eclipse.equinox.concurrent.future.IFuturecallAsync(IRemoteCall call)Call remote method specified by call parameter asynchronously, and immediately returnIFutureinstance.protected org.eclipse.equinox.concurrent.future.IFuturecallAsync(IRemoteCall call, IRemoteCallable callable)protected voidcallAsync(IRemoteCall call, IRemoteCallable restClientCallable, IRemoteCallListener listener)voidcallAsync(IRemoteCall call, IRemoteCallListener listener)Call remote method specified by call parameter asynchronously, and notify specified listener when call starts and completes.ObjectcallSync(IRemoteCall call)Call remote method specified by call parameter synchronously.protected AbstractClientService.UriRequestcreateUriRequest(String endpoint, IRemoteCall call, IRemoteCallable callable)voidfireAsync(IRemoteCall call)Fire remote method specified by call parameter.protected StringgetCallMethodNameForProxyInvoke(Method method, Object[] args)protected Object[]getCallParametersForProxyInvoke(String callMethod, Method proxyMethod, Object[] args)protected AbstractClientContainergetClientContainer()protected String[]getInterfaceClassNames()protected longgetNextRequestID()protected RemoteServiceClientRegistrationgetRegistration()protected IRemoteServiceIDgetRemoteServiceID()protected IRemoteServiceReferencegetRemoteServiceReference()protected voidhandleInvokeException(String message, Throwable e)protected abstract ObjectinvokeRemoteCall(IRemoteCall call, IRemoteCallable callable)Invoke remote call.protected ObjectinvokeSync(IRemoteCall remoteCall)protected StringprepareEndpointAddress(IRemoteCall call, IRemoteCallable callable)protected IRemoteCallParameter[]prepareParameters(String uri, IRemoteCall call, IRemoteCallable callable)protected ObjectprocessResponse(String uri, IRemoteCall call, IRemoteCallable callable, Map responseHeaders, byte[] responseBody)- 
Methods inherited from class org.eclipse.ecf.remoteservice.AbstractRemoteServiceaddAsyncProxyClasses, 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, setIFutureExecutor
 - 
Methods inherited from class org.eclipse.ecf.remoteservice.asyncproxy.AbstractAsyncProxyRemoteServicecallFuture, isReturnAsync
 
- 
 
- 
- 
- 
Field Detail- 
registrationprotected RemoteServiceClientRegistration registration 
 - 
containerprotected AbstractClientContainer container 
 
- 
 - 
Constructor Detail- 
AbstractClientServicepublic AbstractClientService(AbstractClientContainer container, RemoteServiceClientRegistration registration) 
 
- 
 - 
Method Detail- 
callSyncpublic Object callSync(IRemoteCall call) throws ECFException Description copied from interface:IRemoteServiceCall remote method specified by call parameter synchronously.- 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
 
 - 
callAsyncpublic org.eclipse.equinox.concurrent.future.IFuture callAsync(IRemoteCall call) Description copied from interface:IRemoteServiceCall remote method specified by call parameter asynchronously, and immediately returnIFutureinstance. Returned IFuture will not benull, and allows the caller to retrieve the actual resulting value from the remote call (or exception).- Specified by:
- callAsyncin interface- IRemoteService
- Overrides:
- callAsyncin class- AbstractRemoteService
- Parameters:
- call- the remote call to make. Must not be- null.
- Returns:
- IFuture the asynchronous result to allow the caller to poll
 for whether the result IFuture.isDone(), and then toIFuture.get()the actual result.
 
 - 
callAsyncpublic void callAsync(IRemoteCall call, IRemoteCallListener listener) Description copied from interface:IRemoteServiceCall remote method specified by call parameter asynchronously, and notify specified listener when call starts and completes.- 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
 
 - 
fireAsyncpublic void fireAsync(IRemoteCall call) throws ECFException Description copied from interface:IRemoteServiceFire remote method specified by call parameter. The remote method will be invoked as a result of asynchronous message send, but no failure/exception information will be returned, and no result will be returned- Parameters:
- call- the remote call to make. Must not be- null.
- Throws:
- ECFException- if caller not currently connected
 
 - 
invokeSyncprotected Object invokeSync(IRemoteCall remoteCall) throws ECFException - Overrides:
- invokeSyncin class- AbstractRemoteService
- Throws:
- ECFException
 
 - 
getCallParametersForProxyInvokeprotected Object[] getCallParametersForProxyInvoke(String callMethod, Method proxyMethod, Object[] args) - Overrides:
- getCallParametersForProxyInvokein class- AbstractRemoteService
 
 - 
getCallMethodNameForProxyInvokeprotected String getCallMethodNameForProxyInvoke(Method method, Object[] args) - Overrides:
- getCallMethodNameForProxyInvokein class- AbstractRemoteService
 
 - 
getNextRequestIDprotected long getNextRequestID() 
 - 
callAsyncprotected void callAsync(IRemoteCall call, IRemoteCallable restClientCallable, IRemoteCallListener listener) 
 - 
callAsyncprotected org.eclipse.equinox.concurrent.future.IFuture callAsync(IRemoteCall call, IRemoteCallable callable) 
 - 
handleInvokeExceptionprotected void handleInvokeException(String message, Throwable e) throws ECFException - Throws:
- ECFException
 
 - 
getClientContainerprotected AbstractClientContainer getClientContainer() 
 - 
getRegistrationprotected RemoteServiceClientRegistration getRegistration() 
 - 
prepareEndpointAddressprotected String prepareEndpointAddress(IRemoteCall call, IRemoteCallable callable) 
 - 
prepareParametersprotected IRemoteCallParameter[] prepareParameters(String uri, IRemoteCall call, IRemoteCallable callable) throws NotSerializableException - Throws:
- NotSerializableException
 
 - 
processResponseprotected Object processResponse(String uri, IRemoteCall call, IRemoteCallable callable, Map responseHeaders, byte[] responseBody) throws NotSerializableException - Parameters:
- uri- uri
- call- call
- callable- callable
- responseHeaders- responseHeaders
- responseBody- responseBody
- Returns:
- Object processed response
- Throws:
- NotSerializableException- if response cannot be deserialized
- Since:
- 8.0
 
 - 
getRemoteServiceIDprotected IRemoteServiceID getRemoteServiceID() - Specified by:
- getRemoteServiceIDin class- AbstractRemoteService
 
 - 
getRemoteServiceReferenceprotected IRemoteServiceReference getRemoteServiceReference() - Specified by:
- getRemoteServiceReferencein class- AbstractRemoteService
 
 - 
getInterfaceClassNamesprotected String[] getInterfaceClassNames() - Specified by:
- getInterfaceClassNamesin class- AbstractRemoteService
 
 - 
createUriRequestprotected AbstractClientService.UriRequest createUriRequest(String endpoint, IRemoteCall call, IRemoteCallable callable) - Parameters:
- endpoint- endpoint
- call- call
- callable- callable
- Returns:
- UriRequest new UriRequest
- Since:
- 8.5
 
 - 
invokeRemoteCallprotected abstract Object invokeRemoteCall(IRemoteCall call, IRemoteCallable callable) throws ECFException Invoke remote call. The implementation of this method should actually make the remote call for the given call and associated callable.- Parameters:
- call- the call for the remote call. Will not be- null.
- callable- the callable associated with the remote call. Will not be- null.
- Returns:
- Object the result of the remote call.  May be null.
- Throws:
- ECFException- thrown if the call fails.
 
 
- 
 
-