base.helperThreads
Class TimeTriggeredReaderThread

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

public abstract class TimeTriggeredReaderThread
extends java.lang.Thread

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

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  TimeTrigger timeTrigger
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
TimeTriggeredReaderThread(Port port, TimeTrigger timeTrigger)
          Allocates a new ReaderThread that reads from port at the time signals evoked by the TimeTrigger.
 
Method Summary
protected  MessageInterface read()
          Awaits a timed 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

timeTrigger

protected TimeTrigger timeTrigger
Constructor Detail

TimeTriggeredReaderThread

public TimeTriggeredReaderThread(Port port,
                                 TimeTrigger timeTrigger)
Allocates a new ReaderThread that reads from port at the time signals evoked by the TimeTrigger.

Parameters:
port - - Port for writing.
timeTrigger - - TimeTrigger for signals.
Method Detail

read

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

Returns:
item
Throws:
AwaitDuringSignalingException

run

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