Boeing Simulation 3.1 API Specification

util
Class RTWorkerThread

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--javax.realtime.RealtimeThread
              |
              +--util.RTWorkerThread
All Implemented Interfaces:
Ceaseable, Runnable, Schedulable
Direct Known Subclasses:
AdaptivePeriodicThread

public class RTWorkerThread
extends RealtimeThread
implements Ceaseable

RTWorkerThread.java An adapter class for RealtimeThread that maintains the same API as WorkerThread

Version:
$Revision: 1.11 $
Author:
James Brodman
, Dave Jurgens
See Also:
WorkerThread

Nested Class Summary
protected static class RTWorkerThread.OverrunHandler
           
 
Field Summary
protected  long cost
          The duration in milliseconds that it takes for the logic to execute.
protected static Runnable DEFAULT_OVERRUN_LOGIC
          The default logic that will be executed if the period is overrun.
protected  boolean feasible
          Whether this thread is feasible to execute given its current period and cost.
protected  Runnable logic
          The logic is the runnable that is executed once every period.
protected  Runnable overrunLogic
          The logic that will be run if the execution time exceeds the period.
protected  long period
          The specified time interval in which the logic is executed once.
private static boolean SHOW_FEASIBILITY
          Debug flag for showing feasibility
 
Fields inherited from class javax.realtime.RealtimeThread
deadlineMissHandler, eligibilityParam, groupParam, hasMissedDeadline, hasMissHandlers, hasOverrun, hasStarted, hasStartedTimer, isPeriodic, memoryParam, missCondition, overrunHandler, periodExpired, pipeID_, releaseParam, scheduler, schedulingParam, scopeStack, timeoutHandler_, waitingForNextPeriod
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
RTWorkerThread(Runnable logic, long cost, long period)
           
RTWorkerThread(Runnable logic, long cost, long period, Runnable overrunLogic)
           
 
Method Summary
 void cease()
          Stops the execution of the Ceaseable.
 long getPeriod()
          Returns the time in milliseconds alloted for execution of the logic.
 boolean isFeasible()
          Returns whether this RealtimeThread is capable of meeting hard real-time deadlines given the system resources.
 void run()
           
 
Methods inherited from class javax.realtime.RealtimeThread
addIfFeasible, addToFeasibility, currentRealtimeThread, deschedulePeriodic, executionEligibility, getActiveMemoryArea, getCurrentMemoryArea, getInitialMemoryAreaIndex_, getInitialMemoryAreaIndex, getMemoryAreaStackDepth_, getMemoryAreaStackDepth, getMemoryParameters, getOuterMemoryArea_, getOuterMemoryArea, getProcessingGroupParameters, getReleaseParameters, getScheduler, getSchedulingParameters, getScopeStack, interrupt, removeFromFeasibility, rtfini_, schedulePeriodic, setIfFeasible, setIfFeasible, setIfFeasible, setMemoryParameters, setMemoryParametersIfFeasible, setProcessingGroupParameters, setProcessingGroupParametersIfFeasible, setReleaseParameters, setReleaseParametersIfFeasible, setScheduler, setScheduler, setSchedulingParameters, setSchedulingParametersIfFeasible, setTopMemoryArea, setupTimeoutHandler, setupTSS, sleep, sleep, sleep, sleep, sleep, sleep, start, updatePeriodicParameters, validateSchedulingParameters, waitForNextPeriod, yield
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, stop, stop, suspend, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.Ceaseable
join
 

Field Detail

DEFAULT_OVERRUN_LOGIC

protected static final Runnable DEFAULT_OVERRUN_LOGIC
The default logic that will be executed if the period is overrun. The default action is to state which thread overran its period and then to exit.


logic

protected final Runnable logic
The logic is the runnable that is executed once every period.


overrunLogic

protected final Runnable overrunLogic
The logic that will be run if the execution time exceeds the period.


feasible

protected boolean feasible
Whether this thread is feasible to execute given its current period and cost.


period

protected long period
The specified time interval in which the logic is executed once.


cost

protected final long cost
The duration in milliseconds that it takes for the logic to execute.


SHOW_FEASIBILITY

private static final boolean SHOW_FEASIBILITY
Debug flag for showing feasibility

See Also:
Constant Field Values
Constructor Detail

RTWorkerThread

public RTWorkerThread(Runnable logic,
                      long cost,
                      long period)

RTWorkerThread

public RTWorkerThread(Runnable logic,
                      long cost,
                      long period,
                      Runnable overrunLogic)
Method Detail

getPeriod

public long getPeriod()
Returns the time in milliseconds alloted for execution of the logic.


isFeasible

public boolean isFeasible()
Returns whether this RealtimeThread is capable of meeting hard real-time deadlines given the system resources.


run

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

cease

public void cease()
Description copied from interface: Ceaseable
Stops the execution of the Ceaseable. Objects implementing this method shouldensure the invariant that no additional execution will take place upon this method returning.

Specified by:
cease in interface Ceaseable

Boeing Simulation 3.1 API Specification

To submit a bug or feature email the author of that class. Funding for this research was provided by Boeing and DARPA.