public class RemoteServiceContainerAdapterImpl extends Object implements IRemoteServiceContainerAdapter
| Modifier and Type | Field and Description |
|---|---|
protected List<IRemoteServiceListener> |
listeners |
protected Map<IRemoteServiceReference,List<AbstractRemoteService>> |
refToImplMap |
protected RemoteServiceRegistryImpl |
registry |
| Constructor and Description |
|---|
RemoteServiceContainerAdapterImpl(IContainer container) |
RemoteServiceContainerAdapterImpl(IContainer container,
org.eclipse.equinox.concurrent.future.IExecutor executor) |
| Modifier and Type | Method and Description |
|---|---|
void |
addRemoteServiceListener(IRemoteServiceListener listener)
Add listener for remote service registration/unregistration for this
container
|
org.eclipse.equinox.concurrent.future.IFuture |
asyncGetRemoteServiceReferences(ID[] idFilter,
String clazz,
String filter)
Asynchronously returns an array of
IRemoteServiceReference objects. |
org.eclipse.equinox.concurrent.future.IFuture |
asyncGetRemoteServiceReferences(ID target,
ID[] idFilter,
String clazz,
String filter)
Asynchronously returns an array of
IRemoteServiceReference objects. |
org.eclipse.equinox.concurrent.future.IFuture |
asyncGetRemoteServiceReferences(ID target,
String clazz,
String filter)
Asynchronously returns an array of
IRemoteServiceReference objects. |
protected static String |
checkServiceClass(String[] clazzes,
Object serviceObject) |
protected void |
connectToRemoteServiceTarget(ID target) |
protected IRemoteServiceRegisteredEvent |
createRegisteredEvent(RemoteServiceRegistrationImpl registration) |
protected RemoteServiceRegistrationImpl |
createRegistration() |
IRemoteFilter |
createRemoteFilter(String filter)
Creates a
IRemoteFilter object. |
protected AbstractRemoteService |
createRemoteService(RemoteServiceRegistrationImpl registration) |
protected IRemoteServiceUnregisteredEvent |
createUnregisteredEvent(RemoteServiceRegistrationImpl registration) |
void |
dispose() |
protected void |
fireRemoteServiceListeners(IRemoteServiceEvent event) |
Object |
getAdapter(Class adapter) |
IRemoteServiceReference[] |
getAllRemoteServiceReferences(String clazz,
String filter)
Returns an array of
IRemoteServiceReference objects. |
protected IConnectContext |
getConnectContext() |
protected IContainer |
getContainer() |
protected org.eclipse.equinox.concurrent.future.IExecutor |
getExecutor() |
protected ID |
getLocalContainerID() |
protected RemoteServiceRegistryImpl |
getRegistry() |
IRemoteService |
getRemoteService(IRemoteServiceReference reference)
Get remote service for given IRemoteServiceReference.
|
protected IRemoteServiceCallPolicy |
getRemoteServiceCallPolicy() |
IRemoteServiceID |
getRemoteServiceID(ID containerID,
long containerRelativeID)
Get a remote service ID from a containerID and a containerRelative long value.
|
Namespace |
getRemoteServiceNamespace()
Get namespace to use for this remote service provider.
|
IRemoteServiceReference |
getRemoteServiceReference(IRemoteServiceID serviceID)
Get the remote service reference known to this container for the given IRemoteServiceID.
|
IRemoteServiceReference[] |
getRemoteServiceReferences(ID[] idFilter,
String clazz,
String filter)
Returns an array of
IRemoteServiceReference objects. |
IRemoteServiceReference[] |
getRemoteServiceReferences(ID target,
ID[] idFilter,
String clazz,
String filter)
Returns an array of
IRemoteServiceReference objects. |
IRemoteServiceReference[] |
getRemoteServiceReferences(ID target,
String clazz,
String filter)
Returns an array of
IRemoteServiceReference objects. |
protected RemoteServiceRegistrationImpl |
getRemoteServiceRegistrationImpl(IRemoteServiceReference reference) |
protected void |
handleServiceUnregister(RemoteServiceRegistrationImpl registration) |
IRemoteServiceRegistration |
registerRemoteService(String[] clazzes,
Object service,
Dictionary properties)
Register a new remote service.
|
void |
removeRemoteServiceListener(IRemoteServiceListener listener)
Remove remote service registration/unregistration listener for this
container.
|
void |
setConnectContextForAuthentication(IConnectContext connectContext)
Set connect context for authentication upon subsequent calls to
IRemoteServiceContainerAdapter.getRemoteServiceReferences(ID[], String, String) or IRemoteServiceContainerAdapter.asyncGetRemoteServiceReferences(ID[], String, String). |
protected void |
setExecutor(org.eclipse.equinox.concurrent.future.IExecutor executor) |
protected void |
setRegistry(RemoteServiceRegistryImpl registry) |
boolean |
setRemoteServiceCallPolicy(IRemoteServiceCallPolicy policy)
Set the remote service call policy to enable authorization on remote service method calls
|
boolean |
ungetRemoteService(IRemoteServiceReference ref)
Unget IRemoteServiceReference.
|
protected RemoteServiceRegistryImpl registry
protected final List<IRemoteServiceListener> listeners
protected final Map<IRemoteServiceReference,List<AbstractRemoteService>> refToImplMap
public RemoteServiceContainerAdapterImpl(IContainer container, org.eclipse.equinox.concurrent.future.IExecutor executor)
public RemoteServiceContainerAdapterImpl(IContainer container)
public void dispose()
public void addRemoteServiceListener(IRemoteServiceListener listener)
IRemoteServiceContainerAdapteraddRemoteServiceListener in interface IRemoteServiceConsumeraddRemoteServiceListener in interface IRemoteServiceContainerAdapteraddRemoteServiceListener in interface IRemoteServiceHostlistener - notified of service registration/unregistration events. Must
not be null .public void removeRemoteServiceListener(IRemoteServiceListener listener)
IRemoteServiceContainerAdapterremoveRemoteServiceListener in interface IRemoteServiceConsumerremoveRemoteServiceListener in interface IRemoteServiceContainerAdapterremoveRemoteServiceListener in interface IRemoteServiceHostlistener - to remove. Must not be null .public void setConnectContextForAuthentication(IConnectContext connectContext)
IRemoteServiceContainerAdapterIRemoteServiceContainerAdapter.getRemoteServiceReferences(ID[], String, String) or IRemoteServiceContainerAdapter.asyncGetRemoteServiceReferences(ID[], String, String). This
method should be called with a non-null connectContext in order to allow
authentication to occur during.setConnectContextForAuthentication in interface IRemoteServiceConsumersetConnectContextForAuthentication in interface IRemoteServiceContainerAdapterconnectContext - the connect context to use for authenticating.
If null, then no authentication will be
attempted.public boolean setRemoteServiceCallPolicy(IRemoteServiceCallPolicy policy)
IRemoteServiceContainerAdaptersetRemoteServiceCallPolicy in interface IRemoteServiceContainerAdapterpolicy - Implementation of IRemoteServiceCallPolicy containing authorization specific codetrue if the underlying provider supports using the policy, false if
it does not support using the policy.public Object getAdapter(Class adapter)
getAdapter in interface org.eclipse.core.runtime.IAdaptablepublic IRemoteServiceRegistration registerRemoteService(String[] clazzes, Object service, Dictionary properties)
IRemoteServiceContainerAdapterregisterRemoteService in interface IRemoteServiceContainerAdapterregisterRemoteService in interface IRemoteServiceHostclazzes - the interface classes that the service exposes to remote
clients. Must not be null and must not be an
empty array.service - the service object. Under normal conditions this object must
nullnull is if
the service property Constants.SERVICE_REGISTER_PROXY is set
in the properties. If Constants.SERVICE_REGISTER_PROXY is set
in the properties parameter (to an arbitrary value), then the service
object may then be null.properties - to be associated with servicenull .public IRemoteServiceReference[] getRemoteServiceReferences(ID target, ID[] idFilter, String clazz, String filter) throws InvalidSyntaxException, ContainerConnectException
IRemoteServiceContainerAdapterIRemoteServiceReference objects. The
returned array of IRemoteServiceReference objects 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.
target is a remote container to connect to. If null, no connection attempt is made.
idFilter is 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 idFilter is null, all containers are
considered to match the filter.
filter is used to select the registered service whose
properties objects contain keys and values which satisfy the filter. See
Filter for a description of the filter string syntax.
If filter is null, all registered services
are considered to match the filter. If filter cannot be
parsed, an InvalidSyntaxException will be thrown with a human
readable message where the filter became unparsable.
getRemoteServiceReferences in interface IRemoteServiceConsumergetRemoteServiceReferences in interface IRemoteServiceContainerAdaptertarget - a target container to connect to if enclosing container is not already
connected. May be null.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 be null.clazz - the fully qualified name of the interface class that describes
the desired service. Must not be null.filter - The filter criteria. May be null.null if no services are found that match the search.InvalidSyntaxException - If filter contains an invalid filter string that cannot be parsed.ContainerConnectException - if container cannot connectpublic org.eclipse.equinox.concurrent.future.IFuture asyncGetRemoteServiceReferences(ID target, ID[] idFilter, String clazz, String filter)
IRemoteServiceContainerAdapterIRemoteServiceReference objects. The
returned array of IRemoteServiceReference objects 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()
or IFuture.get(long) will return the actual results received. The type of
the Object returned from IFuture.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.
target is a remote container to connect to. If null, no connection attempt is made.
idFilter is 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 idFilter is null, all containers are
considered to match the filter.
filter is used to select the registered service whose
properties objects contain keys and values which satisfy the filter. See
Filter for a description of the filter string syntax.
If filter is null, all registered services
are considered to match the filter. If filter cannot be
parsed, an InvalidSyntaxException will be thrown with a human
readable message where the filter became unparsable.
asyncGetRemoteServiceReferences in interface IRemoteServiceConsumerasyncGetRemoteServiceReferences in interface IRemoteServiceContainerAdaptertarget - an target to connect to if enclosing container is not already
connected. May be null.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 be null.clazz - the fully qualified name of the interface class that describes
the desired service. Must not be null.filter - The filter criteria. May be null.null.public IRemoteServiceReference[] getRemoteServiceReferences(ID[] idFilter, String clazz, String filter) throws InvalidSyntaxException
IRemoteServiceContainerAdapterIRemoteServiceReference objects. The
returned array of IRemoteServiceReference objects 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.
idFilter is 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 idFilter is null, all containers are
considered to match the filter.
filter is used to select the registered service whose
properties objects contain keys and values which satisfy the filter. See
Filter for a description of the filter string syntax.
If filter is null, all registered services
are considered to match the filter. If filter cannot be
parsed, an InvalidSyntaxException will be thrown with a human
readable message where the filter became unparsable.
getRemoteServiceReferences in interface IRemoteServiceConsumergetRemoteServiceReferences in interface IRemoteServiceContainerAdapteridFilter - 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 be null.clazz - the fully qualified name of the interface class that describes
the desired service. Must not be null.filter - The filter criteria. May be null.null if no services are found that match the search.InvalidSyntaxException - If filter contains an invalid filter string that cannot be parsed.public IRemoteServiceReference[] getRemoteServiceReferences(ID target, String clazz, String filter) throws InvalidSyntaxException, ContainerConnectException
IRemoteServiceContainerAdapter
Returns an array of IRemoteServiceReference objects. The
returned array of IRemoteServiceReference objects 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.
filter is used to select the registered service whose
properties objects contain keys and values which satisfy the filter. See
Filter for a description of the filter string syntax.
If filter is null, all registered services
are considered to match the filter. If filter cannot be
parsed, an InvalidSyntaxException will be thrown with a human
readable message where the filter became unparsable.
getRemoteServiceReferences in interface IRemoteServiceConsumergetRemoteServiceReferences in interface IRemoteServiceContainerAdaptertarget - an target to connect to if enclosing container is not already
connected. May be null.clazz - the fully qualified name of the interface class that describes
the desired service. Must not be null.filter - The filter criteria. May be null.null if no services are found that match the search.InvalidSyntaxException - If filter contains an invalid filter string that cannot be parsed.ContainerConnectException - if container cannot connectpublic org.eclipse.equinox.concurrent.future.IFuture asyncGetRemoteServiceReferences(ID[] idFilter, String clazz, String filter)
IRemoteServiceContainerAdapterIRemoteServiceReference objects. The
returned array of IRemoteServiceReference objects 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()
or IFuture.get(long) will return the actual results received. The type of
the Object returned from IFuture.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.
idFilter is 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 idFilter is null, all containers are
considered to match the filter.
filter is used to select the registered service whose
properties objects contain keys and values which satisfy the filter. See
Filter for a description of the filter string syntax.
asyncGetRemoteServiceReferences in interface IRemoteServiceConsumerasyncGetRemoteServiceReferences in interface IRemoteServiceContainerAdapteridFilter - 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 be null.clazz - the fully qualified name of the interface class that describes
the desired service. Must not be null.filter - The filter criteria. May be null.null.public org.eclipse.equinox.concurrent.future.IFuture asyncGetRemoteServiceReferences(ID target, String clazz, String filter)
IRemoteServiceContainerAdapterIRemoteServiceReference objects. The
returned array of IRemoteServiceReference objects 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()
or IFuture.get(long) will return the actual results received. The type of
the Object returned from IFuture.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.
idFilter is 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.
filter is used to select the registered service whose
properties objects contain keys and values which satisfy the filter. See
Filter for a description of the filter string syntax.
asyncGetRemoteServiceReferences in interface IRemoteServiceConsumerasyncGetRemoteServiceReferences in interface IRemoteServiceContainerAdaptertarget - an target to connect to if enclosing container is not already
connected. May be null.clazz - the fully qualified name of the interface class that describes
the desired service. Must not be null.filter - The filter criteria. May be null.null.public IRemoteServiceReference[] getAllRemoteServiceReferences(String clazz, String filter) throws InvalidSyntaxException
IRemoteServiceContainerAdapter
Returns an array of IRemoteServiceReference objects. The
returned array of IRemoteServiceReference objects contains
services that were registered under the specified class, or if the clazz
parameter is null all 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.
filter is used to select the registered service whose
properties objects contain keys and values which satisfy the filter. See
Filter for a description of the filter string syntax.
If filter is null, all registered services
are considered to match the filter. If filter cannot be
parsed, an InvalidSyntaxException will be thrown with a human
readable message where the filter became unparsable.
getAllRemoteServiceReferences in interface IRemoteServiceConsumergetAllRemoteServiceReferences in interface IRemoteServiceContainerAdapterclazz - the fully qualified name of the interface class that describes
the desired service. May be null.filter - The filter criteria. May be null.null if no services are found that match the search.InvalidSyntaxException - If filter contains an invalid filter string that cannot be parsed.public Namespace getRemoteServiceNamespace()
IRemoteServiceContainerAdaptergetRemoteServiceNamespace in interface IRemoteServiceConsumergetRemoteServiceNamespace in interface IRemoteServiceContainerAdaptergetRemoteServiceNamespace in interface IRemoteServiceHostnull.public IRemoteServiceID getRemoteServiceID(ID containerID, long containerRelativeID)
IRemoteServiceContainerAdapternull
if not.getRemoteServiceID in interface IRemoteServiceConsumergetRemoteServiceID in interface IRemoteServiceContainerAdaptergetRemoteServiceID in interface IRemoteServiceHostcontainerID - the containerID that is the server/host for the remote service. Must not be null. 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.null if it is not.public IRemoteServiceReference getRemoteServiceReference(IRemoteServiceID serviceID)
IRemoteServiceContainerAdaptergetRemoteServiceReference in interface IRemoteServiceConsumergetRemoteServiceReference in interface IRemoteServiceContainerAdapterserviceID - the serviceID to retrieve the IRemoteServiceReference for.null if no IRemoteServiceReference found for the given serviceID.public IRemoteService getRemoteService(IRemoteServiceReference reference)
IRemoteServiceContainerAdapterIRemoteServiceContainerAdapter.ungetRemoteService(IRemoteServiceReference)
when the IRemoteService will no longer be used.getRemoteService in interface IRemoteServiceConsumergetRemoteService in interface IRemoteServiceContainerAdapterreference - the IRemoteServiceReference for the desired service. Must not
be null .null is
returned.IRemoteServiceContainerAdapter.ungetRemoteService(IRemoteServiceReference)public boolean ungetRemoteService(IRemoteServiceReference ref)
IRemoteServiceContainerAdapterIRemoteServiceContainerAdapter.getRemoteService(IRemoteServiceReference).
If this method returns true, then the previously used IRemoteService will
no longer be usable.ungetRemoteService in interface IRemoteServiceConsumerungetRemoteService in interface IRemoteServiceContainerAdapterref - the IRemoteServiceReference to ungetIRemoteServiceContainerAdapter.getRemoteService(IRemoteServiceReference)public IRemoteFilter createRemoteFilter(String filter) throws InvalidSyntaxException
IRemoteServiceContainerAdapterIRemoteFilter object. This IRemoteFilter object may
be used to match a IRemoteServiceReference object or a
Dictionary object.
If the filter cannot be parsed, an InvalidSyntaxException will be
thrown with a human readable message where the filter became unparsable.
createRemoteFilter in interface IRemoteServiceConsumercreateRemoteFilter in interface IRemoteServiceContainerAdapterfilter - The filter string.IRemoteFilter object encapsulating the filter string.InvalidSyntaxException - If filter contains an invalid
filter string that cannot be parsed.FrameworkUtil.createFilter(String)protected IRemoteServiceCallPolicy getRemoteServiceCallPolicy()
protected IConnectContext getConnectContext()
protected void setExecutor(org.eclipse.equinox.concurrent.future.IExecutor executor)
protected org.eclipse.equinox.concurrent.future.IExecutor getExecutor()
protected IContainer getContainer()
protected ID getLocalContainerID()
protected RemoteServiceRegistryImpl getRegistry()
protected void setRegistry(RemoteServiceRegistryImpl registry)
protected AbstractRemoteService createRemoteService(RemoteServiceRegistrationImpl registration)
protected IRemoteServiceRegisteredEvent createRegisteredEvent(RemoteServiceRegistrationImpl registration)
protected void fireRemoteServiceListeners(IRemoteServiceEvent event)
protected RemoteServiceRegistrationImpl createRegistration()
protected IRemoteServiceUnregisteredEvent createUnregisteredEvent(RemoteServiceRegistrationImpl registration)
protected void handleServiceUnregister(RemoteServiceRegistrationImpl registration)
protected RemoteServiceRegistrationImpl getRemoteServiceRegistrationImpl(IRemoteServiceReference reference)
protected void connectToRemoteServiceTarget(ID target) throws ContainerConnectException
target - the ID targetContainerConnectException - container connect exception if cannot connectCopyright © 2004–2020 Eclipse Foundation. All rights reserved.