|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectptolemy.actor.process.BranchController
A BranchController manages the execution of a set of branch objects by monitoring whether the branches have blocked. A branch blocks when it is either unable to get data from its producer receiver or put data into its consumer receiver. When a branch blocks, it registers the block with its branch controller by passing the specific receiver that is blocked. If all of a branch controllers branches are blocked, then the branch controller informs the director associated with its containing composite actors.
Branches are assigned to a branch controller by the director associated with the controller's composite actor via the addBranches() method. This method takes an io port and determine's the port's receivers. Branches are then instantiated and assigned to the receivers according to whether the receivers are producer or consumer receivers.
| Red (davisj) |
| Red (davisj) |
| Constructor Summary | |
BranchController(CompositeActor container)
Construct a branch controller in the specified composite actor container. |
|
| Method Summary | |
protected void |
_branchBlocked(ProcessReceiver receiver)
Increase the count of branches that are blocked trying to do a read or write and register the receiver instigating the blocked branch. |
protected void |
_branchUnBlocked(ProcessReceiver receiver)
Decrease the count of branches that are read or write blocked and note the receiver that is no longer blocked. |
void |
activateBranches()
Activate the branches that are managed by this branch controller. |
void |
addBranches(IOPort port)
Add branches corresponding to the channels of the port argument. |
void |
deactivateBranches()
Deactive the branches assigned to this branch controller. |
java.util.LinkedList |
getBlockedReceivers()
Returned a linked list of the blocked receivers associated with this branch controller. |
java.util.LinkedList |
getBranchList()
Return the list of branches controlled by this controller. |
CompositeActor |
getParent()
Return the composite actor that contains this branch controller. |
boolean |
hasBranches()
Return true if this branch controller controls one or more branches; return false otherwise. |
boolean |
isActive()
Return true if this controller is active; return false otherwise. |
boolean |
isBlocked()
Return true if all of the branches assigned to this branch controller are blocked or if this branch controller has no branches; return false otherwise. |
void |
run()
Begin executing the branches associated with this branch controller so that they will begin transferring data in their assigned channels. |
void |
setActive(boolean active)
Set this branch controller active if the active parameter is true; set this branch controller to inactive otherwise. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public BranchController(CompositeActor container)
container - The parent actor that contains this object.| Method Detail |
public void activateBranches()
public void addBranches(IOPort port)
throws IllegalActionException
port - The port for which branches will be added to this
controller.
IllegalActionException - If branches for the
port have been previously added to this controller or
if the port input/output polarity does not match that
of ports for whom branches were previously add to this
controller.public void deactivateBranches()
public java.util.LinkedList getBlockedReceivers()
public java.util.LinkedList getBranchList()
public CompositeActor getParent()
public boolean hasBranches()
public boolean isActive()
public boolean isBlocked()
public void run()
run in interface java.lang.Runnablepublic void setActive(boolean active)
active - The indicator of whether this branch controller
will be set active or inactive.protected void _branchBlocked(ProcessReceiver receiver)
receiver - The process receiver that is being registered
as blocked.protected void _branchUnBlocked(ProcessReceiver receiver)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||