Class RegistrySharedObject
- All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable,IIdentifiable,ISharedObject,IRemoteServiceConsumer,IRemoteServiceContainerAdapter,IRemoteServiceHost
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected MapMap of add registration requests.protected intAdd registration request default timeoutprotected IConnectContextConnect context to be used for connect.protected RemoteServiceRegistryImplregistry impl for local remote service registrationsprotected static final booleanprotected longprotected final Mapmap of registry impls for remote registrys key: ID (identifier of remote container), value: RemoteServiceRegistryImpl (copy of remote service registry for remote containerprotected ListList of invocation requests...instances of Requestprotected booleanWhether or not we are connectedprotected final Objectprotected intAdd registration request default timeout.protected final ListList of remote service listeners (added to/removed from by addRemoteServiceListener/removeRemoteServiceListenerFields inherited from class org.eclipse.ecf.core.sharedobject.BaseSharedObject
DESTROYREMOTE_CODE, DESTROYSELFLOCAL_CODE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected RemoteServiceRegistryImpladdRemoteRegistry(RemoteServiceRegistryImpl registry) voidAdd listener for remote service registration/unregistration for this containerprotected booleanaddRequest(Request request) org.eclipse.equinox.concurrent.future.IFutureasyncGetRemoteServiceReferences(ID[] idFilter, String clazz, String filter) Asynchronously returns an array ofIRemoteServiceReferenceobjects.org.eclipse.equinox.concurrent.future.IFutureasyncGetRemoteServiceReferences(ID target, String clazz, String filter) Asynchronously returns an array ofIRemoteServiceReferenceobjects.org.eclipse.equinox.concurrent.future.IFutureasyncGetRemoteServiceReferences(ID target, ID[] idFilter, String clazz, String filter) Asynchronously returns an array ofIRemoteServiceReferenceobjects.protected ObjectcallSynch(RemoteServiceRegistrationImpl registration, IRemoteCall call) protected voidcheckRequestServiceAuthorization(ID remoteContainerID, AddRegistrationRequest request, Serializable credentials) protected voidprotected voidconnectToRemoteServiceTarget(ID targetID) protected IRemoteServiceRegisteredEventcreateRegisteredEvent(RemoteServiceRegistrationImpl registration) createRemoteFilter(String filter) Creates aIRemoteFilterobject.protected RemoteServiceImplcreateRemoteService(RemoteServiceRegistrationImpl registration) protected org.eclipse.equinox.concurrent.future.IExecutorcreateRequestExecutor(Request request) protected IRemoteServiceUnregisteredEventcreateUnregisteredEvent(RemoteServiceRegistrationImpl registration) protected RequestdeserializeCallRequest(byte[] requestBytes) protected ResponsedeserializeCallResponse(byte[] responseBytes) voidMethod called by the ISharedObjectContainer upon ISharedObject destruction.protected voidexecuteRequest(org.eclipse.equinox.concurrent.future.IExecutor executor, Request request, ID responseTarget, RemoteServiceRegistrationImpl localRegistration, boolean respond) protected voidfireCallCompleteEvent(IRemoteCallListener listener, long requestId, Object response, boolean hadException, Throwable exception) protected voidfireCallStartEvent(IRemoteCallListener listener, long requestId, IRemoteServiceReference reference, IRemoteCall call) protected voidprotected Serializableprotected intgetAllRemoteServiceReferences(String clazz, String filter) Returns an array ofIRemoteServiceReferenceobjects.protected RemoteServiceRegistrationImplgetLocalRegistrationForRequest(Request request) protected longprotected RemoteServiceRegistryImplgetRemoteRegistry(ID containerID) getRemoteService(IRemoteServiceReference reference) Get remote service for given IRemoteServiceReference.protected IRemoteServiceCallPolicygetRemoteServiceID(ID containerId, long containerRelativeId) Get a remote service ID from a containerID and a containerRelative long value.Get namespace to use for this remote service provider.getRemoteServiceReference(IRemoteServiceID serviceId) Get the remote service reference known to this container for the given IRemoteServiceID.getRemoteServiceReferences(ID[] idFilter, String clazz, String filter) Returns an array ofIRemoteServiceReferenceobjects.getRemoteServiceReferences(ID targetID, String clazz, String filter) Returns an array ofIRemoteServiceReferenceobjects.getRemoteServiceReferences(ID target, ID[] idFilter, String clazz, String filter) Returns an array ofIRemoteServiceReferenceobjects.protected RequestgetRequest(long requestId) protected intprotected ISharedObjectContextprotected ID[]getTargetsFromProperties(Dictionary properties) protected voidhandleAddRegistration(ID remoteContainerID, Integer requestId, RemoteServiceRegistrationImpl registration) protected voidhandleAddRegistration(ID remoteContainerID, RemoteServiceRegistrationImpl registration) protected voidhandleAddRegistrationRequestRefused(ID remoteContainerID, Integer requestId, AccessControlException e) protected voidhandleAddRegistrations(ID remoteContainerID, Integer requestId, RemoteServiceRegistrationImpl[] registrations) protected voidhandleCallRequest(Request request) protected voidhandleCallRequestBytes(byte[] requestBytes) protected voidhandleCallResponse(Response response) protected voidhandleCallResponseBytes(byte[] responseBytes) protected voidprotected voidprotected voidprotected voidhandleFireRequest(Request request) protected voidprotected voidhandleRegistryUpdateRequest(ID remoteContainerID) protected voidhandleRegistryUpdateRequest(ID remoteContainerID, Integer requestId) protected voidhandleRequestService(ID remoteContainerID, AddRegistrationRequest request, Integer requestId, Serializable credentials) protected booleanSharedObjectMsg handler method.protected voidhandleTargetConnected(ID targetID) protected voidhandleUnregister(ID containerID, Long serviceId) voidInitialize this shared object.protected Objectprotected voidprotected voidlogException(int code, String message, Throwable e) protected voidlogRemoteCallException(String message, Throwable e) protected voidnotifyAddRegistrationResponse(ID remoteContainerID, Integer requestId, AccessControlException exception) registerRemoteService(String[] clazzes, Object service, Dictionary properties) Register a new remote service.protected RemoteServiceRegistryImplremoveRemoteRegistry(ID containerID) voidRemove remote service registration/unregistration listener for this container.protected booleanremoveRequest(Request request) protected voidsendAddRegistration(ID receiver, Integer requestId, RemoteServiceRegistrationImpl reg) protected voidsendAddRegistration(ID receiver, RemoteServiceRegistrationImpl reg) protected AddRegistrationRequestsendAddRegistrationRequest(ID receiver, AddRegistrationRequest request, Serializable credentials) protected voidsendAddRegistrationRequestRefused(ID receiver, Integer requestId, Exception except) protected voidsendAddRegistrations(ID receiver, Integer requestId, RemoteServiceRegistrationImpl[] regs) protected RequestsendCallRequest(RemoteServiceRegistrationImpl remoteRegistration, IRemoteCall call) protected voidsendCallRequestWithListener(RemoteServiceRegistrationImpl remoteRegistration, IRemoteCall call, IRemoteCallListener listener) protected voidsendCallResponse(ID responseTarget, Response response) protected RequestsendFireRequest(RemoteServiceRegistrationImpl remoteRegistration, IRemoteCall call) protected voidsendRegistryUpdate(ID targetContainerID) protected voidsendRegistryUpdate(ID targetContainerID, Integer requestId) protected voidprotected voidsendRegistryUpdateRequest(ID receiver, Integer requestId) protected voidsendUnregister(RemoteServiceRegistrationImpl serviceRegistration) protected byte[]serializeCallRequest(Request request) protected byte[]serializeCallResponse(Response response) voidsetConnectContextForAuthentication(IConnectContext connectContext) Set connect context for authentication upon subsequent calls toIRemoteServiceContainerAdapter.getRemoteServiceReferences(ID[], String, String)orIRemoteServiceContainerAdapter.asyncGetRemoteServiceReferences(ID[], String, String).protected voidsetRegistryConnected(boolean connected) booleanSet the remote service call policy to enable authorization on remote service method callsbooleanUnget IRemoteServiceReference.Methods inherited from class org.eclipse.ecf.core.sharedobject.BaseSharedObject
addEventProcessor, clearEventProcessors, creationCompleted, destroyRemote, destroySelf, destroySelfLocal, fireEventProcessors, getAdapter, getConfig, getConnectedID, getContext, getGroupMemberIDs, getHomeContainerID, getID, getLocalContainerID, getProperties, getReplicaDescription, getReplicaDescriptions, getSharedObjectMsgFromEvent, handleEvent, handleEvents, handleSharedObjectCreateResponseEvent, handleSharedObjectMsg, handleSharedObjectMsgEvent, handleUnhandledEvent, init, isConnected, isPrimary, log, removeEventProcessor, replicateToRemoteContainers, sendSharedObjectMsgTo, sendSharedObjectMsgToPrimary, sendSharedObjectMsgToSelf, trace, traceCatching, traceEntering, traceEntering, traceEntering, traceExiting, traceExitingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
-
Field Details
-
ADD_REGISTRATION_REQUEST_TIMEOUT
protected static final int ADD_REGISTRATION_REQUEST_TIMEOUT- Since:
- 3.3
-
PROPAGATE_RESPONSE_ERROR
protected static final boolean PROPAGATE_RESPONSE_ERROR- Since:
- 4.2
-
localRegistry
registry impl for local remote service registrations -
remoteRegistrys
map of registry impls for remote registrys key: ID (identifier of remote container), value: RemoteServiceRegistryImpl (copy of remote service registry for remote container -
serviceListeners
List of remote service listeners (added to/removed from by addRemoteServiceListener/removeRemoteServiceListener -
addRegistrationRequests
Map of add registration requests. key: Integer (unique Request id), value: AddRegistrationRequest -
addRegistrationRequestTimeout
protected int addRegistrationRequestTimeoutAdd registration request default timeout- Since:
- 3.0
-
requests
List of invocation requests...instances of Request -
connectContext
Connect context to be used for connect.- Since:
- 3.0
-
rsConnectLock
- Since:
- 3.3
-
rsConnected
protected boolean rsConnectedWhether or not we are connected- Since:
- 3.3
-
rsConnectTimeout
protected int rsConnectTimeoutAdd registration request default timeout.- Since:
- 3.3
-
registryUpdateRequestTimeout
protected long registryUpdateRequestTimeout- Since:
- 3.4
-
-
Constructor Details
-
RegistrySharedObject
public RegistrySharedObject()
-
-
Method Details
-
getRemoteServiceReferences
public IRemoteServiceReference[] getRemoteServiceReferences(ID target, ID[] idFilter, String clazz, String filter) throws InvalidSyntaxException, ContainerConnectException Description copied from interface:IRemoteServiceContainerAdapterReturns an array ofIRemoteServiceReferenceobjects. The returned array ofIRemoteServiceReferenceobjects contains services that were registered under the specified class and match the specified idFilter, and filter criteria.Note this method assumes that the enclosing container has previously been connected, and uses the idFilter to filter among targets within the previously connected set of container IDs. To request connection as part of reference lookup, see
IRemoteServiceContainerAdapter.getRemoteServiceReferences(ID, String, String).The list is valid at the time of the call to this method, however since the Framework is a very dynamic environment, services can be modified or unregistered at anytime.
targetis a remote container to connect to. Ifnull, no connection attempt is made.idFilteris used to select a registered services that were registered by a given set of containers with id in idFilter. Only services exposed by a container with id in idFilter will be returned. IfidFilterisnull, all containers are considered to match the filter.filteris used to select the registered service whose properties objects contain keys and values which satisfy the filter. SeeFilterfor a description of the filter string syntax. Iffilterisnull, all registered services are considered to match the filter. Iffiltercannot be parsed, anInvalidSyntaxExceptionwill be thrown with a human readable message where the filter became unparsable.- Specified by:
getRemoteServiceReferencesin interfaceIRemoteServiceConsumer- Specified by:
getRemoteServiceReferencesin interfaceIRemoteServiceContainerAdapter- Parameters:
target- a target container to connect to if enclosing container is not already connected. May benull.idFilter- an array of ID instances that will restrict the search for matching container ids If null, all remote containers will be considered in search for matching IRemoteServiceReference instances. May benull.clazz- the fully qualified name of the interface class that describes the desired service. Must not benull.filter- The filter criteria. May benull.- Returns:
- Array of IRemoteServiceReferences matching given search criteria or
nullif no services are found that match the search. - Throws:
InvalidSyntaxException- If filter contains an invalid filter string that cannot be parsed.ContainerConnectException- if container cannot connect- Since:
- 3.4
-
getRemoteServiceReferences
public IRemoteServiceReference[] getRemoteServiceReferences(ID[] idFilter, String clazz, String filter) throws InvalidSyntaxException Description copied from interface:IRemoteServiceContainerAdapterReturns an array ofIRemoteServiceReferenceobjects. The returned array ofIRemoteServiceReferenceobjects contains services that were registered under the specified class and match the specified idFilter, and filter criteria.Note this method assumes that the enclosing container has previously been connected, and uses the idFilter to filter among targets within the previously connected set of container IDs. To request connection as part of reference lookup, see
IRemoteServiceContainerAdapter.getRemoteServiceReferences(ID, String, String).The list is valid at the time of the call to this method, however since the Framework is a very dynamic environment, services can be modified or unregistered at anytime.
idFilteris used to select a registered services that were registered by a given set of containers with id in idFilter. Only services exposed by a container with id in idFilter will be returned.If
idFilterisnull, all containers are considered to match the filter.filteris used to select the registered service whose properties objects contain keys and values which satisfy the filter. SeeFilterfor a description of the filter string syntax.If
filterisnull, all registered services are considered to match the filter. Iffiltercannot be parsed, anInvalidSyntaxExceptionwill be thrown with a human readable message where the filter became unparsable.- Specified by:
getRemoteServiceReferencesin interfaceIRemoteServiceConsumer- Specified by:
getRemoteServiceReferencesin interfaceIRemoteServiceContainerAdapter- Parameters:
idFilter- an array of ID instances that will restrict the search for matching container ids If null, all remote containers will be considered in search for matching IRemoteServiceReference instances. May benull.clazz- the fully qualified name of the interface class that describes the desired service. Must not benull.filter- The filter criteria. May benull.- Returns:
- Array of IRemoteServiceReferences matching given search criteria or
nullif no services are found that match the search. - Throws:
InvalidSyntaxException- If filter contains an invalid filter string that cannot be parsed.
-
getRemoteServiceReferences
public IRemoteServiceReference[] getRemoteServiceReferences(ID targetID, String clazz, String filter) throws InvalidSyntaxException, ContainerConnectException Description copied from interface:IRemoteServiceContainerAdapterReturns an array of
IRemoteServiceReferenceobjects. The returned array ofIRemoteServiceReferenceobjects contains services that were registered under the specified class and match the specified idFilter, and filter criteria.The list is valid at the time of the call to this method, however since the Framework is a very dynamic environment, services can be modified or unregistered at anytime.
target is a remote container to connect to.
filteris used to select the registered service whose properties objects contain keys and values which satisfy the filter. SeeFilterfor a description of the filter string syntax.If
filterisnull, all registered services are considered to match the filter. Iffiltercannot be parsed, anInvalidSyntaxExceptionwill be thrown with a human readable message where the filter became unparsable.- Specified by:
getRemoteServiceReferencesin interfaceIRemoteServiceConsumer- Specified by:
getRemoteServiceReferencesin interfaceIRemoteServiceContainerAdapter- Parameters:
targetID- an target to connect to if enclosing container is not already connected. May benull.clazz- the fully qualified name of the interface class that describes the desired service. Must not benull.filter- The filter criteria. May benull.- Returns:
- Array of IRemoteServiceReferences matching given search criteria or
nullif no services are found that match the search. - Throws:
InvalidSyntaxException- If filter contains an invalid filter string that cannot be parsed.ContainerConnectException- if container cannot connect- Since:
- 3.0
-
getAllRemoteServiceReferences
public IRemoteServiceReference[] getAllRemoteServiceReferences(String clazz, String filter) throws InvalidSyntaxException Description copied from interface:IRemoteServiceContainerAdapterReturns an array of
IRemoteServiceReferenceobjects. The returned array ofIRemoteServiceReferenceobjects contains services that were registered under the specified class, or if the clazz parameter isnullall services registered.The list is valid at the time of the call to this method, however since the remote service container is a very dynamic environment, services can be modified or unregistered at anytime.
filteris used to select the registered service whose properties objects contain keys and values which satisfy the filter. SeeFilterfor a description of the filter string syntax.If
filterisnull, all registered services are considered to match the filter. Iffiltercannot be parsed, anInvalidSyntaxExceptionwill be thrown with a human readable message where the filter became unparsable.- Specified by:
getAllRemoteServiceReferencesin interfaceIRemoteServiceConsumer- Specified by:
getAllRemoteServiceReferencesin interfaceIRemoteServiceContainerAdapter- Parameters:
clazz- the fully qualified name of the interface class that describes the desired service. May benull.filter- The filter criteria. May benull.- Returns:
- Array of IRemoteServiceReferences matching given search criteria or
nullif no services are found that match the search. - Throws:
InvalidSyntaxException- If filter contains an invalid filter string that cannot be parsed.- Since:
- 3.0
-
addRemoteServiceListener
Description copied from interface:IRemoteServiceContainerAdapterAdd listener for remote service registration/unregistration for this container- Specified by:
addRemoteServiceListenerin interfaceIRemoteServiceConsumer- Specified by:
addRemoteServiceListenerin interfaceIRemoteServiceContainerAdapter- Specified by:
addRemoteServiceListenerin interfaceIRemoteServiceHost- Parameters:
listener- notified of service registration/unregistration events. Must not benull.
-
removeRemoteServiceListener
Description copied from interface:IRemoteServiceContainerAdapterRemove remote service registration/unregistration listener for this container.- Specified by:
removeRemoteServiceListenerin interfaceIRemoteServiceConsumer- Specified by:
removeRemoteServiceListenerin interfaceIRemoteServiceContainerAdapter- Specified by:
removeRemoteServiceListenerin interfaceIRemoteServiceHost- Parameters:
listener- to remove. Must not benull.
-
createRemoteService
- Parameters:
registration- registration- Returns:
- RemoteServiceImpl remote service implementation
- Since:
- 4.1
-
getRemoteService
Description copied from interface:IRemoteServiceContainerAdapterGet remote service for given IRemoteServiceReference. Note that clients that call this method successfully should later callIRemoteServiceContainerAdapter.ungetRemoteService(IRemoteServiceReference)when the IRemoteService will no longer be used.- Specified by:
getRemoteServicein interfaceIRemoteServiceConsumer- Specified by:
getRemoteServicein interfaceIRemoteServiceContainerAdapter- Parameters:
reference- the IRemoteServiceReference for the desired service. Must not benull.- Returns:
- IRemoteService representing the remote service. If remote service
no longer exists for reference, then
nullis returned. - See Also:
-
registerRemoteService
public IRemoteServiceRegistration registerRemoteService(String[] clazzes, Object service, Dictionary properties) Description copied from interface:IRemoteServiceContainerAdapterRegister a new remote service. This method is to be called by the service server...i.e. the client that wishes to make available a service to other client within this container.- Specified by:
registerRemoteServicein interfaceIRemoteServiceContainerAdapter- Specified by:
registerRemoteServicein interfaceIRemoteServiceHost- Parameters:
clazzes- the interface classes that the service exposes to remote clients. Must not benulland must not be an empty array.service- the service object. Under normal conditions this object must- not be
null - implement all of the classes specified by the first parameter
nullis if the service propertyConstants.SERVICE_REGISTER_PROXYis set in the properties. IfConstants.SERVICE_REGISTER_PROXYis set in the properties parameter (to an arbitrary value), then the service object may then benull.- not be
properties- to be associated with service- Returns:
- IRemoteServiceRegistration the service registration. Will not
return
null.
-
ungetRemoteService
Description copied from interface:IRemoteServiceContainerAdapterUnget IRemoteServiceReference. Release all resources associated with the given IRemoteServiceReference. This method should be called by users of the IRemoteServiceReference that have previously calledIRemoteServiceContainerAdapter.getRemoteService(IRemoteServiceReference). If this method returns true, then the previously used IRemoteService will no longer be usable.- Specified by:
ungetRemoteServicein interfaceIRemoteServiceConsumer- Specified by:
ungetRemoteServicein interfaceIRemoteServiceContainerAdapter- Parameters:
ref- the IRemoteServiceReference to unget- Returns:
- true if unget successful, false if not. If this method returns true, then the IRemoteService instance previously retrieved via the given IRemoteServiceReference instance provided will no longer be usable.
- See Also:
-
asyncGetRemoteServiceReferences
public org.eclipse.equinox.concurrent.future.IFuture asyncGetRemoteServiceReferences(ID[] idFilter, String clazz, String filter) Description copied from interface:IRemoteServiceContainerAdapterAsynchronously returns an array ofIRemoteServiceReferenceobjects. The returned array ofIRemoteServiceReferenceobjects contains services that were registered under the specified class and match the specified idFilter, and filter criteria.Note this method assumes that the enclosing container has previously been connected, and uses the idFilter to filter among targets within the previously connected set of container IDs. To request connection as part of reference lookup, see
IRemoteServiceContainerAdapter.getRemoteServiceReferences(ID, String, String).The IFuture is returned immediately, and subsequent calls to
IFuture.get()orIFuture.get(long)will return the actual results received. The type of the Object returned fromIFuture.get()will be IRemoteServiceReference [].The list is valid at the time of the call to this method, however since the Framework is a very dynamic environment, services can be modified or unregistered at anytime.
idFilteris used to select a registered services that were registered by a given set of containers with id in idFilter. Only services exposed by a container with id in idFilter will be returned.If
idFilterisnull, all containers are considered to match the filter.filteris used to select the registered service whose properties objects contain keys and values which satisfy the filter. SeeFilterfor a description of the filter string syntax.- Specified by:
asyncGetRemoteServiceReferencesin interfaceIRemoteServiceConsumer- Specified by:
asyncGetRemoteServiceReferencesin interfaceIRemoteServiceContainerAdapter- Parameters:
idFilter- an array of ID instances that will restrict the search for matching container ids If null, all remote containers will be considered in search for matching IRemoteServiceReference instances. May benull.clazz- the fully qualified name of the interface class that describes the desired service. Must not benull.filter- The filter criteria. May benull.- Returns:
- IFuture that through subsequent calls to IFuture#get() will return
IRemoteServiceReference [] with IRemoteServiceReferences matching given search criteria.
Will not return
null. - Since:
- 3.0
-
asyncGetRemoteServiceReferences
public org.eclipse.equinox.concurrent.future.IFuture asyncGetRemoteServiceReferences(ID target, ID[] idFilter, String clazz, String filter) Description copied from interface:IRemoteServiceContainerAdapterAsynchronously returns an array ofIRemoteServiceReferenceobjects. The returned array ofIRemoteServiceReferenceobjects contains services that were registered under the specified class and match the specified idFilter, and filter criteria.The IFuture is returned immediately, and subsequent calls to
IFuture.get()orIFuture.get(long)will return the actual results received. The type of the Object returned fromIFuture.get()will be IRemoteServiceReference [].The list is valid at the time of the call to this method, however since the Framework is a very dynamic environment, services can be modified or unregistered at anytime.
targetis a remote container to connect to. Ifnull, no connection attempt is made.idFilteris used to select a registered services that were registered by a given set of containers with id in idFilter. Only services exposed by a container with id in idFilter will be returned. IfidFilterisnull, all containers are considered to match the filter.filteris used to select the registered service whose properties objects contain keys and values which satisfy the filter. SeeFilterfor a description of the filter string syntax. Iffilterisnull, all registered services are considered to match the filter. Iffiltercannot be parsed, anInvalidSyntaxExceptionwill be thrown with a human readable message where the filter became unparsable.- Specified by:
asyncGetRemoteServiceReferencesin interfaceIRemoteServiceConsumer- Specified by:
asyncGetRemoteServiceReferencesin interfaceIRemoteServiceContainerAdapter- Parameters:
target- an target to connect to if enclosing container is not already connected. May benull.idFilter- an array of ID instances that will restrict the search for matching container ids If null, all remote containers will be considered in search for matching IRemoteServiceReference instances. May benull.clazz- the fully qualified name of the interface class that describes the desired service. Must not benull.filter- The filter criteria. May benull.- Returns:
- IFuture that through subsequent calls to IFuture#get() will return
IRemoteServiceReference [] with IRemoteServiceReferences matching given search criteria.
Will not return
null. - Since:
- 3.4
-
asyncGetRemoteServiceReferences
public org.eclipse.equinox.concurrent.future.IFuture asyncGetRemoteServiceReferences(ID target, String clazz, String filter) Description copied from interface:IRemoteServiceContainerAdapterAsynchronously returns an array ofIRemoteServiceReferenceobjects. The returned array ofIRemoteServiceReferenceobjects contains services that were registered under the specified class and match the specified idFilter, and filter criteria.The IFuture is returned immediately, and subsequent calls to
IFuture.get()orIFuture.get(long)will return the actual results received. The type of the Object returned fromIFuture.get()will be IRemoteServiceReference [].The list is valid at the time of the call to this method, however since the Framework is a very dynamic environment, services can be modified or unregistered at anytime.
idFilteris used to select a registered services that were registered by a given set of containers with id in idFilter. Only services exposed by a container with id in idFilter will be returned.target is a remote container to connect to.
filteris used to select the registered service whose properties objects contain keys and values which satisfy the filter. SeeFilterfor a description of the filter string syntax.- Specified by:
asyncGetRemoteServiceReferencesin interfaceIRemoteServiceConsumer- Specified by:
asyncGetRemoteServiceReferencesin interfaceIRemoteServiceContainerAdapter- Parameters:
target- an target to connect to if enclosing container is not already connected. May benull.clazz- the fully qualified name of the interface class that describes the desired service. Must not benull.filter- The filter criteria. May benull.- Returns:
- IFuture that through subsequent calls to IFuture#get() will return
IRemoteServiceReference [] with IRemoteServiceReferences matching given search criteria.
Will not return
null. - Since:
- 3.0
-
getRemoteServiceNamespace
Description copied from interface:IRemoteServiceContainerAdapterGet namespace to use for this remote service provider.- Specified by:
getRemoteServiceNamespacein interfaceIRemoteServiceConsumer- Specified by:
getRemoteServiceNamespacein interfaceIRemoteServiceContainerAdapter- Specified by:
getRemoteServiceNamespacein interfaceIRemoteServiceHost- Returns:
- Namespace to use for creating IRemoteServiceID for this remote service provider. Will
not return
null. - Since:
- 3.0
-
createRemoteFilter
Description copied from interface:IRemoteServiceContainerAdapterCreates aIRemoteFilterobject. ThisIRemoteFilterobject may be used to match aIRemoteServiceReferenceobject or aDictionaryobject.If the filter cannot be parsed, an
InvalidSyntaxExceptionwill be thrown with a human readable message where the filter became unparsable.- Specified by:
createRemoteFilterin interfaceIRemoteServiceConsumer- Specified by:
createRemoteFilterin interfaceIRemoteServiceContainerAdapter- Parameters:
filter- The filter string.- Returns:
- A
IRemoteFilterobject encapsulating the filter string. - Throws:
InvalidSyntaxException- Iffiltercontains an invalid filter string that cannot be parsed.- Since:
- 3.0
- See Also:
-
- "Framework specification for a description of the filter string syntax."
FrameworkUtil.createFilter(String)
-
getRemoteServiceReference
Description copied from interface:IRemoteServiceContainerAdapterGet the remote service reference known to this container for the given IRemoteServiceID. Note that this method must be guaranteed not to block by the provider implementation.- Specified by:
getRemoteServiceReferencein interfaceIRemoteServiceConsumer- Specified by:
getRemoteServiceReferencein interfaceIRemoteServiceContainerAdapter- Parameters:
serviceId- the serviceID to retrieve the IRemoteServiceReference for.- Returns:
- IRemoteServiceReference the remote service reference associated with the given serviceID.
Will return
nullif no IRemoteServiceReference found for the given serviceID. - Since:
- 3.0
-
getRemoteServiceID
Description copied from interface:IRemoteServiceContainerAdapterGet a remote service ID from a containerID and a containerRelative long value. Will return a non-null value if the IRemoteServiceRegistration/Reference is currently 'known' to this container adapter.nullif not.- Specified by:
getRemoteServiceIDin interfaceIRemoteServiceConsumer- Specified by:
getRemoteServiceIDin interfaceIRemoteServiceContainerAdapter- Specified by:
getRemoteServiceIDin interfaceIRemoteServiceHost- Parameters:
containerId- the containerID that is the server/host for the remote service. Must not benull. This must be the containerID for the server/host of the remote service.containerRelativeId- the long value identifying the remote service relative to the container ID.- Returns:
- IRemoteServiceID instance if the associated IRemoteServiceRegistration/Reference is known to this container
adapter,
nullif it is not. - Since:
- 3.0
-
setConnectContextForAuthentication
Description copied from interface:IRemoteServiceContainerAdapterSet connect context for authentication upon subsequent calls toIRemoteServiceContainerAdapter.getRemoteServiceReferences(ID[], String, String)orIRemoteServiceContainerAdapter.asyncGetRemoteServiceReferences(ID[], String, String). This method should be called with a non-null connectContext in order to allow authentication to occur during.- Specified by:
setConnectContextForAuthenticationin interfaceIRemoteServiceConsumer- Specified by:
setConnectContextForAuthenticationin interfaceIRemoteServiceContainerAdapter- Parameters:
connectContext- the connect context to use for authenticating. Ifnull, then no authentication will be attempted.- Since:
- 3.0
-
initialize
Description copied from class:BaseSharedObjectInitialize this shared object. Subclasses may override as appropriate to define custom initialization behavior. If initialization should fail, then a SharedObjectInitException should be thrown by implementing code. Also, subclasses overriding this method should call super.initialize() before running their own code.- Overrides:
initializein classBaseSharedObject- Throws:
SharedObjectInitException- if initialization should throw
-
dispose
Description copied from interface:ISharedObjectMethod called by the ISharedObjectContainer upon ISharedObject destruction. Once this method is called, no more Events will be passed to a ISharedObject until the init method is called again.- Specified by:
disposein interfaceISharedObject- Overrides:
disposein classBaseSharedObject- Parameters:
containerID- the ID of the container that is disposing this ISharedObject
-
getRSConnectTimeout
protected int getRSConnectTimeout()- Returns:
- int connect timeout
- Since:
- 3.3
-
getRegistryUpdateRequestTimeout
protected long getRegistryUpdateRequestTimeout()- Returns:
- long registry update request timeout
- Since:
- 3.4
-
getAddRegistrationRequestTimeout
protected int getAddRegistrationRequestTimeout()- Returns:
- int add registration request timeout
- Since:
- 3.0
-
connectToRemoteServiceTarget
- Parameters:
targetID- target ID to connect to- Throws:
ContainerConnectException- if container cannot connect to target ID- Since:
- 3.3 for preventing issues like bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=304427
-
getAddRegistrationRequestCredentials
-
getTargetsFromProperties
-
getSOContext
-
handleRegistryActivatedEvent
protected void handleRegistryActivatedEvent()- Since:
- 3.4
-
handleContainerEjectedEvent
- Parameters:
event- event to handle- Since:
- 3.3
-
clearRemoteRegistrys
protected void clearRemoteRegistrys()- Since:
- 3.4
-
setRegistryConnected
protected void setRegistryConnected(boolean connected) - Parameters:
connected- true if registry is connected, false otherwise- Since:
- 3.3
-
handleContainerDisconnectedEvent
-
sendRegistryUpdate
-
sendRegistryUpdate
- Parameters:
targetContainerID- target container IDrequestId- requestId- Since:
- 3.4
-
handleContainerConnectedEvent
-
handleTargetConnected
- Parameters:
targetID- targetID- Since:
- 3.4
-
fireRemoteServiceListeners
-
callSynch
protected Object callSynch(RemoteServiceRegistrationImpl registration, IRemoteCall call) throws ECFException - Throws:
ECFException
-
fireCallStartEvent
protected void fireCallStartEvent(IRemoteCallListener listener, long requestId, IRemoteServiceReference reference, IRemoteCall call) -
fireCallCompleteEvent
protected void fireCallCompleteEvent(IRemoteCallListener listener, long requestId, Object response, boolean hadException, Throwable exception) -
sendRegistryUpdateRequest
- Parameters:
receiver- receiverrequestId- requestId- Since:
- 3.4
-
handleRegistryUpdateRequest
- Parameters:
remoteContainerID- remoteContainerIDrequestId- requestId- Since:
- 3.4
-
sendRegistryUpdateRequest
protected void sendRegistryUpdateRequest() -
handleRegistryUpdateRequest
-
sendAddRegistrationRequest
protected AddRegistrationRequest sendAddRegistrationRequest(ID receiver, AddRegistrationRequest request, Serializable credentials) -
checkRequestServiceAuthorization
protected void checkRequestServiceAuthorization(ID remoteContainerID, AddRegistrationRequest request, Serializable credentials) throws AccessControlException - Throws:
AccessControlException
-
handleRequestService
protected void handleRequestService(ID remoteContainerID, AddRegistrationRequest request, Integer requestId, Serializable credentials) -
sendAddRegistration
-
sendAddRegistration
protected void sendAddRegistration(ID receiver, Integer requestId, RemoteServiceRegistrationImpl reg) -
sendAddRegistrations
protected void sendAddRegistrations(ID receiver, Integer requestId, RemoteServiceRegistrationImpl[] regs) - Parameters:
receiver- receiverrequestId- requestIdregs- registrations to send- Since:
- 3.3
-
sendAddRegistrationRequestRefused
-
handleAddRegistrationRequestRefused
protected void handleAddRegistrationRequestRefused(ID remoteContainerID, Integer requestId, AccessControlException e) -
handleAddRegistration
protected void handleAddRegistration(ID remoteContainerID, RemoteServiceRegistrationImpl registration) -
handleAddRegistrations
protected void handleAddRegistrations(ID remoteContainerID, Integer requestId, RemoteServiceRegistrationImpl[] registrations) - Parameters:
remoteContainerID- container idrequestId- requestIdregistrations- the registrations to add- Since:
- 3.3
-
handleAddRegistration
protected void handleAddRegistration(ID remoteContainerID, Integer requestId, RemoteServiceRegistrationImpl registration) -
notifyAddRegistrationResponse
protected void notifyAddRegistrationResponse(ID remoteContainerID, Integer requestId, AccessControlException exception) - Parameters:
remoteContainerID- remoteContainerIDrequestId- requestIdexception- exception- Since:
- 3.2
-
sendCallRequest
protected Request sendCallRequest(RemoteServiceRegistrationImpl remoteRegistration, IRemoteCall call) throws IOException - Throws:
IOException
-
serializeCallRequest
- Throws:
IOException- Since:
- 4.6
-
deserializeCallRequest
- Throws:
IOException- Since:
- 4.6
-
serializeCallResponse
- Throws:
IOException- Since:
- 4.6
-
deserializeCallResponse
- Throws:
IOException- Since:
- 4.6
-
createRequestExecutor
- Parameters:
request- request- Returns:
- IExcecutor excecutor to use for given request
- Since:
- 3.4
-
invokeLocal
protected Object invokeLocal(RemoteServiceRegistrationImpl reg, RemoteCallImpl call) throws InvocationTargetException, Exception, NoClassDefFoundError - Throws:
InvocationTargetExceptionExceptionNoClassDefFoundError- Since:
- 4.4
-
executeRequest
protected void executeRequest(org.eclipse.equinox.concurrent.future.IExecutor executor, Request request, ID responseTarget, RemoteServiceRegistrationImpl localRegistration, boolean respond) - Parameters:
executor- executor to use to execute requestrequest- the request to executeresponseTarget- response targetlocalRegistration- the local registrationrespond- true if response is expected, false otherwise- Since:
- 3.4
-
handleCallRequestBytes
protected void handleCallRequestBytes(byte[] requestBytes) - Since:
- 4.6
-
handleCallRequest
-
logRemoteCallException
- Parameters:
message- messagee- the exception- Since:
- 3.4
-
sendCallRequestWithListener
protected void sendCallRequestWithListener(RemoteServiceRegistrationImpl remoteRegistration, IRemoteCall call, IRemoteCallListener listener) -
log
- Overrides:
login classBaseSharedObject
-
sendCallResponse
-
handleCallResponse
-
handleCallResponseBytes
protected void handleCallResponseBytes(byte[] responseBytes) - Since:
- 4.6
-
sendFireRequest
protected Request sendFireRequest(RemoteServiceRegistrationImpl remoteRegistration, IRemoteCall call) throws ECFException - Throws:
ECFException
-
handleFireRequest
-
sendUnregister
-
handleUnregister
-
createUnregisteredEvent
protected IRemoteServiceUnregisteredEvent createUnregisteredEvent(RemoteServiceRegistrationImpl registration) -
createRegisteredEvent
protected IRemoteServiceRegisteredEvent createRegisteredEvent(RemoteServiceRegistrationImpl registration) -
addRemoteRegistry
-
getRemoteRegistry
-
removeRemoteRegistry
-
getLocalRegistrationForRequest
- Parameters:
request- request- Returns:
- RemoteServiceRegistrationImpl the registration
- Since:
- 3.2
-
addRequest
- Parameters:
request- the request to add- Returns:
- true if added, false if not added
- Since:
- 3.2
-
getRequest
- Parameters:
requestId- requestId- Returns:
- Request the request associated with the given requestId or
null - Since:
- 3.2
-
removeRequest
- Parameters:
request- request- Returns:
- boolean true if removed, false otherwise
- Since:
- 3.2
-
logException
-
getRemoteServiceCallPolicy
- Returns:
- IRemoteServiceCallPolicy the policy. May be
null - Since:
- 4.0
-
setRemoteServiceCallPolicy
Description copied from interface:IRemoteServiceContainerAdapterSet the remote service call policy to enable authorization on remote service method calls- Specified by:
setRemoteServiceCallPolicyin interfaceIRemoteServiceContainerAdapter- Parameters:
policy- the policy to set. May benull- Returns:
- boolean true if set, false if cannot be set.
- Since:
- 4.0
-