net.jini.discovery
Class LookupLocatorDiscovery.DiscoveryTask
java.lang.Object
com.sun.jini.thread.RetryTask
net.jini.discovery.LookupLocatorDiscovery.DiscoveryTask
- All Implemented Interfaces:
- TimeConstants, TaskManager.Task, Runnable
- Enclosing class:
- LookupLocatorDiscovery
private class LookupLocatorDiscovery.DiscoveryTask
- extends RetryTask
Task which retrieves elements from the set of undiscoveredLocators
and attempts, through the unicast discovery protocol, to discover
the lookup service having the LookupLocator referenced by the element.
If a particular instance of this class fails to find the lookup
service that it references, this task will be rescheduled to be
executed again at a later time, using a "backoff strategy" as defined
by the method com.sun.jini.thread.RetryTask.retryTime
.
- See Also:
RetryTask
,
WakeupManager
Method Summary |
long |
retryTime()
Returns the next absolute time (in milliseconds) at which another
attempt to discover the lookup service referenced in this class
should be made. |
boolean |
runAfter(List tasks,
int size)
Returns true if current instance must be run after task(s) in
task manager queue. |
boolean |
tryOnce()
Executes the current instance of this task once, attempting to
discover - through unicast discovery - the lookup service
referenced in that instance. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
reg
private LookupLocatorDiscovery.LocatorReg reg
LookupLocatorDiscovery.DiscoveryTask
public LookupLocatorDiscovery.DiscoveryTask(LookupLocatorDiscovery.LocatorReg reg,
TaskManager taskMgr,
WakeupManager wakeupMgr)
tryOnce
public boolean tryOnce()
- Executes the current instance of this task once, attempting to
discover - through unicast discovery - the lookup service
referenced in that instance. Upon successfully discovering the
indicated lookup service, this method returns
true
and the current instance of this task is not executed again.
For each unsuccessful discovery attempt made by this method
for the current instance of this task, this method returns
false
, which causes the task to be scheduled by
the WakeupManager
to be executed again at a later
time as indicated by the value returned by retryTime
.
- Specified by:
tryOnce
in class RetryTask
retryTime
public long retryTime()
- Returns the next absolute time (in milliseconds) at which another
attempt to discover the lookup service referenced in this class
should be made.
Overrides the version of this method in the parent class.
- Overrides:
retryTime
in class RetryTask
runAfter
public boolean runAfter(List tasks,
int size)
- Returns true if current instance must be run after task(s) in
task manager queue.
- Parameters:
tasks
- the tasks to consider.size
- elements with index less than size are considered.
Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.