public abstract class AbstractDiscoveryContainerAdapter extends AbstractContainer implements IDiscoveryLocator, IDiscoveryAdvertiser
| Modifier and Type | Field and Description |
|---|---|
protected Set |
allServiceListeners
Collection of service listeners.
|
protected Map |
serviceListeners
Map of service type to collection of service listeners.
|
protected String |
servicesNamespaceName |
protected Collection |
serviceTypeListeners
Collection of service type listeners.
|
CONTAINER_NAMECONTAINER_NAME| Constructor and Description |
|---|
AbstractDiscoveryContainerAdapter(String aNamespaceName,
DiscoveryContainerConfig aConfig) |
| Modifier and Type | Method and Description |
|---|---|
void |
addServiceListener(IServiceListener aListener)
Add a service listener.
|
void |
addServiceListener(IServiceTypeID aType,
IServiceListener aListener)
Add a service listener.
|
void |
addServiceTypeListener(IServiceTypeListener aListener)
Add a service type listener.
|
protected void |
clearListeners() |
void |
dispose()
Dispose this IContainer instance.
|
protected void |
fireServiceDiscovered(IServiceEvent aServiceEvent)
Calls
IServiceListener.serviceDiscovered(IServiceEvent) for all
registered IServiceListener |
protected void |
fireServiceTypeDiscovered(IServiceTypeEvent aServiceTypeEvent)
Calls
IServiceTypeListener.serviceTypeDiscovered(IServiceTypeEvent) for
all registered IServiceTypeListener |
protected void |
fireServiceUndiscovered(IServiceEvent aServiceEvent)
Calls
IServiceListener.serviceUndiscovered(IServiceEvent) for all
registered IServiceListener |
org.eclipse.equinox.concurrent.future.IFuture |
getAsyncServiceInfo(IServiceID service)
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 type)
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
|
protected DiscoveryContainerConfig |
getConfig() |
Namespace |
getConnectNamespace()
Get the Namespace for creating a targetID suitable for use as the first
parameter in subsequent calls to
IContainer.connect(ID, IConnectContext). |
abstract String |
getContainerName() |
ID |
getID()
Return the ID for this 'identifiable' object.
|
protected Collection |
getListeners(IServiceTypeID aServiceType)
Joins the
Collection of IServiceListeners interested in
any IServiceTypeID with the Collection of the
IServiceListener registered for the given IServiceTypeID |
protected IServiceEvent |
getServiceEvent(IServiceInfo iServiceInfo,
ID id) |
Namespace |
getServicesNamespace()
Get a Namespace for services associated with this discovery container
adapter.
|
IServiceInfo[] |
purgeCache()
Purges the underlying IServiceInfo cache if available in the current
provider
|
void |
removeServiceListener(IServiceListener aListener)
Remove a service listener.
|
void |
removeServiceListener(IServiceTypeID aType,
IServiceListener aListener)
Remove a service listener.
|
void |
removeServiceTypeListener(IServiceTypeListener aListener)
Remove a service type listener.
|
void |
unregisterAllServices()
Unregister all previously registered service.
|
addListener, fireContainerEvent, getAdapter, getPasswordFromConnectContext, removeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetServiceInfo, getServices, getServices, getServiceTypesregisterService, unregisterServiceconnect, disconnect, getConnectedIDprotected final Set allServiceListeners
protected final Map serviceListeners
protected final String servicesNamespaceName
protected final Collection serviceTypeListeners
public AbstractDiscoveryContainerAdapter(String aNamespaceName, DiscoveryContainerConfig aConfig)
aNamespaceName - namespace nameaConfig - discovery container configpublic void addServiceListener(IServiceListener aListener)
IDiscoveryLocatoraddServiceListener in interface IDiscoveryLocatoraListener - IServiceListener to be notified. Must not be null
.protected IServiceEvent getServiceEvent(IServiceInfo iServiceInfo, ID id)
iServiceInfo - service infoid - idpublic void addServiceListener(IServiceTypeID aType, IServiceListener aListener)
IDiscoveryLocatoraddServiceListener in interface IDiscoveryLocatoraType - String type to listen for. Must not be null. Must
be formatted according to this specific IDiscoveryContaineraListener - IServiceListener to be notified. Must not be null
.public void addServiceTypeListener(IServiceTypeListener aListener)
IDiscoveryLocatoraddServiceTypeListener in interface IDiscoveryLocatoraListener - the listener to be notified. Must not be null.protected void clearListeners()
public void dispose()
IContainerdispose in interface IContainerdispose in class AbstractContainerprotected void fireServiceDiscovered(IServiceEvent aServiceEvent)
IServiceListener.serviceDiscovered(IServiceEvent) for all
registered IServiceListeneraServiceEvent - The IServiceEvent to send along the callprotected void fireServiceTypeDiscovered(IServiceTypeEvent aServiceTypeEvent)
IServiceTypeListener.serviceTypeDiscovered(IServiceTypeEvent) for
all registered IServiceTypeListeneraServiceTypeEvent - The IServiceTypeEvent to send along the callprotected void fireServiceUndiscovered(IServiceEvent aServiceEvent)
IServiceListener.serviceUndiscovered(IServiceEvent) for all
registered IServiceListeneraServiceEvent - The IServiceEvent to send along the callprotected DiscoveryContainerConfig getConfig()
DiscoveryContainerConfig of this
IDiscoveryContainerAdapterpublic 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 abstract String getContainerName()
protected Collection getListeners(IServiceTypeID aServiceType)
Collection of IServiceListeners interested in
any IServiceTypeID with the Collection of the
IServiceListener registered for the given IServiceTypeIDaServiceType - The IServiceTypeID for which the
IServiceListeners are returnedIServiceListeners interested in the given
IServiceTypeIDpublic Namespace getServicesNamespace()
IDiscoveryLocator
IServiceID serviceID = ServiceIDFactory.getDefault().createServiceID(container.getServicesNamespace(),
serviceType, serviceName);
getServicesNamespace in interface IDiscoveryAdvertisergetServicesNamespace in interface IDiscoveryLocatornull
.public void removeServiceListener(IServiceListener aListener)
IDiscoveryLocatorremoveServiceListener in interface IDiscoveryLocatoraListener - IServiceListener listener to be removed. Must not be
null.public void removeServiceListener(IServiceTypeID aType, IServiceListener aListener)
IDiscoveryLocatorremoveServiceListener in interface IDiscoveryLocatoraType - String of the desired type to remove the listener. Must not be
null. Must be formatted according to this
specific IDiscoveryContaineraListener - IServiceListener listener to be removed. Must not be
null.public void removeServiceTypeListener(IServiceTypeListener aListener)
IDiscoveryLocatorremoveServiceTypeListener in interface IDiscoveryLocatoraListener - IServiceTypeListener to be removed. Must not be
null.public void unregisterAllServices()
IDiscoveryAdvertiserunregisterAllServices in interface IDiscoveryAdvertiserIDiscoveryAdvertiser.unregisterAllServices()public IServiceInfo[] purgeCache()
IDiscoveryLocatorpurgeCache in interface IDiscoveryLocatorIDiscoveryLocator.purgeCache()public org.eclipse.equinox.concurrent.future.IFuture getAsyncServiceInfo(IServiceID service)
IDiscoveryLocatorgetAsyncServiceInfo in interface IDiscoveryLocatorservice - IServiceID of the service to get info about. Must not be
null.null if no information retrievable.IDiscoveryLocator.getAsyncServiceInfo(org.eclipse.ecf.discovery.identity.IServiceID)public org.eclipse.equinox.concurrent.future.IFuture getAsyncServiceTypes()
IDiscoveryLocatorgetAsyncServiceTypes in interface IDiscoveryLocatornull. May be of length
0.IDiscoveryLocator.getAsyncServiceTypes()public org.eclipse.equinox.concurrent.future.IFuture getAsyncServices()
IDiscoveryLocatorgetAsyncServices in interface IDiscoveryLocatornull. May be of length
0.IDiscoveryLocator.getAsyncServices()public org.eclipse.equinox.concurrent.future.IFuture getAsyncServices(IServiceTypeID type)
IDiscoveryLocatorgetAsyncServices 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.IDiscoveryLocator.getAsyncServices(org.eclipse.ecf.discovery.identity.IServiceTypeID)Copyright © 2004–2020 Eclipse Foundation. All rights reserved.