ptolemy.distributed.actor
Class DistributedTypedIORelation

java.lang.Object
  extended by ptolemy.kernel.util.NamedObj
      extended by ptolemy.kernel.Relation
          extended by ptolemy.kernel.ComponentRelation
              extended by ptolemy.actor.IORelation
                  extended by ptolemy.actor.TypedIORelation
                      extended by ptolemy.distributed.actor.DistributedTypedIORelation
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

public class DistributedTypedIORelation
extends TypedIORelation

Extension of TypedIORelation for distributed environments. It overrides the deepReceivers method that returns the connected receivers to this relation. In this case, the relation only contains (is connected to) one DistributedReceiver in charge of forwarding tokens to the distributed services that are connected.

Since:
Ptolemy II 5.1
Version:
$Id: DistributedTypedIORelation.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Daniel Lazaro Cuadrado (kapokasa@kom.aau.dk)
See Also:
DistributedReceiver, Serialized Form
Accepted Rating:
Red (cxh)
Proposed Rating:
Red (kapokasa)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
 
Field Summary
private  TypedIOPort connectedPort
          The port that the DistributedReceiver contained is connected to.
private  Receiver[][] intermediateReceiver
          Bidimensional array of Receiver to be returned by deepReceivers.
private  boolean VERBOSE
          Activates debugging information.
 
Fields inherited from class ptolemy.actor.IORelation
_USE_NEW_WIDTH_INFERENCE_ALGO, CONFIGURATION, width, WIDTH_TO_INFER
 
Fields inherited from class ptolemy.kernel.Relation
_linkList
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Constructor Summary
DistributedTypedIORelation()
          Construct a relation in the default workspace with an empty string as its name.
DistributedTypedIORelation(CompositeEntity container, java.lang.String name)
          Construct a relation with the given name contained by the specified entity.
DistributedTypedIORelation(Workspace workspace)
          Construct a relation in the specified workspace with an empty string as a name.
 
Method Summary
 Receiver[][] deepReceivers(IOPort except)
          Return the receivers of all input ports linked to this relation.
private  void init()
          Creates a DistributedReceiver and assigns it to the intermediateReceiver data structure.
 void setServicesReceiversListMap(java.util.HashMap servicesReceiversListMap)
          Specify the servicesReceiversListMap for the internal DistributedReceiver.
 
Methods inherited from class ptolemy.actor.TypedIORelation
_checkContainer, _checkPort, _checkRelation
 
Methods inherited from class ptolemy.actor.IORelation
_description, _skipWidthInference, attributeChanged, clone, getWidth, isWidthFixed, linkedDestinationPortList, linkedDestinationPortList, linkedDestinationPorts, linkedDestinationPorts, linkedSourcePortList, linkedSourcePortList, linkedSourcePorts, linkedSourcePorts, needsWidthInference, setContainer, setWidth
 
Methods inherited from class ptolemy.kernel.ComponentRelation
_propagateExistence, deepLinkedPortList, deepLinkedPorts, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, unlinkAll
 
Methods inherited from class ptolemy.kernel.Relation
_getContainedObject, link, linkedObjectsList, linkedPortList, linkedPortList, linkedPorts, linkedPorts, numLinks, relationGroupList, unlink
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _recordDecoratedAttributes, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, propagateExistence, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VERBOSE

private boolean VERBOSE
Activates debugging information.


connectedPort

private TypedIOPort connectedPort
The port that the DistributedReceiver contained is connected to.


intermediateReceiver

private Receiver[][] intermediateReceiver
Bidimensional array of Receiver to be returned by deepReceivers.

Constructor Detail

DistributedTypedIORelation

public DistributedTypedIORelation()
Construct a relation in the default workspace with an empty string as its name. Add the relation to the directory of the workspace.


DistributedTypedIORelation

public DistributedTypedIORelation(Workspace workspace)
Construct a relation in the specified workspace with an empty string as a name. You can then change the name with setName(). If the workspace argument is null, then use the default workspace. Add the relation to the workspace directory.

Parameters:
workspace - The workspace that will list the relation.

DistributedTypedIORelation

public DistributedTypedIORelation(CompositeEntity container,
                                  java.lang.String name)
                           throws IllegalActionException,
                                  NameDuplicationException
Construct a relation with the given name contained by the specified entity. The container argument must not be null, or a NullPointerException will be thrown. This relation will use the workspace of the container for synchronization and version counts. If the name argument is null, then the name is set to the empty string. This constructor write-synchronizes on the workspace.

Parameters:
container - The container.
name - The name of the relation.
Throws:
IllegalActionException - If the container is incompatible with this relation.
NameDuplicationException - If the name coincides with a relation already in the container.
Method Detail

deepReceivers

public Receiver[][] deepReceivers(IOPort except)
Return the receivers of all input ports linked to this relation.

Overrides:
deepReceivers in class IORelation
Parameters:
except - The port to exclude.
Returns:
The receivers associated with this relation.
See Also:
IOPort.getRemoteReceivers()

setServicesReceiversListMap

public void setServicesReceiversListMap(java.util.HashMap servicesReceiversListMap)
Specify the servicesReceiversListMap for the internal DistributedReceiver.

Parameters:
servicesReceiversListMap - for the internal DistributedReceiver.

init

private void init()
Creates a DistributedReceiver and assigns it to the intermediateReceiver data structure. The container of the receiver is set to connectedPort.