org.eclipse.ecf.provider.discovery
Class CompositeDiscoveryContainer

java.lang.Object
  extended by org.eclipse.ecf.core.AbstractContainer
      extended by org.eclipse.ecf.discovery.AbstractDiscoveryContainerAdapter
          extended by org.eclipse.ecf.provider.discovery.CompositeDiscoveryContainer
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, IContainer, IIdentifiable, org.eclipse.ecf.discovery.IDiscoveryAdvertiser, IDiscoveryContainerAdapter, org.eclipse.ecf.discovery.IDiscoveryLocator, IDiscoveryService

public class CompositeDiscoveryContainer
extends AbstractDiscoveryContainerAdapter
implements IDiscoveryService


Nested Class Summary
protected  class CompositeDiscoveryContainer.CompositeContainerServiceListener
           
protected  class CompositeDiscoveryContainer.CompositeContainerServiceTypeListener
           
 
Field Summary
protected  CompositeDiscoveryContainer.CompositeContainerServiceListener ccsl
           
protected  CompositeDiscoveryContainer.CompositeContainerServiceTypeListener ccstl
           
protected  java.util.Collection containers
           
protected static java.lang.String METHODS_CATCHING
           
protected static java.lang.String METHODS_TRACING
           
static java.lang.String NAME
           
protected  java.util.Set registeredServices
          History of services registered with this IDCA Used on newly added IDCAs
 
Fields inherited from class org.eclipse.ecf.discovery.AbstractDiscoveryContainerAdapter
allServiceListeners, serviceListeners, servicesNamespaceName, serviceTypeListeners
 
Fields inherited from interface org.eclipse.ecf.discovery.service.IDiscoveryService
CONTAINER_ID, CONTAINER_NAME
 
Constructor Summary
CompositeDiscoveryContainer(java.util.Collection containers)
           
 
Method Summary
 boolean addContainer(java.lang.Object object)
           
 void connect(ID aTargetID, IConnectContext connectContext)
          Connect to a target remote process or process group.
 void disconnect()
          Disconnect.
 void dispose()
          Dispose this IContainer instance.
 ID getConnectedID()
          Get the target ID that this container instance has connected to.
 java.util.Collection getDiscoveryContainers()
           
 IServiceInfo getServiceInfo(IServiceID aService)
           
 IServiceInfo[] getServices()
           
 IServiceInfo[] getServices(IServiceTypeID type)
           
 IServiceTypeID[] getServiceTypes()
           
 IServiceInfo[] purgeCache()
           
 void registerService(IServiceInfo serviceInfo)
           
 boolean removeContainer(java.lang.Object object)
           
 void unregisterAllServices()
           
 void unregisterService(IServiceInfo serviceInfo)
           
 
Methods inherited from class org.eclipse.ecf.discovery.AbstractDiscoveryContainerAdapter
addServiceListener, addServiceListener, addServiceTypeListener, clearListeners, fireServiceDiscovered, fireServiceTypeDiscovered, fireServiceUndiscovered, getAsyncServiceInfo, getAsyncServices, getAsyncServices, getAsyncServiceTypes, getConfig, getConnectNamespace, getID, getListeners, getServicesNamespace, removeServiceListener, removeServiceListener, removeServiceTypeListener
 
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.discovery.IDiscoveryLocator
addServiceListener, addServiceListener, addServiceTypeListener, getAsyncServiceInfo, getAsyncServices, getAsyncServices, getAsyncServiceTypes, getServicesNamespace, removeServiceListener, removeServiceListener, removeServiceTypeListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.ecf.discovery.IDiscoveryAdvertiser
getServicesNamespace
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values

METHODS_CATCHING

protected static final java.lang.String METHODS_CATCHING
See Also:
Constant Field Values

METHODS_TRACING

protected static final java.lang.String METHODS_TRACING
See Also:
Constant Field Values

ccsl

protected final CompositeDiscoveryContainer.CompositeContainerServiceListener ccsl

ccstl

protected final CompositeDiscoveryContainer.CompositeContainerServiceTypeListener ccstl

registeredServices

protected java.util.Set registeredServices
History of services registered with this IDCA Used on newly added IDCAs


containers

protected final java.util.Collection containers
Constructor Detail

CompositeDiscoveryContainer

public CompositeDiscoveryContainer(java.util.Collection containers)
Parameters:
containers -
Method Detail

connect

public void connect(ID aTargetID,
                    IConnectContext connectContext)
             throws ContainerConnectException
Description copied from interface: IContainer
Connect to a target remote process or process group. The target identified by the first parameter (targetID) is connected the implementation class. If authentication information is required, the required information is given via via the second parameter (connectContext). Callers note that depending upon the provider implementation this method may block. It is suggested that callers use a separate thread to call this method. This method provides an implementation independent way for container implementations to connect, authenticate, and communicate with a remote service or group of services. Providers are responsible for implementing this operation in a way appropriate to the given remote service (or group) via expected protocol.

Specified by:
connect in interface IContainer
Parameters:
aTargetID - 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.
Throws:
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.

disconnect

public void disconnect()
Description copied from interface: IContainer
Disconnect. This operation will disconnect the local container instance from any previously joined target or group. Subsequent calls to getConnectedID() will return null.

Specified by:
disconnect in interface IContainer

dispose

public void dispose()
Description copied from interface: IContainer
Dispose this IContainer instance. The container instance will be made inactive after the completion of this method and will be unavailable for subsequent usage.

Specified by:
dispose in interface IContainer
Overrides:
dispose in class AbstractDiscoveryContainerAdapter

getConnectedID

public ID getConnectedID()
Description copied from interface: IContainer
Get the target ID that this container instance has connected to. Returns null if not connected.

Specified by:
getConnectedID in interface IContainer
Returns:
ID of the target we are connected to. Returns null if container not connected.

getServiceInfo

public IServiceInfo getServiceInfo(IServiceID aService)
Specified by:
getServiceInfo in interface org.eclipse.ecf.discovery.IDiscoveryLocator

getServices

public IServiceInfo[] getServices()
Specified by:
getServices in interface org.eclipse.ecf.discovery.IDiscoveryLocator

getServices

public IServiceInfo[] getServices(IServiceTypeID type)
Specified by:
getServices in interface org.eclipse.ecf.discovery.IDiscoveryLocator

getServiceTypes

public IServiceTypeID[] getServiceTypes()
Specified by:
getServiceTypes in interface org.eclipse.ecf.discovery.IDiscoveryLocator

registerService

public void registerService(IServiceInfo serviceInfo)
Specified by:
registerService in interface org.eclipse.ecf.discovery.IDiscoveryAdvertiser

unregisterService

public void unregisterService(IServiceInfo serviceInfo)
Specified by:
unregisterService in interface org.eclipse.ecf.discovery.IDiscoveryAdvertiser

unregisterAllServices

public void unregisterAllServices()
Specified by:
unregisterAllServices in interface org.eclipse.ecf.discovery.IDiscoveryAdvertiser
Overrides:
unregisterAllServices in class AbstractDiscoveryContainerAdapter
See Also:
IDiscoveryAdvertiser.unregisterAllServices()

purgeCache

public IServiceInfo[] purgeCache()
Specified by:
purgeCache in interface org.eclipse.ecf.discovery.IDiscoveryLocator
Overrides:
purgeCache in class AbstractDiscoveryContainerAdapter
See Also:
IDiscoveryLocator.purgeCache()

addContainer

public boolean addContainer(java.lang.Object object)
Parameters:
object -
Returns:
true on success
See Also:
List.add(java.lang.Object)

removeContainer

public boolean removeContainer(java.lang.Object object)
Parameters:
object -
Returns:
true on success
See Also:
List.remove(java.lang.Object)

getDiscoveryContainers

public java.util.Collection getDiscoveryContainers()
Returns:
The List of currently registered containers.
Since:
2.1