Package net.jini.discovery
Class DiscoveryEvent
java.lang.Object
java.util.EventObject
net.jini.discovery.DiscoveryEvent
- All Implemented Interfaces:
Serializable
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 Summary
FieldsModifier and TypeFieldDescriptionprotected MapMap from the registrars of this event to the groups in which each is a member.protected ServiceRegistrar[]The registrars with which this event is associated.Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionDiscoveryEvent(Object source, Map groups) Construct a newDiscoveryEventobject, with the given source and registrars-to-groups mapping.DiscoveryEvent(Object source, ServiceRegistrar[] regs) Construct a newDiscoveryEventobject, with the given source and set of registrars. -
Method Summary
Modifier and TypeMethodDescriptionReturns a set that maps to each registrar referenced by this event, the current set of groups in which each registrar is a member.Return the set of registrars to which this event applies.Methods inherited from class java.util.EventObject
getSource, toString
-
Field Details
-
regs
The registrars with which this event is associated. -
groups
Map from the registrars of this event to the groups in which each is a member.
-
-
Constructor Details
-
DiscoveryEvent
Construct a newDiscoveryEventobject, with the given source and set of registrars. The set of registrars should not be empty.- Parameters:
source- the source of this eventregs- the registrars to which this event applies
-
DiscoveryEvent
Construct a newDiscoveryEventobject, with the given source and registrars-to-groups mapping. The mapping should not be empty.- Parameters:
source- the source of this eventgroups- mapping from the elements of the registrars of this event to the member groups in which each registrar is a member
-
-
Method Details
-
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
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
getRegistrarsmethod, simply use the desired element from that array as the key to thegetmethod of theMapobject returned by this method and cast toString[].Note that the same
Mapobject is returned on every call to this method; that is, a copy is not made.- Returns:
Mapin which the keys are the elements of the array returned by thegetRegistrarsmethod of this class; and the values areString[] arrays containing the member groups corresponding to each registrar.
-