public abstract class AbstractServiceDiscoveryListener extends Object implements ServiceDiscoveryListener
ServiceDiscoveryListener
in order to listen to LookupCache
. This class should be extend inorder to listen to spaces
join/change/leave.
It filters the incoming events according to the given parameters in the constructor.Constructor and Description |
---|
AbstractServiceDiscoveryListener(String serviceName,
Class[] classes,
Entry[] serviceAttributes)
Creates a new listener for the given service.
|
Modifier and Type | Method and Description |
---|---|
void |
serviceAdded(ServiceDiscoveryEvent event)
When the cache receives from one of the managed lookup services, an event signaling the
registration of a service of interest for the first time (or for the first time
since the service has been discarded), the cache invokes the
serviceAdded method
on all instances of ServiceDiscoveryListener that are registered with the cache;
doing so notifies the entity that a service of interest has been discovered. |
abstract void |
serviceAdded(String fullName,
IJSpace space,
ServiceID id)
This method is called if the event is relevant according to the parameters provided in the
constructor.
|
void |
serviceChanged(ServiceDiscoveryEvent event)
When the cache receives, from a managed lookup service, an event signaling the unique
modification of the attributes of a service of interest (across the attribute sets of all
references to the service), the cache invokes the
serviceChanged method on all
instances of ServiceDiscoveryListener that are registered with the cache; doing
so notifies the entity that the state of a service of interest has changed. |
abstract void |
serviceChanged(String fullName,
IJSpace space,
ServiceID id)
This method is called if the event is relevant according to the parameters provided in the
constructor.
|
void |
serviceRemoved(ServiceDiscoveryEvent event)
When the cache receives, from a managed lookup service, an event signaling the removal of a
service of interest from the last such lookup service with which it was registered, the cache
invokes the
serviceRemoved method on all instances of
ServiceDiscoveryListener that are registered with the cache; doing so notifies
the entity that a service of interest has been discarded. |
abstract void |
serviceRemoved(String fullName,
IJSpace space,
ServiceID id)
This method is called if the event is relevant according to the parameters provided in the
constructor.
|
public void serviceAdded(ServiceDiscoveryEvent event)
serviceAdded
method
on all instances of ServiceDiscoveryListener
that are registered with the cache;
doing so notifies the entity that a service of interest has been discovered. Call serviceAdded(String, IJSpace, ServiceID)
if the event is
relevant.serviceAdded
in interface ServiceDiscoveryListener
event
- an instance of ServiceDiscoveryEvent
containing references to the
service item corresponding to the event, including representations of the
service's state both before and after the event.public void serviceChanged(ServiceDiscoveryEvent event)
serviceChanged
method on all
instances of ServiceDiscoveryListener
that are registered with the cache; doing
so notifies the entity that the state of a service of interest has changed. Call serviceChanged(String, IJSpace, ServiceID)
if the event is
relevant.serviceChanged
in interface ServiceDiscoveryListener
event
- a ServiceDiscoveryEvent
object containing references to the service
item corresponding to the event, including representations of the service's
state both before and after the event.public void serviceRemoved(ServiceDiscoveryEvent event)
serviceRemoved
method on all instances of
ServiceDiscoveryListener
that are registered with the cache; doing so notifies
the entity that a service of interest has been discarded. Call serviceRemoved(String, IJSpace, ServiceID)
if the event is
relevant.serviceRemoved
in interface ServiceDiscoveryListener
event
- a ServiceDiscoveryEvent
object containing references to the service
item corresponding to the event, including representations of the service's
state both before and after the event.public abstract void serviceAdded(String fullName, IJSpace space, ServiceID id)
fullName
- space full name, host:container:spacespace
- source of the event.public abstract void serviceChanged(String fullName, IJSpace space, ServiceID id)
fullName
- space full name, host:container:spacespace
- source of the event.Copyright © GigaSpaces.