|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.ecf.provider.discovery.SingletonDiscoveryContainer
public class SingletonDiscoveryContainer
Field Summary |
---|
Fields inherited from interface org.eclipse.ecf.discovery.IDiscoveryLocator |
---|
CONTAINER_NAME |
Fields inherited from interface org.eclipse.ecf.discovery.IDiscoveryAdvertiser |
---|
CONTAINER_NAME |
Constructor Summary | |
---|---|
SingletonDiscoveryContainer(IContainer container)
|
Method Summary | |
---|---|
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. |
java.lang.Object |
getAdapter(java.lang.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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SingletonDiscoveryContainer(IContainer container)
container
- Method Detail |
---|
public void connect(ID targetID, IConnectContext connectContext) 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.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()
IContainer
null
.
disconnect
in interface IContainer
public void dispose()
IContainer
dispose
in interface IContainer
public java.lang.Object getAdapter(java.lang.Class adapter)
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
adapter
- the service type to look up
null
if this container does not support the given
servicepublic void addServiceListener(IServiceTypeID type, IServiceListener listener)
IDiscoveryLocator
addServiceListener
in interface IDiscoveryLocator
type
- 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)
IDiscoveryLocator
addServiceTypeListener
in interface IDiscoveryLocator
listener
- the listener to be notified. Must not be null
.public IServiceInfo getServiceInfo(IServiceID service)
IDiscoveryLocator
getServiceInfo
in interface IDiscoveryLocator
null
if no
information retrievable.public IServiceInfo[] getServices(IServiceTypeID type)
IDiscoveryLocator
getServices
in interface IDiscoveryLocator
null
. May be of length 0.public Namespace getServicesNamespace()
IDiscoveryAdvertiser
IServiceID serviceID = ServiceIDFactory.getDefault().createServiceID( container.getServicesNamespace(), serviceType, serviceName);
getServicesNamespace
in interface IDiscoveryAdvertiser
getServicesNamespace
in interface IDiscoveryLocator
null
.public void registerService(IServiceInfo serviceInfo)
IDiscoveryAdvertiser
registerService
in interface IDiscoveryAdvertiser
serviceInfo
- IServiceInfo of the service to be published. Must not be
null
.public void removeServiceListener(IServiceTypeID type, IServiceListener listener)
IDiscoveryLocator
removeServiceListener
in interface IDiscoveryLocator
type
- 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)
IDiscoveryLocator
removeServiceTypeListener
in interface IDiscoveryLocator
listener
- IServiceTypeListener to be removed. Must not be
null
.public void unregisterService(IServiceInfo serviceInfo)
IDiscoveryAdvertiser
unregisterService
in interface IDiscoveryAdvertiser
serviceInfo
- 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 IContainer
listener
- the IContainerListener to addpublic ID getConnectedID()
IContainer
getConnectedID
in interface 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.
getConnectNamespace
in interface IContainer
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 ID getID()
IIdentifiable
null
.
getID
in interface IIdentifiable
null
.public void removeListener(IContainerListener listener)
IContainer
removeListener
in interface IContainer
listener
- the IContainerListener to removepublic IServiceInfo[] getServices()
IDiscoveryLocator
getServices
in interface IDiscoveryLocator
null
. May be of length 0.public IServiceTypeID[] getServiceTypes()
IDiscoveryLocator
getServiceTypes
in interface IDiscoveryLocator
null
. May be of length 0.public void addServiceListener(IServiceListener listener)
IDiscoveryLocator
addServiceListener
in interface IDiscoveryLocator
listener
- IServiceListener to be notified. Must not be null
.public void removeServiceListener(IServiceListener listener)
IDiscoveryLocator
removeServiceListener
in interface IDiscoveryLocator
listener
- IServiceListener listener to be removed. Must not be
null
.public IServiceInfo[] purgeCache()
IDiscoveryLocator
purgeCache
in interface IDiscoveryLocator
public org.eclipse.equinox.concurrent.future.IFuture getAsyncServiceInfo(IServiceID aServiceID)
IDiscoveryLocator
getAsyncServiceInfo
in interface IDiscoveryLocator
null
if no information retrievable.public org.eclipse.equinox.concurrent.future.IFuture getAsyncServiceTypes()
IDiscoveryLocator
getAsyncServiceTypes
in interface IDiscoveryLocator
null
. May be of length
0.public org.eclipse.equinox.concurrent.future.IFuture getAsyncServices()
IDiscoveryLocator
getAsyncServices
in interface IDiscoveryLocator
null
. May be of length
0.public org.eclipse.equinox.concurrent.future.IFuture getAsyncServices(IServiceTypeID aServiceTypeID)
IDiscoveryLocator
getAsyncServices
in interface IDiscoveryLocator
null
. May be of length
0.public void unregisterAllServices()
IDiscoveryAdvertiser
unregisterAllServices
in interface IDiscoveryAdvertiser
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |