ptolemy.domains.ci.kernel
Class ActiveActorManager

java.lang.Object
  extended by java.lang.Thread
      extended by ptolemy.kernel.util.PtolemyThread
          extended by ptolemy.domains.ci.kernel.ActiveActorManager
All Implemented Interfaces:
java.lang.Runnable, Debuggable

public class ActiveActorManager
extends PtolemyThread

An active actor manager iterates an active actor until its postfire() returns false, or the director is requested to stop. If the active actor has pull input and its prefire() returns false, the actor manager will notify the CI director to process the pull request by the actor. When the actor has a period parameter, the actor manager will sleep between successive iterations of the actor for the duration given by the parameter, in milliseconds. This is used to control the execution rate of active actors that are always ready to produce the next output or request the next input.

Since:
Ptolemy II 3.0
Version:
$Id: ActiveActorManager.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Xiaojun Liu, Yang Zhao
Accepted Rating:
Red (liuxj)
Proposed Rating:
Yellow (liuxj)

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private  Actor _actor
           
private  CIDirector _director
           
private  boolean _isPushSource
           
private  Manager _manager
           
private  int _period
           
 
Fields inherited from class ptolemy.kernel.util.PtolemyThread
_debugging, _debugListeners
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ActiveActorManager(Actor actor, CIDirector director)
          Construct an actor manager to iterate the actor.
 
Method Summary
private  void _init()
           
 void run()
          Iterate the actor until its postfire() returns false, or the director is requested to stop.
 
Methods inherited from class ptolemy.kernel.util.PtolemyThread
_debug, _debug, addDebugListener, removeDebugListener
 
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

_actor

private Actor _actor

_director

private CIDirector _director

_manager

private Manager _manager

_isPushSource

private boolean _isPushSource

_period

private int _period
Constructor Detail

ActiveActorManager

public ActiveActorManager(Actor actor,
                          CIDirector director)
                   throws IllegalActionException
Construct an actor manager to iterate the actor.

Parameters:
actor - The actor that is managed.
director - The director of the actor.
Throws:
IllegalActionException
Method Detail

run

public void run()
Iterate the actor until its postfire() returns false, or the director is requested to stop.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

_init

private void _init()
            throws IllegalActionException
Throws:
IllegalActionException