public final class LookupDiscoveryManager extends AbstractLookupDiscoveryManager implements DiscoveryManagement, DiscoveryGroupManagement, DiscoveryLocatorManagement
LookupLocator
objects, and DiscoveryListener
objects, clients and services can employ this class to provide those
facilities on their behalf.
DiscoveryManagement
,
DiscoveryGroupManagement
,
DiscoveryLocatorManagement
Configuring LookupDiscoveryManager
Currently, there are no configuration entries directly supported by this implementation of
LookupDiscoveryManager
. All configuration
entries affecting the operation of this utility are retrieved by either
the LookupDiscovery
utility, or the LookupLocatorDiscovery
utility. Please refer to the documentation provided with those utilities
when configuring the behavior of LookupDiscoveryManager
.
Logging
With one exception, all logging information produced when using this utility is controlled by the loggers supported by the following utilities:
This implementation of LookupDiscoveryManager
uses the Logger
named net.jini.discovery.LookupDiscoveryManager
to log information
at the following logging levels:
Level | Description |
---|---|
HANDLED |
when this utility asynchronously invokes a DiscoveryListener
implementation and that listener throws and unchecked exception. If the listener throws
in a synchronous path (namely, via AbstractLookupDiscoveryManager.addDiscoveryListener(DiscoveryListener) ) then
the exception is not trapped and will instead throw back to the caller.
|
AbstractLookupDiscoveryManager.LocatorDiscoveryListener, AbstractLookupDiscoveryManager.ProxyReg
FROM_GROUP, FROM_LOCATOR
ALL_GROUPS, NO_GROUPS
Constructor and Description |
---|
LookupDiscoveryManager(String[] groups,
LookupLocator[] locators,
DiscoveryListener listener)
Constructs an instance of this class that will organize and manage
all discovery-related activities on behalf of the client or service
that instantiates this class.
|
LookupDiscoveryManager(String[] groups,
LookupLocator[] locators,
DiscoveryListener listener,
Configuration config)
Constructs an instance of this class, using the given
Configuration , that will organize and manage all
discovery-related activities on behalf of the client or service
that instantiates this class. |
Modifier and Type | Method and Description |
---|---|
private static LookupDiscovery |
getLookupDiscovery(String[] groups) |
private static LookupLocatorDiscovery |
getLookupLocatorDiscovery(LookupLocator[] locators) |
addDiscoveryListener, addGroups, addLocators, beginDiscovery, discard, getFrom, getGroups, getLocators, getRegistrars, removeDiscoveryListener, removeGroups, removeLocators, setGroups, setLocators, terminate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addDiscoveryListener, discard, getRegistrars, removeDiscoveryListener, terminate
addGroups, getGroups, removeGroups, setGroups
addLocators, getLocators, removeLocators, setLocators
public LookupDiscoveryManager(String[] groups, LookupLocator[] locators, DiscoveryListener listener) throws IOException
If null
(DiscoveryGroupManagement.ALL_GROUPS
)
is input to the groups
parameter, then attempts will be
made via group discovery to discover all lookup services located within
range of the entity that constructs this class. If the empty array
(DiscoveryGroupManagement.NO_GROUPS
) is input to that
parameter, no group discovery will be performed until the set of
groups to discover is populated.
If an empty array or a null
reference is input to the
locators
parameter, no locator discovery will be performed
until the set of locators to discover is populated.
groups
- String
array, none of whose elements may
be null
, consisting of the names of the
groups whose members are lookup services the client
or service wishes to discover.locators
- array of instances of LookupLocator
, none
of whose elements may be null
, and in
which each element corresponds to a specific lookup
service the client or service wishes to discover via
locator discovery.listener
- a reference to DiscoveryListener
object
that will be notified when a targeted lookup service
is discovered or discarded.IOException
- because construction of this class may
initiate the discovery process, which can throw an
IOException
when socket allocation occurs.NullPointerException
- this exception occurs when
either one or more of the elements of the groups
parameter is null
, or one or more elements of
the locators
parameter is null.LookupLocator
,
DiscoveryListener
public LookupDiscoveryManager(String[] groups, LookupLocator[] locators, DiscoveryListener listener, Configuration config) throws IOException, ConfigurationException
Configuration
, that will organize and manage all
discovery-related activities on behalf of the client or service
that instantiates this class.
If null
(DiscoveryGroupManagement.ALL_GROUPS
)
is input to the groups
parameter, then attempts will be
made via group discovery to discover all lookup services located within
range of the entity that constructs this class. If the empty array
(DiscoveryGroupManagement.NO_GROUPS
) is input to that
parameter, no group discovery will be performed until the set of
groups to discover is populated.
If an empty array or a null
reference is input to the
locators
parameter, no locator discovery will be performed
until the set of locators to discover is populated.
groups
- String
array, none of whose elements may
be null
, consisting of the names of the
groups whose members are lookup services the client
or service wishes to discover.locators
- array of instances of LookupLocator
, none
of whose elements may be null
, and in
which each element corresponds to a specific lookup
service the client or service wishes to discover via
locator discovery.listener
- a reference to DiscoveryListener
object
that will be notified when a targeted lookup service
is discovered or discarded.config
- an instance of Configuration
, used to
obtain the objects needed to configure the current
instance of this classIOException
- because construction of this class may
initiate the discovery process, which can throw an
IOException
when socket allocation occurs.ConfigurationException
- indicates an exception
occurred while retrieving an item from the given
Configuration
NullPointerException
- this exception occurs when
either one or more of the elements of the groups
parameter is null
, or one or more elements of
the locators
parameter is null
, or
when null
is input for the configuration.LookupLocator
,
DiscoveryListener
,
Configuration
private static LookupDiscovery getLookupDiscovery(String[] groups) throws IOException
IOException
private static LookupLocatorDiscovery getLookupLocatorDiscovery(LookupLocator[] locators) throws IOException
IOException
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.