Configuring LookupDiscovery
This implementation of
LookupDiscovery
supports the following configuration entries; where each configuration entry name is associated with the component name net.jini.discovery.LookupDiscovery
. Note that the configuration entries specified here are specific to this implementation of LookupDiscovery
. Unless otherwise stated, each entry is retrieved from the configuration only once per instance of this utility, where each such retrieval is performed in the constructor. • | discoveryConstraints | |
---|---|---|
  | Type: | {@link net.jini.core.constraint.MethodConstraints} |
  | Default: | null |
  | Description: | Constraints to apply to the multicast request, multicast announcement and unicast discovery protocols. Multicast request constraints are derived by calling {@link MethodConstraints#getConstraints getConstraints} on theobtained MethodConstraints instance with a Method object for the {@link com.sun.jini.discovery.DiscoveryConstraints#multicastRequest multicastRequest} method; multicast announcement and unicastdiscovery constraints are similarly obtained by passing Method objects for the {@link com.sun.jini.discovery.DiscoveryConstraints#multicastAnnouncement multicastAnnouncement} and{@link com.sun.jini.discovery.DiscoveryConstraints#unicastDiscovery unicastDiscovery} methods, respectively. A null value is interpreted as mapping all methods to empty constraints. This class supports the use of the following constraint types to control discovery behavior:
|
• | finalMulticastRequestInterval | |
---|---|---|
  | Type: | long |
  | Default: | 2*60*1000 (2 minutes) |
  | Description: | With respect to when this utility is started, as well as when the set of groups to discover is changed, this entry represents the number of milliseconds to wait after sending the n-th multicast request where n is equal to the value of the multicastRequestMax entry of this component. |
• | initialMulticastRequestDelayRange | |
---|---|---|
  | Type: | long |
  | Default: | 0 milliseconds |
  | Description: | With respect to when this utility is started, this entry controls how long to wait before sending out the first multicast request. If the value is positive, the first request will be delayed by a random value between 0 and initialMulticastRequestDelayRange milliseconds. Subsequent request intervals are controlled by the multicastRequestInterval entry. Note that this entry only has effect when this utility is initialized. The first multicast request is not delayed if the groups to discover are subsequently changed. |
• | multicastAnnouncementInterval | |
---|---|---|
  | Type: | long |
  | Default: | 2*60*1000 (2 minutes) |
  | Description: | A lookup service will send out multicast packets announcing its existence every N milliseconds; for some value of N. The value of this entry controls how often this utility examines the multicast announcements from previously discovered lookup services for liveness. |
• | multicastInterfaceRetryInterval | |
---|---|---|
  | Type: | int |
  | Default: | 5*60*1000 (5 minutes) |
  | Description: | With respect to any network interface this utility is configured to use to send and receive multicast packets (see entry multicastInterfaces ), if failure is encountered upon the initial attempt to set the interface or join the desired multicast group, this utility will retry the failed interface every multicastInterfaceRetryInterval milliseconds until success is encountered. |
• | multicastInterfaces | |
---|---|---|
  | Type: | {@link java.net.NetworkInterface NetworkInterface[]} |
  | Default: | new {@link java.net.NetworkInterface NetworkInterface[]}  {all currently supported interfaces} |
  | Description: | Each network interface that is represented by an element in the array corresponding to this configuration item will be used to send and receive multicast packets when this utility is participating in the multicast discovery process. When not set, this utility will use all of the network interfaces in the system. When this entry is set to a zero length array, multicast discovery is effectively disabled. And when set to null , the interface to which the operating system defaults will be used. |
• | multicastRequestHost | |
---|---|---|
  | Type: | String |
  | Default: | {@link java.net.InetAddress}.getLocalHost().getHostAddress() |
  | Description: | This entry specifies the host name to include in multicast requests if participating in version 2 of the multicast request protocol. The name cannot be null . |
• | multicastRequestInterval | |
---|---|---|
  | Type: | long |
  | Default: | 5000 |
  | Description: | With respect to when this utility is started, as well as when the set of groups to discover is changed, this entry represents the number of milliseconds to wait after sending the n-th multicast request, and before sending the (n+1)-st request, where n is less than the value of the multicastRequestMax entry of this component. |
• | multicastRequestMax | |
---|---|---|
  | Type: | int |
  | Default: | 7 |
  | Description: | The maximum number multicast requests to send when this utility is started for the first time, and whenever the groups to discover is changed. |
• | registrarPreparer | |
---|---|---|
  | Type: | {@link net.jini.security.ProxyPreparer} |
  | Default: | new {@link net.jini.security.BasicProxyPreparer}() |
  | Description: | Preparer for the proxies to the lookup services that are discovered and used by this utility. This preparer should perform all operations required to use a newly received proxy to a lookup service, which may including verifying trust in the proxy, granting permissions, and setting constraints. The following methods of the {@link net.jini.core.lookup.ServiceRegistrar ServiceRegistrar}returned by this preparer are invoked by this implementation of
|
• | taskManager | |
---|---|---|
  | Type: | {@link com.sun.jini.thread.TaskManager} |
  | Default: | new {@link com.sun.jini.thread.TaskManager#TaskManager() TaskManager}(15, (15*1000), 1.0f) |
  | Description: | The object that pools and manages the various threads executed by this utility. The default manager creates a maximum of 15 threads, waits 15 seconds before removing idle threads, and uses a load factor of 1.0 when determining whether to create a new thread. This object should not be shared with other components in the application that employs this utility. |
• | unicastDelayRange | |
---|---|---|
  | Type: | long |
  | Default: | 0 milliseconds |
  | Description: | Controls how long this utility will wait before sending out unicast discovery requests. If the value is positive, any unicast discovery request that it initiates will be delayed by a random value between 0 and unicastDelayRange milliseconds. A typical use of this entry would be to achieve a more uniform distribution of unicast discovery requests to a lookup service, when a large number of LookupDiscovery instances simultaneously receive multicast announcements from the lookup service. |
• | wakeupManager | |
---|---|---|
  | Type: | {@link com.sun.jini.thread.WakeupManager} |
  | Default: | new {@link com.sun.jini.thread.WakeupManager#WakeupManager(com.sun.jini.thread.WakeupManager.ThreadDesc) WakeupManager}(new {@link com.sun.jini.thread.WakeupManager.ThreadDesc}(null,true)) |
  | Description: | Object used to schedule unicast discovery requests that are delayed using the unicastDelayRange configuration entry of this utility. This entry is processed only if unicastDelayRange has a positive value. |
Logging
This implementation of
LookupDiscovery
uses the {@link Logger}named net.jini.discovery.LookupDiscovery
to log information at the following logging levels:
Level | Description |
---|---|
{@link java.util.logging.Level#SEVERE SEVERE} | when this utility is configured to use either the default network interface assigned by the system, or a specific list of network interfaces, if one of those interfaces is bad or not configured for multicast, or if a runtime exception occurs while either sending multicast requests, or while configuring one of the interfaces to receive multicast announcements, that fact will be logged at this level |
{@link java.util.logging.Level#INFO INFO} | when any exception other than an InterruptedIOException , InterruptedException or UnsupportedConstraintException occurs in a thread or task while attempting to marshal an outgoing multicast request |
{@link java.util.logging.Level#INFO INFO} | when any exception other than an InterruptedIOException or SocketTimeoutException occurs in a non-interrupted thread while attempting to receive an incoming multicast packet |
{@link java.util.logging.Level#INFO INFO} | when any exception other than an InterruptedIOException occurs while attempting unicast discovery |
{@link java.util.logging.Level#INFO INFO} | when this utility is configured to use either the default network interface assigned by the system, or a specific list of network interfaces, with respect to any such interface, if failure is encountered upon the initial attempt to set the interface or join the desired multicast group, the interface will be periodically retried, and successful recovery will be logged at this level |
{@link java.util.logging.Level#INFO INFO} | when any exception occurs while attempting to prepare a proxy |
{@link java.util.logging.Level#CONFIG CONFIG} | when the multicastInterfaces entry is configured to be null , multicast packets will be sent and received through the default network interface assigned by the system, and that fact will be logged at this level |
{@link java.util.logging.Level#CONFIG CONFIG} | when the multicastInterfaces entry is configured to be a zero length array, multicast discovery will be disabled, and and that fact will be logged at this level |
{@link java.util.logging.Level#CONFIG CONFIG} | when the multicastInterfaces entry contains a specific list of network interfaces, multicast packets will be sent and received through only the network interfaces contained in that list, and those interfaces will be logged at this level |
{@link java.util.logging.Level#CONFIG CONFIG} | when the multicastInterfaces entry is excluded from the configuration, multicast packets will be sent and received through all interfaces in the system, and those interfaces will be logged at this level |
{@link com.sun.jini.logging.Levels#FAILED FAILED} | when an UnknownHostException occurs while determining the multicastRequestHost , but the caller does not have permissions to retrieve the local host name. The original UnknownHostException with the host name information is logged |
{@link com.sun.jini.logging.Levels#HANDLED HANDLED} | when this utility is configured to use all network interfaces enabled in the system, if one of those interfaces is bad or not configured for multicast, or if a runtime exception occurs while either sending multicast requests, or while configuring one of the interfaces to receive multicast announcements, that fact will be logged at this level |
{@link com.sun.jini.logging.Levels#HANDLED HANDLED} | when any exception occurs while attempting to unmarshal an incoming multicast announcement |
{@link com.sun.jini.logging.Levels#HANDLED HANDLED} | when an UnsupportedConstraintException occurs while marshalling an outgoing multicast request, indicating that the provider that threw the exception will not be used for encoding that request |
{@link com.sun.jini.logging.Levels#HANDLED HANDLED} | when an IOException occurs upon attempting to close the socket after the thread that listens for multicast responses is asked to terminate |
{@link com.sun.jini.logging.Levels#HANDLED HANDLED} | when an exception is handled during unicast discovery |
{@link java.util.logging.Level#FINE FINE} | when this utility is configured to use all network interfaces enabled in the system, with respect to any such interface, if failure is encountered upon the initial attempt to set the interface or join the desired multicast group, the interface will be periodically retried, and successful recovery will be logged at this level |
{@link java.util.logging.Level#FINEST FINEST} | whenever any thread or task is started |
{@link java.util.logging.Level#FINEST FINEST} | whenever any thread (except the Notifier thread) or task completes successfully |
{@link java.util.logging.Level#FINEST FINEST} | whenever a discovered, discarded, or changed event is sent |
{@link java.util.logging.Level#FINEST FINEST} | whenever a proxy is prepared |
@author Sun Microsystems, Inc. @see net.jini.core.lookup.ServiceRegistrar @see DiscoveryChangeListener @see DiscoveryManagement @see DiscoveryGroupManagement @see DiscoveryListener @see DiscoveryEvent @see DiscoveryPermission
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|