public class CompositeDiscoveryContainer extends AbstractDiscoveryContainerAdapter implements IDiscoveryService
Modifier and Type | Class and Description |
---|---|
protected class |
CompositeDiscoveryContainer.CompositeContainerServiceListener |
protected class |
CompositeDiscoveryContainer.CompositeContainerServiceTypeListener |
static class |
CompositeDiscoveryContainer.CompositeServiceInfoWrapper |
Modifier and Type | Field and Description |
---|---|
protected CompositeDiscoveryContainer.CompositeContainerServiceListener |
ccsl |
protected CompositeDiscoveryContainer.CompositeContainerServiceTypeListener |
ccstl |
protected Collection |
containers |
protected static String |
METHODS_CATCHING |
protected static String |
METHODS_TRACING |
static String |
NAME |
protected Set |
registeredServices
History of services registered with this IDCA
Used on newly added IDCAs
|
allServiceListeners, serviceListeners, servicesNamespaceName, serviceTypeListeners
CONTAINER_ID, CONTAINER_NAME
Constructor and Description |
---|
CompositeDiscoveryContainer(Collection containers) |
Modifier and Type | Method and Description |
---|---|
boolean |
addContainer(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.
|
String |
getContainerName() |
Collection |
getDiscoveryContainers() |
protected IServiceEvent |
getServiceEvent(IServiceInfo iServiceInfo,
ID id) |
IServiceInfo |
getServiceInfo(IServiceID aService)
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
|
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.
|
boolean |
removeContainer(Object object) |
void |
unregisterAllServices()
Unregister all previously registered service.
|
void |
unregisterService(IServiceInfo serviceInfo)
Unregister a previously registered service defined by serviceInfo.
|
addServiceListener, addServiceListener, addServiceTypeListener, clearListeners, fireServiceDiscovered, fireServiceTypeDiscovered, fireServiceUndiscovered, getAsyncServiceInfo, getAsyncServices, getAsyncServices, getAsyncServiceTypes, getConfig, getConnectNamespace, getID, getListeners, getServicesNamespace, removeServiceListener, removeServiceListener, removeServiceTypeListener
addListener, fireContainerEvent, getAdapter, getPasswordFromConnectContext, removeListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addServiceListener, addServiceListener, addServiceTypeListener, getAsyncServiceInfo, getAsyncServices, getAsyncServices, getAsyncServiceTypes, getServicesNamespace, removeServiceListener, removeServiceListener, removeServiceTypeListener
getServicesNamespace
public static final String NAME
protected static final String METHODS_CATCHING
protected static final String METHODS_TRACING
protected final CompositeDiscoveryContainer.CompositeContainerServiceListener ccsl
protected final CompositeDiscoveryContainer.CompositeContainerServiceTypeListener ccstl
protected Set registeredServices
protected final Collection containers
public CompositeDiscoveryContainer(Collection containers)
containers
- public void connect(ID aTargetID, IConnectContext connectContext) throws ContainerConnectException
IContainer
connect
in interface IContainer
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.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
protected IServiceEvent getServiceEvent(IServiceInfo iServiceInfo, ID id)
getServiceEvent
in class AbstractDiscoveryContainerAdapter
iServiceInfo
- service infoid
- idpublic void dispose()
IContainer
dispose
in interface IContainer
dispose
in class AbstractDiscoveryContainerAdapter
public ID getConnectedID()
IContainer
getConnectedID
in interface IContainer
null
if container not connected.public IServiceInfo getServiceInfo(IServiceID aService)
IDiscoveryLocator
getServiceInfo
in interface IDiscoveryLocator
aService
- IServiceID of the service to get info about. Must not be
null
.null
if no
information retrievable.public IServiceInfo[] getServices()
IDiscoveryLocator
getServices
in interface IDiscoveryLocator
null
. May be of length 0.public IServiceInfo[] getServices(IServiceTypeID type)
IDiscoveryLocator
getServices
in interface IDiscoveryLocator
type
- 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 IServiceTypeID[] getServiceTypes()
IDiscoveryLocator
getServiceTypes
in interface IDiscoveryLocator
null
. May be of length 0.public void registerService(IServiceInfo serviceInfo)
IDiscoveryAdvertiser
registerService
in interface IDiscoveryAdvertiser
serviceInfo
- IServiceInfo of the service to be published. 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 unregisterAllServices()
IDiscoveryAdvertiser
unregisterAllServices
in interface IDiscoveryAdvertiser
unregisterAllServices
in class AbstractDiscoveryContainerAdapter
IDiscoveryAdvertiser.unregisterAllServices()
public IServiceInfo[] purgeCache()
IDiscoveryLocator
purgeCache
in interface IDiscoveryLocator
purgeCache
in class AbstractDiscoveryContainerAdapter
IDiscoveryLocator.purgeCache()
public boolean addContainer(Object object)
object
- List.add(java.lang.Object)
public boolean removeContainer(Object object)
object
- List.remove(java.lang.Object)
public Collection getDiscoveryContainers()
public String getContainerName()
getContainerName
in class AbstractDiscoveryContainerAdapter
Copyright © 2017. All rights reserved.