|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.ecf.provider.discovery.SingletonDiscoveryContainer
public class SingletonDiscoveryContainer
| Field Summary |
|---|
| Fields inherited from interface org.eclipse.ecf.discovery.IDiscoveryContainerAdapter |
|---|
CONTAINER_CONNECT_REQUIRES_PASSWORD, CONTAINER_CONNECT_TARGET, CONTAINER_CONNECT_TARGET_PATH, CONTAINER_CONNECT_TARGET_PROTOCOL, CONTAINER_FACTORY_NAME_PROPERTY |
| 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. |
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 |
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 |
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 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()
IContainer
dispose in interface IContainerpublic java.lang.Object getAdapter(java.lang.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 up
null if this container does not support the given
service
public void addServiceListener(IServiceTypeID type,
IServiceListener listener)
IDiscoveryContainerAdapter
addServiceListener in interface IDiscoveryContainerAdaptertype - 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)
IDiscoveryContainerAdapter
addServiceTypeListener in interface IDiscoveryContainerAdapterlistener - the listener to be notified. Must not be null.public IServiceInfo getServiceInfo(IServiceID service)
IDiscoveryContainerAdapter
getServiceInfo in interface IDiscoveryContainerAdapterservice - IServiceID of the service to get info about. Must not be
null.
null if
no information retrievable.public IServiceInfo[] getServices(IServiceTypeID type)
IDiscoveryContainerAdapter
getServices in interface IDiscoveryContainerAdaptertype - IServiceTypeID defining the type of service we are interested in
getting service info about. Must not be null
null. May be of length 0.public Namespace getServicesNamespace()
IDiscoveryContainerAdapterServiceIDFactory to create IServiceIDs rather than simple IDs. For example:
IServiceID serviceID = ServiceIDFactory.getDefault().createServiceID(container.getServicesNamespace(),serviceType,serviceName);
getServicesNamespace in interface IDiscoveryContainerAdapternull.
public void registerService(IServiceInfo serviceInfo)
throws ECFException
IDiscoveryContainerAdapter
registerService in interface IDiscoveryContainerAdapterserviceInfo - IServiceInfo of the service to be published. Must not be
null.
ECFException - if service info cannot be registered with this service
public void removeServiceListener(IServiceTypeID type,
IServiceListener listener)
IDiscoveryContainerAdapter
removeServiceListener in interface IDiscoveryContainerAdaptertype - 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)
IDiscoveryContainerAdapter
removeServiceTypeListener in interface IDiscoveryContainerAdapterlistener - IServiceTypeListener to be removed. Must not be
null.
public void unregisterService(IServiceInfo serviceInfo)
throws ECFException
IDiscoveryContainerAdapter
unregisterService in interface IDiscoveryContainerAdapterserviceInfo - IServiceInfo defining the service to unregister. Must not be
null.
ECFException - if service info cannot be unregistered with this servicepublic 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()
IContainer
getConnectedID 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)
IContainer
removeListener in interface IContainerlistener - the IContainerListener to removepublic IServiceInfo[] getServices()
IDiscoveryContainerAdapter
getServices in interface IDiscoveryContainerAdapternull. May be of length 0.public IServiceTypeID[] getServiceTypes()
IDiscoveryContainerAdapter
getServiceTypes in interface IDiscoveryContainerAdapternull. May be of length 0.public void addServiceListener(IServiceListener listener)
IDiscoveryContainerAdapter
addServiceListener in interface IDiscoveryContainerAdapterlistener - IServiceListener to be notified. Must not be null.public void removeServiceListener(IServiceListener listener)
IDiscoveryContainerAdapter
removeServiceListener in interface IDiscoveryContainerAdapterlistener - IServiceListener listener to be removed. Must not be
null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||