base.helperThreads
Class TimeTriggeredWriterThread

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

public abstract class TimeTriggeredWriterThread
extends java.lang.Thread

Abstract class for a thread that writes into a port and evokes a signal to on a given Signal (for weaking up readers) at given a signal from a TimeTrigger.

Version:
0.1
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
           
protected  TimeTrigger timeTrigger
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
TimeTriggeredWriterThread(Port port, Signal signal)
          Allocates a new WriterThread that writes to the port and uses the signal for synchronization.
TimeTriggeredWriterThread(Port port, TimeTrigger timeTrigger)
          Allocates a new WriterThread that writes to the port at the time signals evoked by the TimeTrigger.
 
Method Summary
abstract  void run()
           
protected  void writePortAndSignal(MessageInterface item)
          Writes the item into the Port and sends a signal.
 
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

timeTrigger

protected TimeTrigger timeTrigger
Constructor Detail

TimeTriggeredWriterThread

public TimeTriggeredWriterThread(Port port,
                                 TimeTrigger timeTrigger)
Allocates a new WriterThread that writes to the port at the time signals evoked by the TimeTrigger.

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

TimeTriggeredWriterThread

public TimeTriggeredWriterThread(Port port,
                                 Signal signal)
Allocates a new WriterThread that writes to the port and uses the signal for synchronization.

Parameters:
port -
signal -
Method Detail

writePortAndSignal

protected void writePortAndSignal(MessageInterface item)
                           throws SignalDuringSignalingException,
                                  SignalNotAwaitedException
Writes the item into the Port and sends a signal.

Parameters:
item -
Throws:
SignalNotAwaitedException
SignalDuringSignalingException

run

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