public class CompositeCommunicationAspect extends TypedCompositeActor implements CommunicationAspect, Decorator
When an intermediate receiver sends a token to an input port of this communication aspect, the original receiver and the token are encoded in a RecordToken. When such a token arrives at an output port, the original token is extracted and sent to the original receiver.
Modifier and Type | Class and Description |
---|---|
static class |
CompositeCommunicationAspect.CompositeCommunicationAspectAttributes
Attributes for ports decorated by this composite communication aspect.
|
CompositeEntity.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
protected java.util.HashMap<IOPort,java.util.List<Attribute>> |
_parameters
List of parameters per port.
|
Parameter |
justMonitor
This parameter indicates whether the tokens received via the
ImmediateReceivers are immediately forwarded to the wrapped
receivers or whether they are delayed by this communication aspect
and only forwarded through a CommunicationResponsePort.
|
_actorFiringListeners, _causalityInterface, _derivedPiggybacks, _initializables, _notifyingActorFiring, _piggybacks, _publishedPorts, _publisherRelations, _stopRequested, _subscribedPorts
_levelCrossingLinks
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
decoratorHighlightColorName
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
CompositeCommunicationAspect(CompositeEntity container,
java.lang.String name)
Construct a CompositeCommunicationAspect with a name and a container.
|
CompositeCommunicationAspect(Workspace workspace)
Construct a CompositeCommunicationAspect in the specified workspace with
no container and an empty string as a name.
|
Modifier and Type | Method and Description |
---|---|
void |
attributeChanged(Attribute attribute)
React to the change of the justMonitor attribute by
updating internal variables.
|
java.lang.Object |
clone(Workspace workspace)
Clone the actor into the specified workspace.
|
DecoratorAttributes |
createDecoratorAttributes(NamedObj target)
Return the decorated attributes for the target NamedObj.
|
Receiver |
createIntermediateReceiver(Receiver receiver)
Create an intermediate receiver that wraps a given receiver.
|
java.util.List<NamedObj> |
decoratedObjects()
Return a list of the entities deeply contained by the container
of this resource scheduler.
|
void |
fire()
Override the fire and change the transferring tokens
from and to input/output placeholders.
|
void |
initialize()
Initialize actor, reset variables.
|
boolean |
isGlobalDecorator()
Return true to indicate that this decorator should
decorate objects across opaque hierarchy boundaries.
|
void |
registerListener(CommunicationAspectListener monitor)
Add a communication aspect monitor to the list of listeners.
|
void |
reset()
Reset - nothing to do here.
|
void |
sendToken(Receiver source,
Receiver receiver,
Token token)
Initiate a send of the specified token to the specified
receiver.
|
void |
setContainer(CompositeEntity container)
Override the base class to first set the container, then establish
a connection with any decorated objects it finds in scope in the new
container.
|
void |
setInputPortName(Port port,
java.lang.String inputPortName)
Set the name of the CommunicationRequestPort that will be receiving tokens from
this actor port.
|
_addEntity, _addPort, _addRelation, _checkTypesFromTo, _destinationTypeConstraints, attributeTypeChanged, isBackwardTypeInferenceEnabled, newPort, newRelation, resolveTypes, typeConstraintList, typeConstraints
_actorFiring, _actorFiring, _finishedAddEntity, _setDirector, _transferPortParameterInputs, addActorFiringListener, addInitializable, addPiggyback, connectionsChanged, createReceivers, createSchedule, getCausalityInterface, getDirector, getExecutiveDirector, getManager, getPublishedPort, getPublishedPortChannel, getPublishedPorts, getSubscribedPortChannel, inferringWidths, inferWidths, inputPortList, isFireFunctional, isOpaque, isPublishedPort, isStrict, iterate, linkToPublishedPort, linkToPublishedPort, linkToPublishedPort, linkToPublishedPort, needsWidthInference, newInsideReceiver, newReceiver, notifyConnectivityChange, outputPortList, postfire, prefire, preinitialize, recordFiring, registerPublisherPort, registerPublisherPort, removeActorFiringListener, removeInitializable, removePiggyback, requestChange, setDirector, setManager, stop, stopFire, terminate, unlinkToPublishedPort, unlinkToPublishedPort, unlinkToPublishedPort, unlinkToPublishedPort, unregisterPublisherPort, unregisterPublisherPort, wrapup
_adjustDeferrals, _containedDecorators, _deepOpaqueEntityList, _description, _exportMoMLContents, _removeEntity, _removeRelation, _validateSettables, allAtomicEntityList, allowLevelCrossingConnect, classDefinitionList, connect, connect, containedObjectsIterator, deepCompositeEntityList, deepEntityList, deepGetEntities, deepNamedObjList, deepOpaqueEntityList, deepRelationSet, entityList, entityList, exportLinks, exportMoML, getAttribute, getEntities, getEntity, getPort, getRelation, getRelations, isAtomic, lazyAllAtomicEntityList, lazyAllCompositeEntityList, lazyAllCompositeTransparentAndOpaqueEntityList, lazyClassDefinitionList, lazyDeepEntityList, lazyEntityList, lazyRelationList, numberOfEntities, numberOfRelations, numEntities, numRelations, relationList, removeAllEntities, removeAllRelations, setClassDefinition, statistics, uniqueName
_checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
_removePort, connectedPortList, connectedPorts, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts
_setParent, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, clone, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
description, getContainer, getDisplayName, getFullName, getName, getName, setName
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate
addInitializable, preinitialize, removeInitializable, wrapup
getDerivedLevel, getDerivedList, propagateValue
public Parameter justMonitor
public CompositeCommunicationAspect(Workspace workspace) throws IllegalActionException, NameDuplicationException
workspace
- The workspace that will list the actor.IllegalActionException
- If the container is incompatible
with this actor.NameDuplicationException
- If the name coincides with
an actor already in the container.public CompositeCommunicationAspect(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container.name
- The name of this actor.IllegalActionException
- If the container is incompatible
with this actor.NameDuplicationException
- If the name coincides with
an actor already in the container.public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class TypedCompositeActor
attribute
- The attribute that changed.IllegalActionException
- If token in attribute cannot
be accessed.public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone
in class CompositeActor
workspace
- The workspace for the cloned object.java.lang.CloneNotSupportedException
- Not thrown here.NamedObj.exportMoML(Writer, int, String)
,
NamedObj.setDeferringChangeRequests(boolean)
public DecoratorAttributes createDecoratorAttributes(NamedObj target)
createDecoratorAttributes
in interface Decorator
target
- The NamedObj that will be decorated.public Receiver createIntermediateReceiver(Receiver receiver) throws IllegalActionException
createIntermediateReceiver
in interface CommunicationAspect
receiver
- The receiver that is being wrapped.IllegalActionException
- Not thrown in this class but may be thrown in derived classes.public java.util.List<NamedObj> decoratedObjects()
decoratedObjects
in interface Decorator
public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class CompositeActor
IllegalActionException
- If there is no director, or
if the director's initialize() method throws it, or if the
actor is not opaque.public void fire() throws IllegalActionException
fire
in interface Executable
fire
in class CompositeActor
IllegalActionException
- If there is no director, or if
the director's fire() method throws it, or if the actor is not
opaque.public boolean isGlobalDecorator()
isGlobalDecorator
in interface Decorator
public void registerListener(CommunicationAspectListener monitor)
registerListener
in interface CommunicationAspect
monitor
- The communication aspect monitor.public void reset()
reset
in interface CommunicationAspect
public void setContainer(CompositeEntity container) throws IllegalActionException, NameDuplicationException
setContainer
in class CompositeActor
container
- The container to attach this attribute to..IllegalActionException
- If this attribute is not of the
expected class for the container, or it has no name,
or the attribute and container are not in the same workspace, or
the proposed container would result in recursive containment.NameDuplicationException
- If the container already has
an attribute with the name of this attribute.ComponentEntity.getContainer()
public void setInputPortName(Port port, java.lang.String inputPortName)
port
- The actorport.inputPortName
- The name of the CommunicationRequestPort.public void sendToken(Receiver source, Receiver receiver, Token token) throws IllegalActionException
sendToken
in interface CommunicationAspect
source
- Sender of the token.receiver
- The receiver to send to.token
- The token to send.IllegalActionException
- If the refiring request fails.