net.jini.discovery
Class LookupDiscovery.AnnouncementListener

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

private class LookupDiscovery.AnnouncementListener
extends Thread

Thread that listens for multicast announcements from lookup services.

If the announcements are from a lookup service that has not already been discovered, and if it is determined that the lookup service belongs to at least one group of interest, a "pendingDiscovery" is queued for the UnicastDiscoveryTask to process asynchronously, completing the discovery process by performing unicast discovery.

If the announcements are from a lookup service that has already been discovered, the lookup service's member groups - as indicated in the announcements - are analyzed for changes that may result in either the lookup service being discarded, or in a changed event being sent.

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
private  ArrayList retryNics
           
private  MulticastSocket sock
          Multicast socket for receiving packets
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
LookupDiscovery.AnnouncementListener()
          Create a daemon thread
 
Method Summary
 void interrupt()
           
 boolean isInterrupted()
          Accessor method that returns the interrupted flag.
private  void retryBadNics()
          Convenience method that retries any previously failed interfaces.
 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

sock

private MulticastSocket sock
Multicast socket for receiving packets


retryNics

private ArrayList retryNics

interrupted

private volatile boolean interrupted
True if thread has been interrupted

Constructor Detail

LookupDiscovery.AnnouncementListener

public LookupDiscovery.AnnouncementListener()
                                     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

retryBadNics

private void retryBadNics()
Convenience method that retries any previously failed interfaces.


run

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


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