org.mitre.sim.api3.flow.direct
Class DirectFlow

java.lang.Object
  extended byorg.mitre.sim.api3.flow.direct.DirectFlow
All Implemented Interfaces:
Flow

public class DirectFlow
extends java.lang.Object
implements Flow


Constructor Summary
DirectFlow()
           
 
Method Summary
 void delayExecutive(long period)
          Suspend the executive execution for the supplied number of millisesconds.
 void elaborate(LogicalProcess lp)
          Create a new process for the supplied LogicalProcess.
 void elaborated(LogicalProcess lp)
          Informs the Flow implementation that a new process is created and then suspends that new process.
 void pauseExecutive()
          Suspend the executive execution until a call to resumeExecutive is made.
 void registerExecutive(Executive e)
          Create the linkage between the Flow implementation and the Executive inplementation it supports.
 void resumeExecutive()
          Resume the executive execution that was suspended by a call to pauseExecutive.
 void setDebug(boolean b)
           
 void setLogger(java.util.logging.Logger l)
          Provides a logger that the executive uses to log diagnostic and other error messages.
 void setProperties(java.util.Properties p)
          Provide the current propertes to the Flow implementation.
 void terminateLP(LogicalProcess lp)
          Called by the Executive process.
 void terminateSelf(LogicalProcess lp)
          Called by the LogicalProcess process.
 java.lang.String version()
          Returns the version of the class implementing interface Flow.
 void yieldToExecutive(LogicalProcess lp)
          Pass control from the specified LogicalProcess to the Executive.
 void yieldToLP(LogicalProcess lp)
          Pass control from the Executive to the specified LogicalProcess.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectFlow

public DirectFlow()
Method Detail

version

public java.lang.String version()
Description copied from interface: Flow
Returns the version of the class implementing interface Flow. Used not only to confirm the version of the implementation but also the nature of the implementation (Java thread of lightweight threads).

Specified by:
version in interface Flow
Returns:
Flow implementation version

registerExecutive

public void registerExecutive(Executive e)
Description copied from interface: Flow
Create the linkage between the Flow implementation and the Executive inplementation it supports.

Call by the executive process.

Precondition: Executive has control
Postcondition: Executive has control

Specified by:
registerExecutive in interface Flow
Parameters:
e -

yieldToLP

public void yieldToLP(LogicalProcess lp)
Description copied from interface: Flow
Pass control from the Executive to the specified LogicalProcess.

Called by the Executive process.

Precondition: Executive has control
Postcondition: lp has control

Specified by:
yieldToLP in interface Flow
Parameters:
lp - The LogicalProcess choosen for activation bt the Executive.

yieldToExecutive

public void yieldToExecutive(LogicalProcess lp)
Description copied from interface: Flow
Pass control from the specified LogicalProcess to the Executive.

Called by the LogicalProcess process.

Precondition: lp has control
Postcondition: Executive has control

Specified by:
yieldToExecutive in interface Flow
Parameters:
lp - LogicalProcess wishing to yield control to the Executive.

elaborate

public void elaborate(LogicalProcess lp)
Description copied from interface: Flow
Create a new process for the supplied LogicalProcess.

Call by the executive process.

Precondition: Executive has control and lp process does not exist
Postcondition: Executive has control and lp process exist and lp process is suspended

Specified by:
elaborate in interface Flow
Parameters:
lp -

elaborated

public void elaborated(LogicalProcess lp)
Description copied from interface: Flow
Informs the Flow implementation that a new process is created and then suspends that new process.

Called by the LogicalProcess process.

Precondition: lp has control
Postcondition: Executive has control

Specified by:
elaborated in interface Flow
Parameters:
lp - LogicalProcess that has finished its elaboration process and is ready to be suspended.

terminateSelf

public void terminateSelf(LogicalProcess lp)
Description copied from interface: Flow
Called by the LogicalProcess process.

Precondition: lp has control
Postcondition: lp process does not exist and Executive has control

Specified by:
terminateSelf in interface Flow
Parameters:
lp - LogicalProcess to the destroyed.

terminateLP

public void terminateLP(LogicalProcess lp)
Description copied from interface: Flow
Called by the Executive process.

Precondition: Executive has control
Postcondition: lp process does not exist and Executive has control

Specified by:
terminateLP in interface Flow
Parameters:
lp - LogicalProcess to the destroyed.

delayExecutive

public void delayExecutive(long period)
Description copied from interface: Flow
Suspend the executive execution for the supplied number of millisesconds.

Called by the Executive process.

Specified by:
delayExecutive in interface Flow
Parameters:
period - Number of milliseconds to pause the Executive.

pauseExecutive

public void pauseExecutive()
Description copied from interface: Flow
Suspend the executive execution until a call to resumeExecutive is made. This method has no effect if the Executive is already paused.

Called by a process outside of the Executive.

Specified by:
pauseExecutive in interface Flow

resumeExecutive

public void resumeExecutive()
Description copied from interface: Flow
Resume the executive execution that was suspended by a call to pauseExecutive. This method has no effect if the Executive is already running.

Called by a process outside of the Executive.

Specified by:
resumeExecutive in interface Flow

setDebug

public void setDebug(boolean b)

setProperties

public void setProperties(java.util.Properties p)
Description copied from interface: Flow
Provide the current propertes to the Flow implementation.

Specified by:
setProperties in interface Flow
Parameters:
p - The set of properties.

setLogger

public void setLogger(java.util.logging.Logger l)
Description copied from interface: Flow
Provides a logger that the executive uses to log diagnostic and other error messages.

Specified by:
setLogger in interface Flow
Parameters:
l - The logger for the executive