DRCL J-Sim API

drcl.comp
Class ACARuntime

java.lang.Object
  extended bydrcl.DrclObj
      extended bydrcl.comp.ForkManager
          extended bydrcl.comp.ACARuntime
All Implemented Interfaces:
java.lang.Cloneable, ObjectCloneable, ObjectDuplicable, java.io.Serializable
Direct Known Subclasses:
ARuntime, SESimulator, SESimulatorOld

public abstract class ACARuntime
extends ForkManager

Defines the interface of an ACA runtime.

See Also:
Serialized Form

Field Summary
 boolean debug
           
static ACARuntime DEFAULT_RUNTIME
           
 boolean logenabled
           
 boolean resetting
          Whether the runtime is in resetting or not.
static java.lang.String State_INACTIVE
          State of no thread running or waiting to be started.
static java.lang.String State_RUNNING
          State of have threads running.
static java.lang.String State_SUSPENDED
          State of system suspended.
 
Constructor Summary
ACARuntime()
           
ACARuntime(java.lang.String name_)
           
 
Method Summary
 java.lang.String a_info()
          Asynchronous version of diag().
abstract  java.lang.String a_info(boolean listWaitingTasks_)
          Asynchronous version of diag(boolean).
 void addDebugLevel(java.lang.String trace_)
           
 void addRunHook(java.lang.Runnable hook_)
          Adds the "run" hook to the simulator.
 void addRunnable(double later_, Port port_, java.lang.Runnable task_)
           
 void addRunnable(double later_, java.lang.Runnable task_)
           
 void addRunnableAt(double time_, Port port_, java.lang.Runnable task_)
           
 void addRunnableAt(double time_, java.lang.Runnable task_)
           
 void addStateListener(java.beans.PropertyChangeListener l_)
           
 void addStopHook(java.lang.Runnable hook_)
          Adds the "stop" hook to the simulator.
 void addSuspendHook(java.lang.Runnable hook_)
          Adds the "suspend" hook to the simulator.
 boolean containsDebugLevel(java.lang.String trace_)
           
 java.lang.String debug_info()
           
 java.lang.String diag()
          Returns more detailed information of this runtime, for diagnosis purpose.
 java.lang.String diag(boolean listWaitingTasks_)
          Returns more detailed information of this runtime, for diagnosis purpose.
 java.lang.String[] getAllDebugLevels()
           
 java.beans.PropertyChangeListener[] getAllStateListeners()
           
abstract  java.lang.Object getEventQueue()
           
abstract  double getEventRate()
          Returns the event processing rate of this runtime.
 java.lang.String getName()
           
abstract  long getNumberOfArrivalEvents()
          Returns the number of arrival events.
 ForkManager getParent()
           
 java.lang.String getState()
           
 double getTime()
          Returns the system current time in second.
 double getTimeScale()
           
abstract  long getWallTimeElapsed()
          Returns the actual time (in ms) for which this runtime has participated.
abstract  java.lang.String info()
          Returns general information of this runtime.
 boolean isDebugEnabled()
           
 boolean isDebugEnabledAt(java.lang.String which_)
           
 boolean isIdle()
          Returns true if the runtime is stopped (inactive or suspended) or running but all working threads are waiting.
 boolean isRunning()
          Returns true if the runtime is running.
 boolean isStopped()
          Returns true if the runtime is either inactive or suspended.
 boolean isSuspended()
          Returns true if the runtime is suspended.
 void notifyStateListeners(java.beans.PropertyChangeEvent e_)
           
 void reboot()
           
 void removeAllRunHooks()
          Removes all "run" hooks.
 void removeAllStopHooks()
          Removes all "stop" hooks.
 void removeAllSuspendHooks()
          Removes all "suspend" hooks.
 void removeDebugLevel(java.lang.String trace_)
           
 void removeRunHook(java.lang.Runnable hook_)
          Removes the "run" hook.
 void removeStateListener(java.beans.PropertyChangeListener l_)
           
 void removeStopHook(java.lang.Runnable hook_)
          Removes the "stop" hook.
 void removeSuspendHook(java.lang.Runnable hook_)
          Removes the "suspend" hook.
abstract  void reset()
           
abstract  void resume()
          Resumes the system.
 void resumeFor(double later_)
          Resumes the system and lets it run for the time duration specified.
 void resumeTo(double time_)
          Resumes the system and lets it run for the time duration specified.
 void setDebugEnabled(boolean enabled_)
           
 void setDebugEnabledAt(java.lang.String level_, boolean enabled_)
           
 void setDebugLevels(java.lang.String[] traces_)
           
 void setMaxWorkforce(int maxwf_)
           
 void setName(java.lang.String name_)
           
 void setParent(ForkManager parent_)
           
 void setRuntime(ACARuntime runtime_)
           
 void setTimeScale(double e_)
          Time scale is the ratio of wall time over system time.
 void stop()
          Stops the system.
 void stop(double later_)
          Stops the system at the time specified later.
 void stopAt(double time_)
          Stops the system at the time specified.
 java.lang.String t_info()
           
 void takeover(Component c_)
          Takes over as the fork manager of the component system under c_.
 void takeover(java.lang.Object[] oo_)
           
 java.lang.String toString()
           
 java.lang.String tr_info()
           
 
Methods inherited from class drcl.comp.ForkManager
a_list, getRuntime, info, list, takeover
 
Methods inherited from class drcl.DrclObj
clone, duplicate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_RUNTIME

public static final ACARuntime DEFAULT_RUNTIME

State_INACTIVE

public static final java.lang.String State_INACTIVE
State of no thread running or waiting to be started.

See Also:
Constant Field Values

State_RUNNING

public static final java.lang.String State_RUNNING
State of have threads running.

See Also:
Constant Field Values

State_SUSPENDED

public static final java.lang.String State_SUSPENDED
State of system suspended.

See Also:
Constant Field Values

debug

public boolean debug

resetting

public transient boolean resetting
Whether the runtime is in resetting or not.


logenabled

public boolean logenabled
Constructor Detail

ACARuntime

public ACARuntime()

ACARuntime

public ACARuntime(java.lang.String name_)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class ForkManager

takeover

public void takeover(java.lang.Object[] oo_)

takeover

public void takeover(Component c_)
Description copied from class: ForkManager
Takes over as the fork manager of the component system under c_.

Overrides:
takeover in class ForkManager

setTimeScale

public void setTimeScale(double e_)
Time scale is the ratio of wall time over system time.


getTimeScale

public double getTimeScale()

setName

public void setName(java.lang.String name_)
Overrides:
setName in class ForkManager

getName

public java.lang.String getName()
Overrides:
getName in class ForkManager

setMaxWorkforce

public void setMaxWorkforce(int maxwf_)

info

public abstract java.lang.String info()
Returns general information of this runtime.


diag

public java.lang.String diag()
Returns more detailed information of this runtime, for diagnosis purpose.


diag

public java.lang.String diag(boolean listWaitingTasks_)
Returns more detailed information of this runtime, for diagnosis purpose.


a_info

public java.lang.String a_info()
Asynchronous version of diag().


a_info

public abstract java.lang.String a_info(boolean listWaitingTasks_)
Asynchronous version of diag(boolean).

Specified by:
a_info in class ForkManager

addRunnable

public final void addRunnable(double later_,
                              java.lang.Runnable task_)

addRunnableAt

public final void addRunnableAt(double time_,
                                java.lang.Runnable task_)

addRunnable

public final void addRunnable(double later_,
                              Port port_,
                              java.lang.Runnable task_)

addRunnableAt

public final void addRunnableAt(double time_,
                                Port port_,
                                java.lang.Runnable task_)

addStopHook

public final void addStopHook(java.lang.Runnable hook_)
Adds the "stop" hook to the simulator. The hook is called when the runtime runs out of events.


removeStopHook

public final void removeStopHook(java.lang.Runnable hook_)
Removes the "stop" hook.


removeAllStopHooks

public final void removeAllStopHooks()
Removes all "stop" hooks.


addSuspendHook

public final void addSuspendHook(java.lang.Runnable hook_)
Adds the "suspend" hook to the simulator. The hook is called when the runtime is suspended.


removeSuspendHook

public final void removeSuspendHook(java.lang.Runnable hook_)
Removes the "suspend" hook.


removeAllSuspendHooks

public final void removeAllSuspendHooks()
Removes all "suspend" hooks.


addRunHook

public final void addRunHook(java.lang.Runnable hook_)
Adds the "run" hook to the simulator. The hook is called when the runtime starts to run or is resumed.


removeRunHook

public final void removeRunHook(java.lang.Runnable hook_)
Removes the "run" hook.


removeAllRunHooks

public final void removeAllRunHooks()
Removes all "run" hooks.


getNumberOfArrivalEvents

public abstract long getNumberOfArrivalEvents()
Returns the number of arrival events.


getEventRate

public abstract double getEventRate()
Returns the event processing rate of this runtime.


getTime

public double getTime()
Returns the system current time in second.


stop

public final void stop()
Stops the system. The state must be SUSPENDED when the method returns.


resume

public abstract void resume()
Resumes the system. The state must advance to RUNNING when this method returns.


stop

public final void stop(double later_)
Stops the system at the time specified later.


stopAt

public final void stopAt(double time_)
Stops the system at the time specified.


resumeFor

public final void resumeFor(double later_)
Resumes the system and lets it run for the time duration specified. The state must advance to RUNNING when this method returns.


resumeTo

public final void resumeTo(double time_)
Resumes the system and lets it run for the time duration specified. The state must advance to RUNNING when this method returns.


reset

public abstract void reset()
Overrides:
reset in class ForkManager

getWallTimeElapsed

public abstract long getWallTimeElapsed()
Returns the actual time (in ms) for which this runtime has participated.


t_info

public java.lang.String t_info()

reboot

public void reboot()

addStateListener

public void addStateListener(java.beans.PropertyChangeListener l_)

removeStateListener

public void removeStateListener(java.beans.PropertyChangeListener l_)

getAllStateListeners

public java.beans.PropertyChangeListener[] getAllStateListeners()

notifyStateListeners

public void notifyStateListeners(java.beans.PropertyChangeEvent e_)

getState

public java.lang.String getState()

isRunning

public boolean isRunning()
Returns true if the runtime is running.


isStopped

public boolean isStopped()
Returns true if the runtime is either inactive or suspended.


isSuspended

public boolean isSuspended()
Returns true if the runtime is suspended.


isIdle

public boolean isIdle()
Returns true if the runtime is stopped (inactive or suspended) or running but all working threads are waiting.


tr_info

public java.lang.String tr_info()

setDebugEnabled

public void setDebugEnabled(boolean enabled_)
Overrides:
setDebugEnabled in class ForkManager

isDebugEnabled

public boolean isDebugEnabled()
Overrides:
isDebugEnabled in class ForkManager

isDebugEnabledAt

public boolean isDebugEnabledAt(java.lang.String which_)

getAllDebugLevels

public java.lang.String[] getAllDebugLevels()

setDebugLevels

public void setDebugLevels(java.lang.String[] traces_)

addDebugLevel

public void addDebugLevel(java.lang.String trace_)

removeDebugLevel

public void removeDebugLevel(java.lang.String trace_)

containsDebugLevel

public boolean containsDebugLevel(java.lang.String trace_)

setDebugEnabledAt

public void setDebugEnabledAt(java.lang.String level_,
                              boolean enabled_)

debug_info

public java.lang.String debug_info()

getParent

public ForkManager getParent()
Overrides:
getParent in class ForkManager

setParent

public void setParent(ForkManager parent_)
Overrides:
setParent in class ForkManager

setRuntime

public void setRuntime(ACARuntime runtime_)
Overrides:
setRuntime in class ForkManager

getEventQueue

public abstract java.lang.Object getEventQueue()

DRCL J-Sim API

Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved.     ~ To J-Sim Home ~