Class DiscoveryEvent

java.lang.Object
java.util.EventObject
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:
  • Field Details

    • 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 Details

    • 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 Details

    • 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.