Because this class participates in only the unicast discovery protocol, and because the unicast discovery protocol imposes no restriction on the physical location of the entity relative to a lookup service, this utility can be used to discover lookup services running on hosts that are located far from, or near to, the host on which the entity is running. This lack of a restriction on location brings with it a requirement that the discovering entity supply this class with specific information about the desired lookup services; namely, the location of the device(s) hosting each lookup service. This information is supplied through an instance of the {@link net.jini.core.discovery.LookupLocator LookupLocator} class. @com.sun.jini.impl The following implementation-specific items are discussed below:
Configuring LookupLocatorDiscovery
This implementation of
LookupLocatorDiscovery
supports the following configuration entries; where each configuration entry name is associated with the component name net.jini.discovery.LookupLocatorDiscovery
. Note that the configuration entries specified here are specific to this implementation of • | initialUnicastDelayRange | |
---|---|---|
  | Type: | long |
  | Default: | 0 milliseconds |
  | Description: | With respect to when this utility is started, this entry controls how long to wait before attempting unicast discovery. If the value is positive, initial unicast discovery requests will be delayed by a random value between 0 and initialUnicastDelayRange milliseconds. Once the wait period is up, the LookupLocator s specified at construction time are used for initiating unicast discovery requests, unless the managed LookupLocator s have been changed in the interim; in which case, no delayed unicast discovery requests are performed. Note that this entry only has effect when this utility is initialized. It does not delay discovery requests that are initiated if the managed LookupLocator s are subsequently 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. Currently, none of the methods on 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. |
• | 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 that pools and manages the various tasks that are initially executed by the object corresponding to the taskManager entry of this component, but which fail during that initial execution. This object schedules the re-execution of such a failed task - in the taskManager object - at various times in the future, (employing a "backoff strategy"). The re-execution of the failed task will continue to be scheduled by this object until the task finally succeeds. This object should not be shared with other components in the application that employs this utility. |
Logging
This implementation of
LookupLocatorDiscovery
uses the {@link Logger} named net.jini.discovery.LookupLocatorDiscovery
to log information at the following logging levels:
Level | Description |
---|---|
{@link java.util.logging.Level#INFO INFO} | when any exception occurs in a task or thread, while attempting unicast discovery of a given locator |
{@link java.util.logging.Level#INFO INFO} | when any exception occurs while attempting to prepare a proxy |
{@link com.sun.jini.logging.Levels#HANDLED HANDLED} | when an exception is handled during unicast discovery. |
{@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 or discarded event is sent |
{@link java.util.logging.Level#FINEST FINEST} | whenever a proxy is prepared |
{@link java.util.logging.Level#FINEST FINEST} | when an IOException occurs upon attempting to close the socket after a unicast discovery attempt has either completed successfully or failed |
This implementation of LookupLocatorDiscovery
determines the constraints (if any) to apply to unicast discovery for a given {@link net.jini.core.discovery.LookupLocator LookupLocator} instanceby calling the {@link net.jini.core.constraint.RemoteMethodControl#getConstraints getConstraints} method of that instance, if it implements the{@link net.jini.core.constraint.RemoteMethodControl RemoteMethodControl}interface. If the {@link net.jini.core.discovery.LookupLocator LookupLocator} instance does not implement{@link net.jini.core.constraint.RemoteMethodControl RemoteMethodControl}, then no constraints are applied to unicast discovery for that instance.
For more information on constraining unicast discovery, refer to the documentation for the {@link net.jini.discovery.ConstrainableLookupLocator ConstrainableLookupLocator} class. @author Sun Microsystems, Inc. @see net.jini.core.discovery.LookupLocator
|
|
|
|
|
|
|
|
|
|