public abstract class AbstractRSAContainer extends AbstractContainer
Constructor and Description |
---|
AbstractRSAContainer(ID id) |
Modifier and Type | Method and Description |
---|---|
void |
connect(ID targetID,
IConnectContext connectContext)
Connect to a target remote process or process group.
|
protected RSARemoteServiceContainerAdapter |
createContainerAdapter() |
void |
disconnect()
Disconnect.
|
protected abstract java.util.Map<java.lang.String,java.lang.Object> |
exportRemoteService(RSARemoteServiceContainerAdapter.RSARemoteServiceRegistration registration)
Export an endpoint specified by the RSARemoteServiceRegistration.
|
java.lang.Object |
getAdapter(java.lang.Class serviceType)
This specialization of IAdaptable.getAdapter() returns additional
services supported by this container.
|
ID |
getConnectedID()
Get the target ID that this container instance has connected to.
|
Namespace |
getConnectNamespace()
Get the Namespace for creating a targetID suitable for use as the first
parameter in subsequent calls to
IContainer.connect(ID, IConnectContext) . |
ID |
getID()
Return the ID for this 'identifiable' object.
|
protected abstract void |
unexportRemoteService(RSARemoteServiceContainerAdapter.RSARemoteServiceRegistration registration)
Unregister the endpoint for the given RSARemoteServiceRegistration.
|
addListener, dispose, fireContainerEvent, getPasswordFromConnectContext, removeListener
public AbstractRSAContainer(ID id)
protected abstract java.util.Map<java.lang.String,java.lang.Object> exportRemoteService(RSARemoteServiceContainerAdapter.RSARemoteServiceRegistration registration)
registration
- the RSARemoteServiceRegistration that is being registered. Will not
be null
.null
, in which case no properties will be overridden or added.protected abstract void unexportRemoteService(RSARemoteServiceContainerAdapter.RSARemoteServiceRegistration registration)
registration
- the registration identifying the remote service to unregister. Will not
be null
.protected RSARemoteServiceContainerAdapter createContainerAdapter()
public void connect(ID targetID, IConnectContext connectContext) throws ContainerConnectException
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.connectContext
- 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 ID getConnectedID()
IContainer
null
if container not connected.public Namespace getConnectNamespace()
IContainer
IContainer.connect(ID, IConnectContext)
.
If this method returns null
, then it means that
null
is expected as a valid parameter in subsequent calls
to IContainer.connect(ID, IConnectContext)
. If this method returns a non-null
Namespace, then the targetID
parameter in
IContainer.connect(ID, IConnectContext)
must be non-null
instance created of the returned Namespace.IContainer.connect(ID, IConnectContext)
. If null
,
then the targetID
instances passed to
IContainer.connect(ID, IConnectContext)
may be null
.
If not null
, then targetID
instances passed to IContainer.connect(ID, IConnectContext)
must be
instances of the returned Namespace.public void disconnect()
IContainer
null
.public ID getID()
IIdentifiable
null
.null
.public java.lang.Object getAdapter(java.lang.Class serviceType)
IContainer
IContainer
should return them using this method. It is recommended that clients use
this method rather than instanceof checks and downcasts to find out about
the capabilities of a specific container.
Typically, after obtaining an IContainer, a client would use this method as a means to obtain a more meaningful interface to the container. This interface may or may not extend IContainer. For example, a client could use the following code to obtain an instance of ISharedObjectContainer:
IContainer newContainer = ContainerFactory.createContainer(type); ISharedObjectContainer soContainer = (ISharedObjectContainer) newContainer .getAdapter(ISharedObjectContainer.class); if (soContainer == null) throw new ContainerCreateException(message);
Implementations of this method should delegate to
IAdapterManager.loadAdapter()
if the service
cannot be provided directly to ensure extensibility by third-party
plug-ins.
getAdapter
in interface org.eclipse.core.runtime.IAdaptable
getAdapter
in interface IContainer
getAdapter
in class AbstractContainer
serviceType
- the service type to look upnull
if this container does not support the given
service