|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.ecf.core.AbstractContainer org.eclipse.ecf.remoteservice.client.AbstractClientContainer
public abstract class AbstractClientContainer
Remote service client abstract superclass.
Field Summary | |
---|---|
protected boolean |
alwaysSendDefaultParameters
|
protected IConnectContext |
connectContext
|
protected ID |
connectedID
|
protected java.lang.Object |
connectLock
|
protected ID |
containerID
|
protected IRemoteCallParameterSerializer |
parameterSerializer
|
protected java.lang.Object |
parameterSerializerLock
|
protected RemoteServiceClientRegistry |
registry
|
protected IRemoteResponseDeserializer |
remoteResponseDeserializer
|
protected java.lang.Object |
remoteResponseDeserializerLock
|
protected java.util.List |
remoteServiceListeners
|
Constructor Summary | |
---|---|
AbstractClientContainer(ID containerID)
|
Method Summary | |
---|---|
void |
addRemoteServiceListener(IRemoteServiceListener listener)
Add listener for remote service registration/unregistration for this container |
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. |
void |
connect(ID targetID,
IConnectContext connectContext1)
Connect to a target remote process or process group. |
IRemoteFilter |
createRemoteFilter(java.lang.String filter)
Creates a IRemoteFilter object. |
protected abstract IRemoteService |
createRemoteService(RemoteServiceClientRegistration registration)
Create an implementer of IRemoteService for the given registration. |
protected RemoteServiceClientRegistration |
createRestServiceRegistration(IRemoteCallable[] callables,
java.util.Dictionary properties)
|
protected RemoteServiceClientRegistration |
createRestServiceRegistration(java.lang.String[] clazzes,
IRemoteCallable[][] callables,
java.util.Dictionary properties)
|
void |
disconnect()
Disconnect. |
void |
dispose()
Dispose this IContainer instance. |
IRemoteServiceReference[] |
getAllRemoteServiceReferences(java.lang.String clazz,
java.lang.String filter)
Returns an array of IRemoteServiceReference objects. |
IConnectContext |
getConnectContextForAuthentication()
|
ID |
getConnectedID()
Get the target ID that this container instance has connected to. |
ID |
getID()
Return the ID for this 'identifiable' object. |
protected IRemoteCallParameterSerializer |
getParameterSerializer()
|
protected IRemoteCallParameterSerializer |
getParameterSerializer(IRemoteCallParameter parameter,
java.lang.Object value)
|
protected ID |
getRemoteCallTargetID()
|
IRemoteService |
getRemoteService(IRemoteServiceReference reference)
Get remote service for given IRemoteServiceReference. |
IRemoteServiceID |
getRemoteServiceID(ID containerID1,
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 target,
java.lang.String clazz,
java.lang.String filter)
Returns an array of IRemoteServiceReference objects. |
IRemoteResponseDeserializer |
getResponseDeserializer()
|
protected IRemoteResponseDeserializer |
getResponseDeserializer(IRemoteCall call,
IRemoteCallable callable,
java.util.Map responseHeaders)
|
protected void |
logException(java.lang.String string,
java.lang.Throwable e)
|
protected abstract java.lang.String |
prepareEndpointAddress(IRemoteCall call,
IRemoteCallable callable)
Prepare an endpoint address for the given call and callable. |
protected IRemoteCallParameter[] |
prepareParameters(java.lang.String uri,
IRemoteCall call,
IRemoteCallable callable)
|
protected java.lang.Object |
processResponse(java.lang.String uri,
IRemoteCall call,
IRemoteCallable callable,
java.util.Map responseHeaders,
byte[] responseBody)
|
IRemoteServiceRegistration |
registerCallables(IRemoteCallable[] callables,
java.util.Dictionary properties)
Register remoteCallables for remote service client. |
IRemoteServiceRegistration |
registerCallables(java.lang.String[] clazzes,
IRemoteCallable[][] callables,
java.util.Dictionary properties)
Register remoteCallables for given serviceInterfaceNames. |
IRemoteServiceRegistration |
registerRemoteService(java.lang.String[] clazzes,
java.lang.Object service,
java.util.Dictionary properties)
Register a new remote service. |
void |
removeRemoteServiceListener(IRemoteServiceListener listener)
Remove remote service registration/unregistration listener for this container. |
protected IRemoteCallParameter |
serializeParameter(java.lang.String uri,
IRemoteCall call,
IRemoteCallable callable,
IRemoteCallParameter defaultParameter,
java.lang.Object parameterValue)
Serialze the parameter using the container's parameterSerializer. |
protected IRemoteCallParameter[] |
serializeParameter(java.lang.String uri,
IRemoteCall call,
IRemoteCallable callable,
java.util.List currentParameters,
java.lang.Object[] parameterValue)
|
void |
setAlwaysSendDefaultParameters(boolean alwaysSendDefaultParameters)
Set the flag to true to include default parameters (which are specified when the callables are created) with
every request to the remote service. |
void |
setConnectContextForAuthentication(IConnectContext connectContext)
Set connect context for authentication upon subsequent calls to IRemoteServiceContainerAdapter.getRemoteServiceReferences(ID[], String, String) or IRemoteServiceContainerAdapter.asyncGetRemoteServiceReferences(ID[], String, String) . |
void |
setParameterSerializer(IRemoteCallParameterSerializer serializer)
Set the remote call parameter serializer. |
void |
setResponseDeserializer(IRemoteResponseDeserializer resource)
|
boolean |
ungetRemoteService(IRemoteServiceReference reference)
Unget IRemoteServiceReference. |
Methods inherited from class org.eclipse.ecf.core.AbstractContainer |
---|
addListener, fireContainerEvent, getAdapter, getPasswordFromConnectContext, removeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter |
---|
setRemoteServiceCallPolicy |
Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
---|
getAdapter |
Methods inherited from interface org.eclipse.ecf.core.IContainer |
---|
getConnectNamespace |
Field Detail |
---|
protected ID containerID
protected ID connectedID
protected java.lang.Object connectLock
protected IConnectContext connectContext
protected java.lang.Object remoteResponseDeserializerLock
protected IRemoteResponseDeserializer remoteResponseDeserializer
protected java.lang.Object parameterSerializerLock
protected IRemoteCallParameterSerializer parameterSerializer
protected RemoteServiceClientRegistry registry
protected java.util.List remoteServiceListeners
protected boolean alwaysSendDefaultParameters
Constructor Detail |
---|
public AbstractClientContainer(ID containerID)
Method Detail |
---|
public void setConnectContextForAuthentication(IConnectContext connectContext)
IRemoteServiceContainerAdapter
IRemoteServiceContainerAdapter.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 IRemoteServiceConsumer
setConnectContextForAuthentication
in interface IRemoteServiceContainerAdapter
connectContext
- the connect context to use for authenticating.
If null
, then no authentication will be
attempted.public IConnectContext getConnectContextForAuthentication()
public void setResponseDeserializer(IRemoteResponseDeserializer resource)
setResponseDeserializer
in interface IRemoteServiceClientContainerAdapter
public IRemoteResponseDeserializer getResponseDeserializer()
public void setParameterSerializer(IRemoteCallParameterSerializer serializer)
IRemoteServiceClientContainerAdapter
setParameterSerializer
in interface IRemoteServiceClientContainerAdapter
serializer
- the remote call parameter serializer to set for this container. May be null
.protected IRemoteCallParameterSerializer getParameterSerializer()
protected IRemoteResponseDeserializer getResponseDeserializer(IRemoteCall call, IRemoteCallable callable, java.util.Map responseHeaders)
protected IRemoteCallParameterSerializer getParameterSerializer(IRemoteCallParameter parameter, java.lang.Object value)
public void setAlwaysSendDefaultParameters(boolean alwaysSendDefaultParameters)
true
to include default parameters (which are specified when the callables are created) with
every request to the remote service.
Setting to false
will only send those parameter specified when the call is invoked.
Parameters which are specifed with the call override the defaults. Default parameters with a value of null
are not included.
alwaysSendDefaultParameters
- whether to send default parameters with every remote callpublic void addRemoteServiceListener(IRemoteServiceListener listener)
IRemoteServiceContainerAdapter
addRemoteServiceListener
in interface IRemoteServiceConsumer
addRemoteServiceListener
in interface IRemoteServiceContainerAdapter
addRemoteServiceListener
in interface IRemoteServiceHost
listener
- notified of service registration/unregistration events. Must
not be null
.public org.eclipse.equinox.concurrent.future.IFuture asyncGetRemoteServiceReferences(ID[] idFilter, java.lang.String clazz, java.lang.String filter)
IRemoteServiceContainerAdapter
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.
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 IRemoteServiceConsumer
asyncGetRemoteServiceReferences
in interface IRemoteServiceContainerAdapter
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)
IRemoteServiceContainerAdapter
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 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 IRemoteServiceConsumer
asyncGetRemoteServiceReferences
in interface IRemoteServiceContainerAdapter
target
- 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 org.eclipse.equinox.concurrent.future.IFuture asyncGetRemoteServiceReferences(ID target, ID[] idFilter, java.lang.String clazz, java.lang.String filter)
IRemoteServiceContainerAdapter
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 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 IRemoteServiceConsumer
asyncGetRemoteServiceReferences
in interface IRemoteServiceContainerAdapter
target
- 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 IRemoteFilter createRemoteFilter(java.lang.String filter) throws org.osgi.framework.InvalidSyntaxException
IRemoteServiceContainerAdapter
IRemoteFilter
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 IRemoteServiceConsumer
createRemoteFilter
in interface IRemoteServiceContainerAdapter
filter
- 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[] 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 IRemoteServiceConsumer
getAllRemoteServiceReferences
in interface IRemoteServiceContainerAdapter
clazz
- 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 IRemoteService getRemoteService(IRemoteServiceReference reference)
IRemoteServiceContainerAdapter
IRemoteServiceContainerAdapter.ungetRemoteService(IRemoteServiceReference)
when the IRemoteService will no longer be used.
getRemoteService
in interface IRemoteServiceConsumer
getRemoteService
in interface IRemoteServiceContainerAdapter
reference
- the IRemoteServiceReference for the desired service. Must not
be null
.
null
is
returned.IRemoteServiceContainerAdapter.ungetRemoteService(IRemoteServiceReference)
public IRemoteServiceID getRemoteServiceID(ID containerID1, long containerRelativeID)
IRemoteServiceContainerAdapter
null
if not.
getRemoteServiceID
in interface IRemoteServiceConsumer
getRemoteServiceID
in interface IRemoteServiceContainerAdapter
getRemoteServiceID
in interface IRemoteServiceHost
containerID1
- 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 Namespace getRemoteServiceNamespace()
IRemoteServiceContainerAdapter
getRemoteServiceNamespace
in interface IRemoteServiceConsumer
getRemoteServiceNamespace
in interface IRemoteServiceContainerAdapter
getRemoteServiceNamespace
in interface IRemoteServiceHost
null
.public IRemoteServiceReference getRemoteServiceReference(IRemoteServiceID serviceID)
IRemoteServiceContainerAdapter
getRemoteServiceReference
in interface IRemoteServiceConsumer
getRemoteServiceReference
in interface IRemoteServiceContainerAdapter
serviceID
- the serviceID to retrieve the IRemoteServiceReference for.
null
if no IRemoteServiceReference found for the given serviceID.public IRemoteServiceReference[] getRemoteServiceReferences(ID[] idFilter, java.lang.String clazz, java.lang.String filter) throws org.osgi.framework.InvalidSyntaxException
IRemoteServiceContainerAdapter
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.
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 IRemoteServiceConsumer
getRemoteServiceReferences
in interface IRemoteServiceContainerAdapter
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.public IRemoteServiceReference[] getRemoteServiceReferences(ID target, 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 IRemoteServiceConsumer
getRemoteServiceReferences
in interface IRemoteServiceContainerAdapter
target
- 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[] getRemoteServiceReferences(ID target, ID[] idFilter, java.lang.String clazz, java.lang.String filter) throws org.osgi.framework.InvalidSyntaxException, ContainerConnectException
IRemoteServiceContainerAdapter
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.
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 IRemoteServiceConsumer
getRemoteServiceReferences
in interface IRemoteServiceContainerAdapter
target
- 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 IRemoteServiceRegistration registerRemoteService(java.lang.String[] clazzes, java.lang.Object service, java.util.Dictionary properties)
IRemoteServiceContainerAdapter
registerRemoteService
in interface IRemoteServiceContainerAdapter
registerRemoteService
in interface IRemoteServiceHost
clazzes
- 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
null
null
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 void removeRemoteServiceListener(IRemoteServiceListener listener)
IRemoteServiceContainerAdapter
removeRemoteServiceListener
in interface IRemoteServiceConsumer
removeRemoteServiceListener
in interface IRemoteServiceContainerAdapter
removeRemoteServiceListener
in interface IRemoteServiceHost
listener
- to remove. Must not be null
.public boolean ungetRemoteService(IRemoteServiceReference reference)
IRemoteServiceContainerAdapter
IRemoteServiceContainerAdapter.getRemoteService(IRemoteServiceReference)
.
If this method returns true, then the previously used IRemoteService will
no longer be usable.
ungetRemoteService
in interface IRemoteServiceConsumer
ungetRemoteService
in interface IRemoteServiceContainerAdapter
reference
- the IRemoteServiceReference to unget
IRemoteServiceContainerAdapter.getRemoteService(IRemoteServiceReference)
public IRemoteServiceRegistration registerCallables(IRemoteCallable[] callables, java.util.Dictionary properties)
IRemoteServiceClientContainerAdapter
IRemoteCallable
instances, so that subsequent lookup operations result in appropriate remote service registrations.
registerCallables
in interface IRemoteServiceClientContainerAdapter
callables
- the IRemoteCallables to register. Each IRemoteCallable represents a specific method->resourcePath mapping.
Must not be null
.properties
- any service properties to associate with the given registration.
null
.public IRemoteServiceRegistration registerCallables(java.lang.String[] clazzes, IRemoteCallable[][] callables, java.util.Dictionary properties)
IRemoteServiceClientContainerAdapter
Register remoteCallables for given serviceInterfaceNames. This method allows providers to register IRemoteCallable
instances and associate an array of IRemoteCallables with each given serviceInterfaceName, so that subsequent lookup operations result in
appropriate remote service registrations. The IRemoteCallable instances should correspond to methods within the
particular service interface class.
Note that the number of serviceInterfaceNames (i.e. the length of the given String[]) must be equal to the number of rows of the remoteCallable two-dimensional array.
For example, suppose we have a service interface "org.eclipse.ecf.IFoo":
public interface IFoo { public String getFoo(); }We can define for this service inteface the following two dimensional array of callables:
IRemoteCallable[][] callables = new IRemoteCallable[] { new RemoteCallable("foo","foo/bar/resourcePath",null,requestType) }};and then register with this method:
IRemoteServiceRegistration reg = this.registerRemoteCallable(new String[] { "org.eclipse.ecf.IFoo" }, callables, null);
registerCallables
in interface IRemoteServiceClientContainerAdapter
callables
- the IRemoteCallables to register. Each IRemoteCallable represents a specific method->resourcePath mapping.
Must not be null
.properties
- any service properties to associate with the given registration.
null
.public void connect(ID targetID, IConnectContext connectContext1) throws ContainerConnectException
IContainer
connect
in interface IContainer
targetID
- the ID of the remote server or group to connect to. See
IContainer.getConnectNamespace()
for a explanation of the
constraints upon this parameter.connectContext1
- any required context to allow this container to authenticate.
May be null
if underlying provider does not
have any authentication requirements for connection.
ContainerConnectException
- thrown if communication cannot be established with remote
service. Causes can include network connection failure,
authentication failure, server error, or if container is
already connected.public void disconnect()
IContainer
null
.
disconnect
in interface IContainer
public ID getConnectedID()
IContainer
getConnectedID
in interface IContainer
null
if container not connected.public ID getID()
IIdentifiable
null
.
getID
in interface IIdentifiable
null
.public void dispose()
IContainer
dispose
in interface IContainer
dispose
in class AbstractContainer
protected RemoteServiceClientRegistration createRestServiceRegistration(java.lang.String[] clazzes, IRemoteCallable[][] callables, java.util.Dictionary properties)
protected RemoteServiceClientRegistration createRestServiceRegistration(IRemoteCallable[] callables, java.util.Dictionary properties)
protected void logException(java.lang.String string, java.lang.Throwable e)
protected ID getRemoteCallTargetID()
protected IRemoteCallParameter[] prepareParameters(java.lang.String uri, IRemoteCall call, IRemoteCallable callable) throws java.io.NotSerializableException
java.io.NotSerializableException
protected IRemoteCallParameter serializeParameter(java.lang.String uri, IRemoteCall call, IRemoteCallable callable, IRemoteCallParameter defaultParameter, java.lang.Object parameterValue) throws java.io.NotSerializableException
java.io.NotSerializableException
IRemoteCallParameterSerializer.serializeParameter(String, IRemoteCall, IRemoteCallable, IRemoteCallParameter, Object)
protected IRemoteCallParameter[] serializeParameter(java.lang.String uri, IRemoteCall call, IRemoteCallable callable, java.util.List currentParameters, java.lang.Object[] parameterValue) throws java.io.NotSerializableException
java.io.NotSerializableException
protected java.lang.Object processResponse(java.lang.String uri, IRemoteCall call, IRemoteCallable callable, java.util.Map responseHeaders, byte[] responseBody) throws java.io.NotSerializableException
java.io.NotSerializableException
protected abstract IRemoteService createRemoteService(RemoteServiceClientRegistration registration)
IRemoteService
for the given registration.
registration
- registration from which to create the associated IRemoteService. Will not be null
.
null
.protected abstract java.lang.String prepareEndpointAddress(IRemoteCall call, IRemoteCallable callable)
call
- to create an endpoint for. Will not be null
.callable
- to create an endpoing for. Will not be null
.
null
if the
given call should not be completed (i.e. there is no endpoint associated with the given call).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |