Package org.eclipse.ecf.remoteservice
Interface IRemoteService
- 
- All Known Implementing Classes:
- AbstractClientService,- AbstractRemoteService,- AbstractRestClientService,- AbstractRSAClientService,- RemoteServiceImpl,- RestClientService
 
 public interface IRemoteServiceInterface providing runtime access to a remote service. An instance implementing this interface will be returned from the IRemoteServiceContainerAdapter.getRemoteService(IRemoteServiceReference) and may then be used to communicate with a remote service. The methods on this interface support accessing the remote service in several ways:
 - callSync -- A synchronous invocation that will block the calling thread until complete (or timeout) and return the result from the remote or throw exception if remote invocation fails or throws exception
- callAsync/1 -- An asynchronous invocation that will not block the caller
 thread but rather return a non-nullIFutureinstance that can be polled for results. SeeIFuture.get(),IFuture.get(long), andIFuture.isDone(). timeout, exception, or successful completion)
- callAsync/2 -- An asynchronous invocation that will not block the caller thread but rather notify the given listener asynchronously when complete (via timeout, exception, or successful completion)
- fireAsync -- An asynchronous invocation that will simply execute the remote method asynchronously, but will not provide any response or remote method failure information
- getProxy -- Access to a local proxy for the remote service that will expose the appropriate interface to the caller, and synchronously call the remote methods when invoked.
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract 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.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.voidfireAsync(IRemoteCall call)Fire remote method specified by call parameter.ObjectgetProxy()Get local proxy for remote interface.ObjectgetProxy(ClassLoader cl, Class[] interfaceClasses)Get local proxy for remote interface.
 
- 
- 
- 
Method Detail- 
callSyncObject callSync(IRemoteCall call) throws ECFException Call 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
- Since:
- 3.0
 
 - 
callAsyncvoid callAsync(IRemoteCall call, IRemoteCallListener listener) Call 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.
- Since:
- 3.0
- See Also:
- IRemoteCallStartEvent,- IRemoteCallCompleteEvent
 
 - 
callAsyncorg.eclipse.equinox.concurrent.future.IFuture callAsync(IRemoteCall call) Call 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).- 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.
- Since:
- 3.0
 
 - 
fireAsyncvoid fireAsync(IRemoteCall call) throws ECFException Fire 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
- Since:
- 3.0
 
 - 
getProxyObject getProxy() throws ECFException Get local proxy for remote interface. The local proxy may then be used to make remote method calls transparently by invoking the local proxy method- Returns:
- Object that implements the interface specified in the
         IRemoteServiceReference instance used to retrieve the
         IRemoteService object. The result may then be cast to the
         appropriate type. Will not be null.
- Throws:
- ECFException- If some problem in creating the proxy. The underlying problem is conveyed in the nested exception.
 
 - 
getProxyObject getProxy(ClassLoader cl, Class[] interfaceClasses) throws ECFException Get local proxy for remote interface. The local proxy may then be used to make remote method calls transparently by invoking the local proxy method- Parameters:
- cl- ClassLoader to use to create the proxy class. Must not be- null.
- interfaceClasses- array of Class that has the loaded interface classes. Must not be- nulland should have dimension of one or more.
- Returns:
- Object that implements the given interfaceClasses.  The result may then 
         be cast to the one of the types given in interfaceClasses. Will not be
         null
- Throws:
- ECFException- If some problem in creating the proxy. The underlying problem is conveyed in the nested exception.
- Since:
- 6.0
 
 
- 
 
-