|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
net.jini.discovery.LookupDiscovery.Requestor
private class LookupDiscovery.Requestor
Thread that periodically sends out multicast requests for a limited period of time, and then exits.
An instance of this thread is run at startup, and each time the set of groups to discover is changed.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
private boolean |
delayFlag
|
private String[] |
groups
Groups to request |
private int |
responsePort
Unicast response port |
private MulticastSocket |
sock
Multicast socket for sending packets |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
LookupDiscovery.Requestor(String[] groups,
int port,
boolean delayFlag)
Create a daemon thread |
Method Summary | |
---|---|
void |
run()
This method sends out N (for small N) multicast requests. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private MulticastSocket sock
private int responsePort
private String[] groups
private boolean delayFlag
Constructor Detail |
---|
public LookupDiscovery.Requestor(String[] groups, int port, boolean delayFlag) throws IOException
IOException
Method Detail |
---|
public void run()
After all requests have been sent, and the ResponseListener has been given the appropriate time to receive and process any multicast responses, if there are no more active instances of this thread, this method terminates (interrupts) the ResponseListener. Note that although it is more desirable to have the ResponseListener set a timeout on the server socket (using setSoTimeout) and then simply exit after a period of time in which both the ResponseListener has been idle, and there have been no active Requestor threads, using setSoTimeout in this way can cause random hangs on the Solaris(TM) operating system.
run
in interface Runnable
run
in class Thread
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |