org.echarts
Class LocalPort

java.lang.Object
  extended by org.echarts.Port
      extended by org.echarts.LocalPort
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, PortReference
Direct Known Subclasses:
AnyPort, OutputPort, TransitionTimerPort

public abstract class LocalPort
extends Port

This represents the common operations one can perform on a port that is local to an EChart. FSM message transitions can only refer to LocalPort instances.

See Also:
Serialized Form

Field Summary
protected  FIFOImpl inputQueue
          Queue into which messages are placed by peer ports.
 
Fields inherited from interface org.echarts.PortReference
serialVersionUID
 
Constructor Summary
LocalPort()
           
 
Method Summary
protected  void clearMachineReference(Machine machine)
           
protected  int getDynamicChildIndex()
           
protected  DynamicMachine getDynamicParent()
           
 FIFOImpl getInputQueue()
           
abstract  PortProperties getMonitorProperties()
          Returns port properties for this port.
protected  boolean isPossiblyReferencedBy(Machine machine)
          Used in Machine.getMaxEnabledMessageTransition() to guide search for enabledMessageTransitions.
protected  boolean isPossiblyReferencedBySupermachineOf(Machine machine)
          Used by Machine.getMaxEnabledMessageTransition to determine if neccessary to look for additional enabled message transitions.
protected  boolean isUniquelyReferenced()
           
protected  boolean isUniquelyReferencedByMachine(Machine machine)
           
protected  void setMachineReference(Machine machine, DynamicMachine dynamicParent, int dynamicChildIndex)
          Sets machine reference to least common ancestor of current reference and 'machine' parameter.
 
Methods inherited from class org.echarts.Port
equals, getID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inputQueue

protected FIFOImpl inputQueue
Queue into which messages are placed by peer ports.

Constructor Detail

LocalPort

public LocalPort()
Method Detail

getInputQueue

public FIFOImpl getInputQueue()

setMachineReference

protected void setMachineReference(Machine machine,
                                   DynamicMachine dynamicParent,
                                   int dynamicChildIndex)
                            throws MachineException
Sets machine reference to least common ancestor of current reference and 'machine' parameter. Also adds a reference to the max dynamic submachine that exists on path to a machine that defines a transition that references this port. This is used by DynamicMachine.getMaxEnabledMessageTransition() to localize a submachine containing an enabled message transition referencing this port. If a value is already set, then new values are ignored. It is assumed that new values exist at the same or lower levels in the machine hierarchy relative to the current value.

Throws:
MachineException

clearMachineReference

protected void clearMachineReference(Machine machine)
                              throws MachineException
Throws:
MachineException

getDynamicParent

protected DynamicMachine getDynamicParent()

getDynamicChildIndex

protected int getDynamicChildIndex()

isUniquelyReferencedByMachine

protected boolean isUniquelyReferencedByMachine(Machine machine)

isUniquelyReferenced

protected boolean isUniquelyReferenced()

isPossiblyReferencedBy

protected boolean isPossiblyReferencedBy(Machine machine)
                                  throws MachineException
Used in Machine.getMaxEnabledMessageTransition() to guide search for enabledMessageTransitions. Returns true if 'machine' param is submachine or supermachine of lowest common ancestor machine referencing this port. Also true if no LCA machine defined for this port. Otherwise returns false.

Throws:
MachineException

isPossiblyReferencedBySupermachineOf

protected boolean isPossiblyReferencedBySupermachineOf(Machine machine)
                                                throws MachineException
Used by Machine.getMaxEnabledMessageTransition to determine if neccessary to look for additional enabled message transitions. Returns true if least common ancestor machine of machines referencing this port is a supermachine of the 'machine' param. Also returns true if no LCA machine is defined for this port. Otherwise returns false.

Throws:
MachineException

getMonitorProperties

public abstract PortProperties getMonitorProperties()
Returns port properties for this port.