groupmgmt.impl
Class SinglePhaseDisseminator.MessageListener

java.lang.Object
  extended byjava.lang.Thread
      extended bygroupmgmt.impl.SinglePhaseDisseminator.MessageListener
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
SinglePhaseDisseminator

private class SinglePhaseDisseminator.MessageListener
extends java.lang.Thread

A private inner class to listen for group changes (non-leaders) or notification messages (leaders).


Field Summary
private  java.lang.Thread running
          Keep track of the running thread.
private  java.net.ServerSocket ss
          The socket to use to listen for messages
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SinglePhaseDisseminator.MessageListener()
          Init running variable
 
Method Summary
 void halt()
          Halt the thread.
 void run()
          This method overrides the Thread run method.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

running

private java.lang.Thread running
Keep track of the running thread.


ss

private java.net.ServerSocket ss
The socket to use to listen for messages

Constructor Detail

SinglePhaseDisseminator.MessageListener

public SinglePhaseDisseminator.MessageListener()
Init running variable

Method Detail

run

public void run()
This method overrides the Thread run method. It opens a socket on the disseminatorPort port, and blocks on accept on this socket. When a message is received, the listener passes it to the outer class and then waits for more messages.


halt

public void halt()
Halt the thread. The thread is halted by setting the running variable to null. This cause the run method to complete the current iteration and then quit.