public class SingletonDiscoveryContainer extends Object implements IDiscoveryContainerAdapter, IContainer
CONTAINER_NAMECONTAINER_NAME| Constructor and Description |
|---|
SingletonDiscoveryContainer(IContainer container) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(IContainerListener listener)
Add listener to IContainer.
|
void |
addServiceListener(IServiceListener listener)
Add a service listener.
|
void |
addServiceListener(IServiceTypeID type,
IServiceListener listener)
Add a service listener.
|
void |
addServiceTypeListener(IServiceTypeListener listener)
Add a service type listener.
|
void |
connect(ID targetID,
IConnectContext connectContext)
Connect to a target remote process or process group.
|
void |
disconnect()
Disconnect.
|
void |
dispose()
Dispose this IContainer instance.
|
Object |
getAdapter(Class adapter)
This specialization of IAdaptable.getAdapter() returns additional
services supported by this container.
|
org.eclipse.equinox.concurrent.future.IFuture |
getAsyncServiceInfo(IServiceID aServiceID)
Asynchronously retrieve info about the service
|
org.eclipse.equinox.concurrent.future.IFuture |
getAsyncServices()
Asynchronously get service info about all known services
|
org.eclipse.equinox.concurrent.future.IFuture |
getAsyncServices(IServiceTypeID aServiceTypeID)
Asynchronously get service info about all known services of given service
type
|
org.eclipse.equinox.concurrent.future.IFuture |
getAsyncServiceTypes()
Asynchronously get service info about all known services of given service
type
|
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.
|
IServiceInfo |
getServiceInfo(IServiceID service)
Synchronously retrieve info about the service
|
IServiceInfo[] |
getServices()
Synchronously get service info about all known services
|
IServiceInfo[] |
getServices(IServiceTypeID type)
Synchronously get service info about all known services of given service
type
|
Namespace |
getServicesNamespace()
Get a Namespace for services associated with this discovery container
adapter.
|
IServiceTypeID[] |
getServiceTypes()
Synchronously get service info about all known services of given service
type
|
IServiceInfo[] |
purgeCache()
Purges the underlying IServiceInfo cache if available in the current
provider
|
void |
registerService(IServiceInfo serviceInfo)
Register the given service.
|
void |
removeListener(IContainerListener listener)
Remove listener from IContainer.
|
void |
removeServiceListener(IServiceListener listener)
Remove a service listener.
|
void |
removeServiceListener(IServiceTypeID type,
IServiceListener listener)
Remove a service listener.
|
void |
removeServiceTypeListener(IServiceTypeListener listener)
Remove a service type listener.
|
void |
unregisterAllServices()
Unregister all previously registered service.
|
void |
unregisterService(IServiceInfo serviceInfo)
Unregister a previously registered service defined by serviceInfo.
|
public SingletonDiscoveryContainer(IContainer container)
container - public void connect(ID targetID, IConnectContext connectContext) throws ContainerConnectException
IContainerconnect in interface IContainertargetID - 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 void disconnect()
IContainernull.disconnect in interface IContainerpublic void dispose()
IContainerdispose in interface IContainerpublic Object getAdapter(Class adapter)
IContainerIContainer
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.IAdaptablegetAdapter in interface IContaineradapter - the service type to look upnull if this container does not support the given
servicepublic void addServiceListener(IServiceTypeID type, IServiceListener listener)
IDiscoveryLocatoraddServiceListener in interface IDiscoveryLocatortype - String type to listen for. Must not be null. Must
be formatted according to this specific IDiscoveryContainerlistener - IServiceListener to be notified. Must not be null
.public void addServiceTypeListener(IServiceTypeListener listener)
IDiscoveryLocatoraddServiceTypeListener in interface IDiscoveryLocatorlistener - the listener to be notified. Must not be null.public IServiceInfo getServiceInfo(IServiceID service)
IDiscoveryLocatorgetServiceInfo in interface IDiscoveryLocatorservice - IServiceID of the service to get info about. Must not be
null.null if no
information retrievable.public IServiceInfo[] getServices(IServiceTypeID type)
IDiscoveryLocatorgetServices in interface IDiscoveryLocatortype - IServiceTypeID defining the type of service we are interested
in getting service info about. Must not be nullnull. May be of length 0.public Namespace getServicesNamespace()
IDiscoveryLocator
IServiceID serviceID = ServiceIDFactory.getDefault().createServiceID(container.getServicesNamespace(),
serviceType, serviceName);
getServicesNamespace in interface IDiscoveryAdvertisergetServicesNamespace in interface IDiscoveryLocatornull
.public void registerService(IServiceInfo serviceInfo)
IDiscoveryAdvertiserregisterService in interface IDiscoveryAdvertiserserviceInfo - IServiceInfo of the service to be published. Must not be
null.public void removeServiceListener(IServiceTypeID type, IServiceListener listener)
IDiscoveryLocatorremoveServiceListener in interface IDiscoveryLocatortype - String of the desired type to remove the listener. Must not be
null. Must be formatted according to this
specific IDiscoveryContainerlistener - IServiceListener listener to be removed. Must not be
null.public void removeServiceTypeListener(IServiceTypeListener listener)
IDiscoveryLocatorremoveServiceTypeListener in interface IDiscoveryLocatorlistener - IServiceTypeListener to be removed. Must not be
null.public void unregisterService(IServiceInfo serviceInfo)
IDiscoveryAdvertiserunregisterService in interface IDiscoveryAdvertiserserviceInfo - IServiceInfo defining the service to unregister. Must not be
null.public void addListener(IContainerListener listener)
IContainer| container action | Event |
| connect start | IContainerConnectingEvent |
| connect complete | IContainerConnectedEvent |
| disconnect start | IContainerDisconnectingEvent |
| disconnect complete | IContainerDisconnectedEvent |
addListener in interface IContainerlistener - the IContainerListener to addpublic ID getConnectedID()
IContainergetConnectedID in interface IContainernull
if container not connected.public Namespace getConnectNamespace()
IContainerIContainer.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.getConnectNamespace in interface IContainerIContainer.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 ID getID()
IIdentifiablenull.getID in interface IIdentifiablenull.public void removeListener(IContainerListener listener)
IContainerremoveListener in interface IContainerlistener - the IContainerListener to removepublic IServiceInfo[] getServices()
IDiscoveryLocatorgetServices in interface IDiscoveryLocatornull. May be of length 0.public IServiceTypeID[] getServiceTypes()
IDiscoveryLocatorgetServiceTypes in interface IDiscoveryLocatornull. May be of length 0.public void addServiceListener(IServiceListener listener)
IDiscoveryLocatoraddServiceListener in interface IDiscoveryLocatorlistener - IServiceListener to be notified. Must not be null
.public void removeServiceListener(IServiceListener listener)
IDiscoveryLocatorremoveServiceListener in interface IDiscoveryLocatorlistener - IServiceListener listener to be removed. Must not be
null.public IServiceInfo[] purgeCache()
IDiscoveryLocatorpurgeCache in interface IDiscoveryLocatorpublic org.eclipse.equinox.concurrent.future.IFuture getAsyncServiceInfo(IServiceID aServiceID)
IDiscoveryLocatorgetAsyncServiceInfo in interface IDiscoveryLocatoraServiceID - IServiceID of the service to get info about. Must not be
null.null if no information retrievable.public org.eclipse.equinox.concurrent.future.IFuture getAsyncServiceTypes()
IDiscoveryLocatorgetAsyncServiceTypes in interface IDiscoveryLocatornull. May be of length
0.public org.eclipse.equinox.concurrent.future.IFuture getAsyncServices()
IDiscoveryLocatorgetAsyncServices in interface IDiscoveryLocatornull. May be of length
0.public org.eclipse.equinox.concurrent.future.IFuture getAsyncServices(IServiceTypeID aServiceTypeID)
IDiscoveryLocatorgetAsyncServices in interface IDiscoveryLocatoraServiceTypeID - IServiceTypeID defining the type of service we are interested
in getting service info about. Must not be nullnull. May be of length
0.public void unregisterAllServices()
IDiscoveryAdvertiserunregisterAllServices in interface IDiscoveryAdvertiserCopyright © 2017 Eclipse Foundation. All rights reserved.