org.echarts
Class ExternalPort

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

public class ExternalPort
extends OutputPort
implements ExternalPortReference

Port used to exchange messages between a machine and an external entity so that it is possible for external messages to fire machine message transitions. Can be exported for remote access via RMI. The machine's environment asynchronously sends messages to the port using the input() method. Optionally, the environment can initialize this port with a (remote) peer external port reference . This port's output() method will put objects in the peer port's input queue for the environment to receive.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.echarts.LocalPort
inputQueue
 
Fields inherited from interface org.echarts.PortReference
serialVersionUID
 
Constructor Summary
ExternalPort(java.lang.String name)
           
ExternalPort(java.lang.String name, ExternalPortReference peer)
          Version of constructor used to initialize value of a peer external port.
 
Method Summary
 PortProperties getMonitorProperties()
          Gets this port's monitor properties.
 ExternalPortReference getRemote()
          Returns remote reference to this port.
 void input(java.lang.Object message)
          Puts message in port's input queue.
 void output(java.lang.Object message, Machine machine)
          Output a PortMessage to the port's (remote) peer port.
 void setPeer(ExternalPortReference peer)
          Sets this port's peer port.
 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
 
Methods inherited from interface org.echarts.PortReference
getID
 

Constructor Detail

ExternalPort

public ExternalPort(java.lang.String name)

ExternalPort

public ExternalPort(java.lang.String name,
                    ExternalPortReference peer)
Version of constructor used to initialize value of a peer external port. Alternately can use setPeer() method.

Method Detail

output

public void output(java.lang.Object message,
                   Machine machine)
            throws java.lang.Exception
Output a PortMessage to the port's (remote) peer port. Throws a port exception if peer not initialized.

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

input

public void input(java.lang.Object message)
           throws java.lang.Exception
Puts message in port's input queue. Port argument of input PortMessage indicates destination port (this port).

Specified by:
input in interface ExternalPortReference
Throws:
java.lang.Exception

getRemote

public ExternalPortReference getRemote()
Returns remote reference to this port. Remote reference can be used by external entities to input() messages to the port via RMI.


setPeer

public final void setPeer(ExternalPortReference peer)
Sets this port's peer port.


getMonitorProperties

public 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