org.echarts
Class InternalPort

java.lang.Object
  extended by org.echarts.Port
      extended by org.echarts.LocalPort
          extended by org.echarts.OutputPort
              extended by org.echarts.InternalPort
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, PortReference

public final class InternalPort
extends OutputPort

Port used to exchange messages between a machine and it ancestors or its descendants so that it is possible for messages to fire machine message transitions. The port has one queue to be used for receiving messages from other machines or for sending messages to other machines.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.echarts.LocalPort
inputQueue
 
Fields inherited from interface org.echarts.PortReference
serialVersionUID
 
Constructor Summary
InternalPort(TransitionMachine machine, java.lang.String name)
           
 
Method Summary
 void clear(Machine otherMachine)
          Clears contents of port's queue from specified machine.
 void flush(OutputPort otherPort, Machine otherMachine)
          Flush contents of this port's queue to specified otherPort's queue from specified machine.
 PortProperties getMonitorProperties()
          Gets this port's monitor properties.
 void output(java.lang.Object message, Machine otherMachine)
          Puts message in port's input queue.
 java.lang.String toString()
           
 
Methods inherited from class org.echarts.LocalPort
clearMachineReference, getDynamicChildIndex, getDynamicParent, getInputQueue, isPossiblyReferencedBy, isPossiblyReferencedBySupermachineOf, isUniquelyReferenced, isUniquelyReferencedByMachine, setMachineReference
 
Methods inherited from class org.echarts.Port
equals, getID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InternalPort

public InternalPort(TransitionMachine machine,
                    java.lang.String name)
Parameters:
machine - - machine in which port declared ("owning" machine)
name - - symbolic name used in debug output
Method Detail

output

public final void output(java.lang.Object message,
                         Machine otherMachine)
                  throws java.lang.Exception
Puts message in port's input queue. Port argument of input PortMessage indicates destination port (this port). Ensures that specified otherMachine is an ancestor/descendant of the port's creating machine, otherwise throws an exception.

Specified by:
output in class OutputPort
Throws:
java.lang.Exception

clear

public final void clear(Machine otherMachine)
                 throws java.lang.Exception
Clears contents of port's queue from specified machine.

Throws:
java.lang.Exception

flush

public final void flush(OutputPort otherPort,
                        Machine otherMachine)
                 throws java.lang.Exception
Flush contents of this port's queue to specified otherPort's queue from specified machine.

Throws:
java.lang.Exception

getMonitorProperties

public final PortProperties getMonitorProperties()
Gets this port's monitor properties.

Specified by:
getMonitorProperties in class LocalPort

toString

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