base.helperThreads
Class EventTriggeredReaderThread

java.lang.Object
  extended by java.lang.Thread
      extended by base.helperThreads.EventTriggeredReaderThread
All Implemented Interfaces:
java.lang.Runnable

public abstract class EventTriggeredReaderThread
extends java.lang.Thread

Abstract class for a thread that reads from a specified port at a signal evoked by a given Signal.

Version:
0.2
Author:
Bernhard Kast

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  Port port
           
protected  Signal signal
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
EventTriggeredReaderThread(Port port, Signal signal)
          Allocates a new ReaderThread that reads from the port and uses the signal for synchronization.
 
Method Summary
protected  MessageInterface read()
          Awaits a signal, on receiving the signal the item is read.
abstract  void run()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

port

protected Port port

signal

protected Signal signal
Constructor Detail

EventTriggeredReaderThread

public EventTriggeredReaderThread(Port port,
                                  Signal signal)
Allocates a new ReaderThread that reads from the port and uses the signal for synchronization.

Parameters:
port -
signal -
Method Detail

read

protected MessageInterface read()
                         throws AwaitDuringSignalingException
Awaits a signal, on receiving the signal the item is read.

Returns:
- The item from the port.
Throws:
AwaitDuringSignalingException

run

public abstract void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread