org.mitre.sim.api3.flow
Interface Flow

All Known Implementing Classes:
DirectFlow, ThreadFlow

public interface Flow

Process lifecycle interface. Used to provide each Logical Process with a independent thread of control. Executive implementations contains one instance of a class implementing Flow. Interface Flow exists so that Executives can switch transparently between processes based on Java threads and lightweight thread. Simulation developers do not see or use this interface.


Copyright (c) 2003 The MITRE Corporation


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 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.
 

Method Detail

version

public java.lang.String version()
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).

Returns:
Flow implementation version

registerExecutive

public void registerExecutive(Executive e)
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

Parameters:
e -

elaborate

public void elaborate(LogicalProcess lp)
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

Parameters:
lp -

elaborated

public void elaborated(LogicalProcess lp)
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

Parameters:
lp - LogicalProcess that has finished its elaboration process and is ready to be suspended.

yieldToLP

public void yieldToLP(LogicalProcess lp)
Pass control from the Executive to the specified LogicalProcess.

Called by the Executive process.

Precondition: Executive has control
Postcondition: lp has control

Parameters:
lp - The LogicalProcess choosen for activation bt the Executive.

yieldToExecutive

public void yieldToExecutive(LogicalProcess lp)
Pass control from the specified LogicalProcess to the Executive.

Called by the LogicalProcess process.

Precondition: lp has control
Postcondition: Executive has control

Parameters:
lp - LogicalProcess wishing to yield control to the Executive.

terminateSelf

public void terminateSelf(LogicalProcess lp)
Called by the LogicalProcess process.

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

Parameters:
lp - LogicalProcess to the destroyed.

terminateLP

public void terminateLP(LogicalProcess lp)
Called by the Executive process.

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

Parameters:
lp - LogicalProcess to the destroyed.

delayExecutive

public void delayExecutive(long period)
Suspend the executive execution for the supplied number of millisesconds.

Called by the Executive process.

Parameters:
period - Number of milliseconds to pause the Executive.

pauseExecutive

public void pauseExecutive()
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.


resumeExecutive

public void resumeExecutive()
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.


setProperties

public void setProperties(java.util.Properties p)
Provide the current propertes to the Flow implementation.

Parameters:
p - The set of properties.

setLogger

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

Parameters:
l - The logger for the executive