|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.ecf.core.AbstractContainer org.eclipse.ecf.discovery.AbstractDiscoveryContainerAdapter
public abstract class AbstractDiscoveryContainerAdapter
Field Summary | |
---|---|
protected java.util.Set |
allServiceListeners
Collection of service listeners i.e. |
protected java.util.Map |
serviceListeners
Map of service type to collection of service listeners i.e. |
protected java.lang.String |
servicesNamespaceName
|
protected java.util.Collection |
serviceTypeListeners
Collection of service type listeners i.e. |
Fields inherited from interface org.eclipse.ecf.discovery.IDiscoveryLocator |
---|
CONTAINER_NAME |
Fields inherited from interface org.eclipse.ecf.discovery.IDiscoveryAdvertiser |
---|
CONTAINER_NAME |
Constructor Summary | |
---|---|
AbstractDiscoveryContainerAdapter(java.lang.String aNamespaceName,
DiscoveryContainerConfig aConfig)
|
Method Summary | |
---|---|
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 java.lang.String |
getContainerName()
|
ID |
getID()
Return the ID for this 'identifiable' object. |
protected java.util.Collection |
getListeners(IServiceTypeID aServiceType)
Joins the Collection of IServiceListener s interested in
any IServiceTypeID with the Collection of the
IServiceListener registered for the given IServiceTypeID |
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. |
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 |
---|
getServiceInfo, getServices, getServices, getServiceTypes |
Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
---|
getAdapter |
Methods inherited from interface org.eclipse.ecf.discovery.IDiscoveryAdvertiser |
---|
registerService, unregisterService |
Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
---|
getAdapter |
Methods inherited from interface org.eclipse.ecf.core.IContainer |
---|
connect, disconnect, getConnectedID |
Field Detail |
---|
protected final java.util.Set allServiceListeners
protected final java.util.Map serviceListeners
protected final java.lang.String servicesNamespaceName
protected final java.util.Collection serviceTypeListeners
Constructor Detail |
---|
public AbstractDiscoveryContainerAdapter(java.lang.String aNamespaceName, DiscoveryContainerConfig aConfig)
aNamespaceName
- aConfig
- Method Detail |
---|
public void addServiceListener(IServiceListener aListener)
IDiscoveryLocator
addServiceListener
in interface IDiscoveryLocator
aListener
- IServiceListener to be notified. Must not be null
.public void addServiceListener(IServiceTypeID aType, IServiceListener aListener)
IDiscoveryLocator
addServiceListener
in interface IDiscoveryLocator
aType
- 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)
IDiscoveryLocator
addServiceTypeListener
in interface IDiscoveryLocator
aListener
- the listener to be notified. Must not be null
.protected void clearListeners()
public void dispose()
IContainer
dispose
in interface IContainer
dispose
in class AbstractContainer
protected void fireServiceDiscovered(IServiceEvent aServiceEvent)
IServiceListener.serviceDiscovered(IServiceEvent)
for all
registered IServiceListener
aServiceEvent
- The IServiceEvent
to send along the callprotected void fireServiceTypeDiscovered(IServiceTypeEvent aServiceTypeEvent)
IServiceTypeListener.serviceTypeDiscovered(IServiceTypeEvent)
for
all registered IServiceTypeListener
aServiceTypeEvent
- The IServiceTypeEvent
to send along the callprotected void fireServiceUndiscovered(IServiceEvent aServiceEvent)
IServiceListener.serviceUndiscovered(IServiceEvent)
for all
registered IServiceListener
aServiceEvent
- The IServiceEvent
to send along the callprotected DiscoveryContainerConfig getConfig()
DiscoveryContainerConfig
of this
IDiscoveryContainerAdapter
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 abstract java.lang.String getContainerName()
protected java.util.Collection getListeners(IServiceTypeID aServiceType)
Collection
of IServiceListener
s interested in
any IServiceTypeID
with the Collection
of the
IServiceListener
registered for the given IServiceTypeID
aServiceType
- The IServiceTypeID
for which the
IServiceListener
s are returned
IServiceListener
s interested in the given
IServiceTypeID
public Namespace getServicesNamespace()
IDiscoveryAdvertiser
IServiceID serviceID = ServiceIDFactory.getDefault().createServiceID( container.getServicesNamespace(), serviceType, serviceName);
getServicesNamespace
in interface IDiscoveryAdvertiser
getServicesNamespace
in interface IDiscoveryLocator
null
.public void removeServiceListener(IServiceListener aListener)
IDiscoveryLocator
removeServiceListener
in interface IDiscoveryLocator
aListener
- IServiceListener listener to be removed. Must not be
null
.public void removeServiceListener(IServiceTypeID aType, IServiceListener aListener)
IDiscoveryLocator
removeServiceListener
in interface IDiscoveryLocator
aType
- 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)
IDiscoveryLocator
removeServiceTypeListener
in interface IDiscoveryLocator
aListener
- IServiceTypeListener to be removed. Must not be
null
.public void unregisterAllServices()
IDiscoveryAdvertiser
unregisterAllServices
in interface IDiscoveryAdvertiser
IDiscoveryAdvertiser.unregisterAllServices()
public IServiceInfo[] purgeCache()
IDiscoveryLocator
purgeCache
in interface IDiscoveryLocator
IDiscoveryLocator.purgeCache()
public org.eclipse.equinox.concurrent.future.IFuture getAsyncServiceInfo(IServiceID service)
IDiscoveryLocator
getAsyncServiceInfo
in interface IDiscoveryLocator
null
if no information retrievable.IDiscoveryLocator.getAsyncServiceInfo(org.eclipse.ecf.discovery.identity.IServiceID)
public org.eclipse.equinox.concurrent.future.IFuture getAsyncServiceTypes()
IDiscoveryLocator
getAsyncServiceTypes
in interface IDiscoveryLocator
null
. May be of length
0.IDiscoveryLocator.getAsyncServiceTypes()
public org.eclipse.equinox.concurrent.future.IFuture getAsyncServices()
IDiscoveryLocator
getAsyncServices
in interface IDiscoveryLocator
null
. May be of length
0.IDiscoveryLocator.getAsyncServices()
public org.eclipse.equinox.concurrent.future.IFuture getAsyncServices(IServiceTypeID type)
IDiscoveryLocator
getAsyncServices
in interface IDiscoveryLocator
null
. May be of length
0.IDiscoveryLocator.getAsyncServices(org.eclipse.ecf.discovery.identity.IServiceTypeID)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |