GigaSpaces XAP 9.7.2 API

net.jini.discovery
Class DiscoveryEvent

java.lang.Object
  extended by java.util.EventObject
      extended by net.jini.discovery.DiscoveryEvent
All Implemented Interfaces:
Serializable

public class DiscoveryEvent
extends EventObject

Event object passed (via either the DiscoveryListener interface or the DiscoveryChangeListener) to indicate to interested parties that one or more ServiceRegistrar objects have been discovered or discarded during the discovery process.

Author:
Sun Microsystems, Inc.
See Also:
LookupDiscovery, LookupLocatorDiscovery, LookupDiscoveryManager, DiscoveryListener, DiscoveryChangeListener, ServiceRegistrar, Serialized Form

Field Summary
protected  Map groups
          Map from the registrars of this event to the groups in which each is a member.
protected  ServiceRegistrar[] regs
          The registrars with which this event is associated.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
DiscoveryEvent(Object source, Map groups)
          Construct a new DiscoveryEvent object, with the given source and registrars-to-groups mapping.
DiscoveryEvent(Object source, ServiceRegistrar[] regs)
          Construct a new DiscoveryEvent object, with the given source and set of registrars.
 
Method Summary
 Map getGroups()
          Returns a set that maps to each registrar referenced by this event, the current set of groups in which each registrar is a member.
 ServiceRegistrar[] getRegistrars()
          Return the set of registrars to which this event applies.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

regs

protected ServiceRegistrar[] regs
The registrars with which this event is associated.


groups

protected Map groups
Map from the registrars of this event to the groups in which each is a member.

Constructor Detail

DiscoveryEvent

public DiscoveryEvent(Object source,
                      ServiceRegistrar[] regs)
Construct a new DiscoveryEvent object, with the given source and set of registrars. The set of registrars should not be empty.

Parameters:
source - the source of this event
regs - the registrars to which this event applies

DiscoveryEvent

public DiscoveryEvent(Object source,
                      Map groups)
Construct a new DiscoveryEvent object, with the given source and registrars-to-groups mapping. The mapping should not be empty.

Parameters:
source - the source of this event
groups - mapping from the elements of the registrars of this event to the member groups in which each registrar is a member
Method Detail

getRegistrars

public ServiceRegistrar[] getRegistrars()
Return the set of registrars to which this event applies. The same array is returned on every call; a copy is not made.

Returns:
the set of registrars to which this event applies.

getGroups

public Map getGroups()
Returns a set that maps to each registrar referenced by this event, the current set of groups in which each registrar is a member.

To retrieve the set of member groups corresponding to any element of the array returned by the getRegistrars method, simply use the desired element from that array as the key to the get method of the Map object returned by this method and cast to String[].

Note that the same Map object is returned on every call to this method; that is, a copy is not made.

Returns:
Map in which the keys are the elements of the array returned by the getRegistrars method of this class; and the values are String[] arrays containing the member groups corresponding to each registrar.

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.