|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.ecf.core.sharedobject.BaseSharedObject
org.eclipse.ecf.provider.remoteservice.generic.RegistrySharedObject
public class RegistrySharedObject
| Field Summary | |
|---|---|
protected static int |
ADD_REGISTRATION_REQUEST_TIMEOUT
|
protected java.util.Map |
addRegistrationRequests
Map of add registration requests. |
protected int |
addRegistrationRequestTimeout
Add registration request default timeout |
protected IConnectContext |
connectContext
Connect context to be used for connect. |
protected RemoteServiceRegistryImpl |
localRegistry
registry impl for local remote service registrations |
protected long |
registryUpdateRequestTimeout
|
protected java.util.Map |
remoteRegistrys
map of registry impls for remote registrys key: ID (identifier of remote container), value: RemoteServiceRegistryImpl (copy of remote service registry for remote container |
protected java.util.List |
requests
List of invocation requests...instances of Request |
protected boolean |
rsConnected
Whether or not we are connected |
protected java.lang.Object |
rsConnectLock
|
protected int |
rsConnectTimeout
Add registration request default timeout. |
protected java.util.List |
serviceListeners
List of remote service listeners (added to/removed from by addRemoteServiceListener/removeRemoteServiceListener |
| Fields inherited from class org.eclipse.ecf.core.sharedobject.BaseSharedObject |
|---|
DESTROYREMOTE_CODE, DESTROYSELFLOCAL_CODE |
| Constructor Summary | |
|---|---|
RegistrySharedObject()
|
|
| Method Summary | |
|---|---|
protected RemoteServiceRegistryImpl |
addRemoteRegistry(RemoteServiceRegistryImpl registry)
End message send/handlers |
void |
addRemoteServiceListener(IRemoteServiceListener listener)
Add listener for remote service registration/unregistration for this container |
protected boolean |
addRequest(Request request)
|
org.eclipse.equinox.concurrent.future.IFuture |
asyncGetRemoteServiceReferences(ID[] idFilter,
java.lang.String clazz,
java.lang.String filter)
Asynchronously returns an array of IRemoteServiceReference objects. |
org.eclipse.equinox.concurrent.future.IFuture |
asyncGetRemoteServiceReferences(ID target,
ID[] idFilter,
java.lang.String clazz,
java.lang.String filter)
Asynchronously returns an array of IRemoteServiceReference objects. |
org.eclipse.equinox.concurrent.future.IFuture |
asyncGetRemoteServiceReferences(ID target,
java.lang.String clazz,
java.lang.String filter)
Asynchronously returns an array of IRemoteServiceReference objects. |
protected java.lang.Object |
callSynch(RemoteServiceRegistrationImpl registration,
IRemoteCall call)
|
protected void |
checkRequestServiceAuthorization(ID remoteContainerID,
AddRegistrationRequest request,
java.io.Serializable credentials)
|
protected void |
clearRemoteRegistrys()
|
protected void |
connectToRemoteServiceTarget(ID targetID)
|
protected IRemoteServiceRegisteredEvent |
createRegisteredEvent(RemoteServiceRegistrationImpl registration)
|
IRemoteFilter |
createRemoteFilter(java.lang.String filter)
Creates a IRemoteFilter object. |
protected RemoteServiceImpl |
createRemoteService(RemoteServiceRegistrationImpl registration)
|
protected org.eclipse.equinox.concurrent.future.IExecutor |
createRequestExecutor(Request request)
|
protected IRemoteServiceUnregisteredEvent |
createUnregisteredEvent(RemoteServiceRegistrationImpl registration)
|
void |
dispose(ID containerID)
Method called by the ISharedObjectContainer upon ISharedObject destruction. |
protected void |
executeRequest(org.eclipse.equinox.concurrent.future.IExecutor executor,
Request request,
ID responseTarget,
RemoteServiceRegistrationImpl localRegistration,
boolean respond)
|
protected void |
fireCallCompleteEvent(IRemoteCallListener listener,
long requestId,
java.lang.Object response,
boolean hadException,
java.lang.Throwable exception)
|
protected void |
fireCallStartEvent(IRemoteCallListener listener,
long requestId,
IRemoteServiceReference reference,
IRemoteCall call)
|
protected void |
fireRemoteServiceListeners(IRemoteServiceEvent event)
|
protected java.io.Serializable |
getAddRegistrationRequestCredentials(AddRegistrationRequest request)
|
protected int |
getAddRegistrationRequestTimeout()
|
IRemoteServiceReference[] |
getAllRemoteServiceReferences(java.lang.String clazz,
java.lang.String filter)
Returns an array of IRemoteServiceReference objects. |
protected RemoteServiceRegistrationImpl |
getLocalRegistrationForRequest(Request request)
|
protected long |
getRegistryUpdateRequestTimeout()
|
protected RemoteServiceRegistryImpl |
getRemoteRegistry(ID containerID)
|
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,
java.lang.String clazz,
java.lang.String filter)
Returns an array of IRemoteServiceReference objects. |
IRemoteServiceReference[] |
getRemoteServiceReferences(ID target,
ID[] idFilter,
java.lang.String clazz,
java.lang.String filter)
Returns an array of IRemoteServiceReference objects. |
IRemoteServiceReference[] |
getRemoteServiceReferences(ID targetID,
java.lang.String clazz,
java.lang.String filter)
Returns an array of IRemoteServiceReference objects. |
protected Request |
getRequest(long requestId)
|
protected int |
getRSConnectTimeout()
|
protected ISharedObjectContext |
getSOContext()
|
protected ID[] |
getTargetsFromProperties(java.util.Dictionary properties)
|
protected void |
handleAddRegistration(ID remoteContainerID,
java.lang.Integer requestId,
RemoteServiceRegistrationImpl registration)
|
protected void |
handleAddRegistration(ID remoteContainerID,
RemoteServiceRegistrationImpl registration)
|
protected void |
handleAddRegistrationRequestRefused(ID remoteContainerID,
java.lang.Integer requestId,
java.security.AccessControlException e)
|
protected void |
handleAddRegistrations(ID remoteContainerID,
java.lang.Integer requestId,
RemoteServiceRegistrationImpl[] registrations)
|
protected void |
handleCallRequest(Request request)
|
protected void |
handleCallResponse(Response response)
|
protected void |
handleContainerConnectedEvent(IContainerConnectedEvent event)
|
protected void |
handleContainerDisconnectedEvent(IContainerDisconnectedEvent event)
|
protected void |
handleContainerEjectedEvent(IContainerEjectedEvent arg0)
|
protected void |
handleFireRequest(Request request)
|
protected void |
handleRegistryActivatedEvent()
|
protected void |
handleRegistryUpdateRequest(ID remoteContainerID)
|
protected void |
handleRegistryUpdateRequest(ID remoteContainerID,
java.lang.Integer requestId)
|
protected void |
handleRequestService(ID remoteContainerID,
AddRegistrationRequest request,
java.lang.Integer requestId,
java.io.Serializable credentials)
|
protected boolean |
handleSharedObjectMsg(SharedObjectMsg msg)
SharedObjectMsg handler method. |
protected void |
handleTargetConnected(ID targetID)
|
protected void |
handleUnregister(ID containerID,
java.lang.Long serviceId)
|
void |
initialize()
Initialize this shared object. |
protected void |
log(int code,
java.lang.String method,
java.lang.Throwable e)
|
protected void |
logException(int code,
java.lang.String message,
java.lang.Throwable e)
|
protected void |
logRemoteCallException(java.lang.String message,
java.lang.Throwable e)
|
protected void |
notifyAddRegistrationResponse(ID remoteContainerID,
java.lang.Integer requestId,
java.security.AccessControlException exception)
|
IRemoteServiceRegistration |
registerRemoteService(java.lang.String[] clazzes,
java.lang.Object service,
java.util.Dictionary properties)
Register a new remote service. |
protected RemoteServiceRegistryImpl |
removeRemoteRegistry(ID containerID)
|
void |
removeRemoteServiceListener(IRemoteServiceListener listener)
Remove remote service registration/unregistration listener for this container. |
protected boolean |
removeRequest(Request request)
|
protected void |
sendAddRegistration(ID receiver,
java.lang.Integer requestId,
RemoteServiceRegistrationImpl reg)
|
protected void |
sendAddRegistration(ID receiver,
RemoteServiceRegistrationImpl reg)
|
protected AddRegistrationRequest |
sendAddRegistrationRequest(ID receiver,
AddRegistrationRequest request,
java.io.Serializable credentials)
|
protected void |
sendAddRegistrationRequestRefused(ID receiver,
java.lang.Integer requestId,
java.lang.Exception except)
|
protected void |
sendAddRegistrations(ID receiver,
java.lang.Integer requestId,
RemoteServiceRegistrationImpl[] regs)
|
protected Request |
sendCallRequest(RemoteServiceRegistrationImpl remoteRegistration,
IRemoteCall call)
|
protected void |
sendCallRequestWithListener(RemoteServiceRegistrationImpl remoteRegistration,
IRemoteCall call,
IRemoteCallListener listener)
|
protected void |
sendCallResponse(ID responseTarget,
Response response)
|
protected Request |
sendFireRequest(RemoteServiceRegistrationImpl remoteRegistration,
IRemoteCall call)
|
protected void |
sendRegistryUpdate(ID targetContainerID)
|
protected void |
sendRegistryUpdate(ID targetContainerID,
java.lang.Integer requestId)
|
protected void |
sendRegistryUpdateRequest()
|
protected void |
sendRegistryUpdateRequest(ID receiver,
java.lang.Integer requestId)
|
protected void |
sendUnregister(RemoteServiceRegistrationImpl serviceRegistration)
|
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 |
setRegistryConnected(boolean connected)
|
boolean |
setRemoteServiceCallPolicy(IRemoteServiceCallPolicy policy)
Set the remote service call policy to enable authorization on remote service method calls |
boolean |
ungetRemoteService(IRemoteServiceReference ref)
Unget IRemoteServiceReference. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
|---|
getAdapter |
| Field Detail |
|---|
protected static final int ADD_REGISTRATION_REQUEST_TIMEOUT
protected RemoteServiceRegistryImpl localRegistry
protected final java.util.Map remoteRegistrys
protected final java.util.List serviceListeners
protected java.util.Map addRegistrationRequests
protected int addRegistrationRequestTimeout
protected java.util.List requests
protected IConnectContext connectContext
protected final java.lang.Object rsConnectLock
protected boolean rsConnected
protected int rsConnectTimeout
protected long registryUpdateRequestTimeout
| Constructor Detail |
|---|
public RegistrySharedObject()
| Method Detail |
|---|
public IRemoteServiceReference[] getRemoteServiceReferences(ID target,
ID[] idFilter,
java.lang.String clazz,
java.lang.String filter)
throws org.osgi.framework.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.
org.osgi.framework.InvalidSyntaxException - If filter contains an invalid filter string that cannot be parsed.
ContainerConnectException
public IRemoteServiceReference[] getRemoteServiceReferences(ID[] idFilter,
java.lang.String clazz,
java.lang.String filter)
throws org.osgi.framework.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.
org.osgi.framework.InvalidSyntaxException - If filter contains an invalid filter string that cannot be parsed.
public IRemoteServiceReference[] getRemoteServiceReferences(ID targetID,
java.lang.String clazz,
java.lang.String filter)
throws org.osgi.framework.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 IRemoteServiceContainerAdaptertargetID - 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.
org.osgi.framework.InvalidSyntaxException - If filter contains an invalid filter string that cannot be parsed.
ContainerConnectException
public IRemoteServiceReference[] getAllRemoteServiceReferences(java.lang.String clazz,
java.lang.String filter)
throws org.osgi.framework.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.
org.osgi.framework.InvalidSyntaxException - If filter contains an invalid filter string that cannot be parsed.public void addRemoteServiceListener(IRemoteServiceListener listener)
IRemoteServiceContainerAdapter
addRemoteServiceListener in interface IRemoteServiceConsumeraddRemoteServiceListener in interface IRemoteServiceContainerAdapteraddRemoteServiceListener in interface IRemoteServiceHostlistener - notified of service registration/unregistration events. Must
not be null .public void removeRemoteServiceListener(IRemoteServiceListener listener)
IRemoteServiceContainerAdapter
removeRemoteServiceListener in interface IRemoteServiceConsumerremoveRemoteServiceListener in interface IRemoteServiceContainerAdapterremoveRemoteServiceListener in interface IRemoteServiceHostlistener - to remove. Must not be null .protected RemoteServiceImpl createRemoteService(RemoteServiceRegistrationImpl registration)
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 IRemoteServiceRegistration registerRemoteService(java.lang.String[] clazzes,
java.lang.Object service,
java.util.Dictionary properties)
IRemoteServiceContainerAdapter
registerRemoteService 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 service
null .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 unget
IRemoteServiceContainerAdapter.getRemoteService(IRemoteServiceReference)
public org.eclipse.equinox.concurrent.future.IFuture asyncGetRemoteServiceReferences(ID[] idFilter,
java.lang.String clazz,
java.lang.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,
ID[] idFilter,
java.lang.String clazz,
java.lang.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 org.eclipse.equinox.concurrent.future.IFuture asyncGetRemoteServiceReferences(ID target,
java.lang.String clazz,
java.lang.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 Namespace getRemoteServiceNamespace()
IRemoteServiceContainerAdapter
getRemoteServiceNamespace in interface IRemoteServiceConsumergetRemoteServiceNamespace in interface IRemoteServiceContainerAdaptergetRemoteServiceNamespace in interface IRemoteServiceHostnull.
public IRemoteFilter createRemoteFilter(java.lang.String filter)
throws org.osgi.framework.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.
org.osgi.framework.InvalidSyntaxException - If filter contains an invalid
filter string that cannot be parsed.FrameworkUtil.createFilter(String)public IRemoteServiceReference getRemoteServiceReference(IRemoteServiceID serviceId)
IRemoteServiceContainerAdapter
getRemoteServiceReference in interface IRemoteServiceConsumergetRemoteServiceReference in interface IRemoteServiceContainerAdapterserviceId - the serviceID to retrieve the IRemoteServiceReference for.
null if no IRemoteServiceReference found for the given serviceID.
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 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 void initialize()
throws SharedObjectInitException
BaseSharedObject
initialize in class BaseSharedObjectSharedObjectInitException - if initialization should throwpublic void dispose(ID containerID)
ISharedObject
dispose in interface ISharedObjectdispose in class BaseSharedObjectcontainerID - the ID of the container that is disposing this ISharedObjectprotected int getRSConnectTimeout()
protected long getRegistryUpdateRequestTimeout()
protected int getAddRegistrationRequestTimeout()
protected void connectToRemoteServiceTarget(ID targetID)
throws ContainerConnectException
ContainerConnectExceptionprotected java.io.Serializable getAddRegistrationRequestCredentials(AddRegistrationRequest request)
protected ID[] getTargetsFromProperties(java.util.Dictionary properties)
protected ISharedObjectContext getSOContext()
protected void handleRegistryActivatedEvent()
protected void handleContainerEjectedEvent(IContainerEjectedEvent arg0)
protected void clearRemoteRegistrys()
protected void setRegistryConnected(boolean connected)
protected void handleContainerDisconnectedEvent(IContainerDisconnectedEvent event)
protected void sendRegistryUpdate(ID targetContainerID)
protected void sendRegistryUpdate(ID targetContainerID,
java.lang.Integer requestId)
protected void handleContainerConnectedEvent(IContainerConnectedEvent event)
protected void handleTargetConnected(ID targetID)
protected void fireRemoteServiceListeners(IRemoteServiceEvent event)
protected java.lang.Object callSynch(RemoteServiceRegistrationImpl registration,
IRemoteCall call)
throws ECFException
ECFException
protected void fireCallStartEvent(IRemoteCallListener listener,
long requestId,
IRemoteServiceReference reference,
IRemoteCall call)
protected void fireCallCompleteEvent(IRemoteCallListener listener,
long requestId,
java.lang.Object response,
boolean hadException,
java.lang.Throwable exception)
protected void sendRegistryUpdateRequest(ID receiver,
java.lang.Integer requestId)
protected void handleRegistryUpdateRequest(ID remoteContainerID,
java.lang.Integer requestId)
protected void sendRegistryUpdateRequest()
protected void handleRegistryUpdateRequest(ID remoteContainerID)
protected AddRegistrationRequest sendAddRegistrationRequest(ID receiver,
AddRegistrationRequest request,
java.io.Serializable credentials)
protected void checkRequestServiceAuthorization(ID remoteContainerID,
AddRegistrationRequest request,
java.io.Serializable credentials)
throws java.security.AccessControlException
java.security.AccessControlException
protected void handleRequestService(ID remoteContainerID,
AddRegistrationRequest request,
java.lang.Integer requestId,
java.io.Serializable credentials)
protected void sendAddRegistration(ID receiver,
RemoteServiceRegistrationImpl reg)
protected void sendAddRegistration(ID receiver,
java.lang.Integer requestId,
RemoteServiceRegistrationImpl reg)
protected void sendAddRegistrations(ID receiver,
java.lang.Integer requestId,
RemoteServiceRegistrationImpl[] regs)
protected void sendAddRegistrationRequestRefused(ID receiver,
java.lang.Integer requestId,
java.lang.Exception except)
protected void handleAddRegistrationRequestRefused(ID remoteContainerID,
java.lang.Integer requestId,
java.security.AccessControlException e)
protected void handleAddRegistration(ID remoteContainerID,
RemoteServiceRegistrationImpl registration)
protected void handleAddRegistrations(ID remoteContainerID,
java.lang.Integer requestId,
RemoteServiceRegistrationImpl[] registrations)
protected void handleAddRegistration(ID remoteContainerID,
java.lang.Integer requestId,
RemoteServiceRegistrationImpl registration)
protected void notifyAddRegistrationResponse(ID remoteContainerID,
java.lang.Integer requestId,
java.security.AccessControlException exception)
requestId -
protected Request sendCallRequest(RemoteServiceRegistrationImpl remoteRegistration,
IRemoteCall call)
throws java.io.IOException
java.io.IOExceptionprotected org.eclipse.equinox.concurrent.future.IExecutor createRequestExecutor(Request request)
protected void executeRequest(org.eclipse.equinox.concurrent.future.IExecutor executor,
Request request,
ID responseTarget,
RemoteServiceRegistrationImpl localRegistration,
boolean respond)
protected void handleCallRequest(Request request)
protected void logRemoteCallException(java.lang.String message,
java.lang.Throwable e)
protected void sendCallRequestWithListener(RemoteServiceRegistrationImpl remoteRegistration,
IRemoteCall call,
IRemoteCallListener listener)
protected void log(int code,
java.lang.String method,
java.lang.Throwable e)
log in class BaseSharedObject
protected void sendCallResponse(ID responseTarget,
Response response)
protected void handleCallResponse(Response response)
protected Request sendFireRequest(RemoteServiceRegistrationImpl remoteRegistration,
IRemoteCall call)
throws ECFException
ECFExceptionprotected void handleFireRequest(Request request)
protected void sendUnregister(RemoteServiceRegistrationImpl serviceRegistration)
protected void handleUnregister(ID containerID,
java.lang.Long serviceId)
protected IRemoteServiceUnregisteredEvent createUnregisteredEvent(RemoteServiceRegistrationImpl registration)
protected IRemoteServiceRegisteredEvent createRegisteredEvent(RemoteServiceRegistrationImpl registration)
protected RemoteServiceRegistryImpl addRemoteRegistry(RemoteServiceRegistryImpl registry)
protected RemoteServiceRegistryImpl getRemoteRegistry(ID containerID)
protected RemoteServiceRegistryImpl removeRemoteRegistry(ID containerID)
protected RemoteServiceRegistrationImpl getLocalRegistrationForRequest(Request request)
protected boolean addRequest(Request request)
protected Request getRequest(long requestId)
protected boolean removeRequest(Request request)
protected void logException(int code,
java.lang.String message,
java.lang.Throwable e)
protected boolean handleSharedObjectMsg(SharedObjectMsg msg)
BaseSharedObjectBaseSharedObject.handleSharedObjectMsgEvent(ISharedObjectMessageEvent) when a
SharedObjectMsg is received either from a local source or a remote
source. This default implementation simply returns false so that other
processing of of the given msg can occur. Subclasses should override this
behavior to define custom logic for handling SharedObjectMsgs.
handleSharedObjectMsg in class BaseSharedObjectmsg - the SharedObjectMsg received
protected IRemoteServiceCallPolicy getRemoteServiceCallPolicy()
public boolean setRemoteServiceCallPolicy(IRemoteServiceCallPolicy policy)
IRemoteServiceContainerAdapter
setRemoteServiceCallPolicy in interface IRemoteServiceContainerAdapterpolicy - Implementation of IRemoteServiceCallPolicy containing authorization specific code
true if the underlying provider supports using the policy, false if
it does not support using the policy.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||