public class DiscoveryEvent extends EventObject
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.LookupDiscovery
,
LookupLocatorDiscovery
,
LookupDiscoveryManager
,
DiscoveryListener
,
DiscoveryChangeListener
,
ServiceRegistrar
,
Serialized Formsource
Constructor and Description |
---|
DiscoveryEvent(AtomicSerial.GetArg arg) |
DiscoveryEvent(Object source,
Map<ServiceRegistrar,String[]> 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. |
Modifier and Type | Method and Description |
---|---|
Map<ServiceRegistrar,String[]> |
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.
|
getSource, toString
public DiscoveryEvent(Object source, ServiceRegistrar[] regs)
DiscoveryEvent
object, with the given
source and set of registrars. The set of registrars should not be
empty.source
- the source of this eventregs
- the registrars to which this event appliespublic DiscoveryEvent(Object source, Map<ServiceRegistrar,String[]> groups)
DiscoveryEvent
object, with the given
source and registrars-to-groups mapping. The mapping should not be
empty.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 memberpublic DiscoveryEvent(AtomicSerial.GetArg arg) throws IOException
IOException
public ServiceRegistrar[] getRegistrars()
public Map<ServiceRegistrar,String[]> getGroups()
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.
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.Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.