net.jini.discovery
Class LookupDiscovery.ResponseListener

java.lang.Object
  extended by java.lang.Thread
      extended by net.jini.discovery.LookupDiscovery.ResponseListener
All Implemented Interfaces:
Runnable
Enclosing class:
LookupDiscovery

private class LookupDiscovery.ResponseListener
extends Thread

Thread that listens for multicast responses to the multicast requests sent out by the Requestor Thread class. Upon receiving a multicast response, the socket that accepted the connection request associated with the the multicast response is added to the set of pendingDiscoveries so that it (the socket) will be used by the UnicastDiscoveryTask to complete the discovery process asynchronously.

Only 1 instance of this thread is run.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
private  boolean interrupted
          True if thread has been interrupted
 ServerSocket serv
          Server socket for accepting connections
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
LookupDiscovery.ResponseListener()
          Create a daemon thread
 
Method Summary
 int getPort()
          Return the local port of the socket
 void interrupt()
           
 boolean isInterrupted()
          Accessor method that returns the interrupted flag.
 void run()
           
 
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, interrupted, isAlive, isDaemon, 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

serv

public ServerSocket serv
Server socket for accepting connections


interrupted

private volatile boolean interrupted
True if thread has been interrupted

Constructor Detail

LookupDiscovery.ResponseListener

public LookupDiscovery.ResponseListener()
                                 throws IOException
Create a daemon thread

Throws:
IOException
Method Detail

interrupt

public void interrupt()
Overrides:
interrupt in class Thread

isInterrupted

public boolean isInterrupted()
Accessor method that returns the interrupted flag.

Overrides:
isInterrupted in class Thread

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread

getPort

public int getPort()
Return the local port of the socket



Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.