public class CompositeActor extends CompositeEntity implements Actor, FiringsRecordable
The executive director of a composite actor is the local director of the actor's container. The toplevel composite actor has no executive director, and getExecutiveDirector will return null. For transparent composite actors, the executive director and the local director will be the same.
The getDirector() method returns the local director if there is one. Otherwise, it returns the executive director of the CompositeActor, if there is one. Whatever it returns is called (simply) the director of the composite (it may be local or executive). This Director is responsible for the execution of all the actors contained within the composite actor.
A composite actor must have an executive director in order to communicate with the hierarchy around it. In fact, it cannot even receive data in its input ports without an executive director, since the executive director is responsible for supplying the receivers to the ports. The toplevel composite actor has no executive director and cannot have ports that transmit data, but it can still be executed as long as it has a local director. If the getDirector() method returns null, then the composite is not executable.
When a composite actor has both a director and an executive director, then the model of computation implemented by the director need not be the same as the model of computation implemented by the executive director. This is the source of the hierarchical heterogeneity in Ptolemy II. Multiple models of computation can be cleanly nested.
The ports of a CompositeActor are constrained to be IOPorts, the relations to be IORelations, and the actors to be instances of ComponentEntity that implement the Actor interface. Derived classes may impose further constraints by overriding newPort(), _addPort(), newRelation(), _addRelation(), and _addEntity().
IOPort
,
IORelation
,
ComponentEntity
,
Director
,
Manager
CompositeEntity.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
protected java.util.LinkedList<ActorFiringListener> |
_actorFiringListeners
The list of ActorFiringListeners registered with this object.
|
protected CausalityInterface |
_causalityInterface
The causality interface, if it has been created.
|
protected java.util.Set<Executable> |
_derivedPiggybacks
The derived piggybacked executables.
|
protected java.util.Set<Initializable> |
_initializables
List of objects whose (pre)initialize() and wrapup() methods
should be slaved to these.
|
protected boolean |
_notifyingActorFiring
Flag that is true if there are actor firing listeners.
|
protected java.util.Set<Executable> |
_piggybacks
List piggybacked objects.
|
protected java.util.Map<java.lang.String,java.util.Set<IOPort>> |
_publishedPorts
Keep track of all published ports accessible in this container.
|
protected java.util.Map<java.lang.String,IORelation> |
_publisherRelations
Keep track of all relations with published ports accessible in this container.
|
protected boolean |
_stopRequested
Indicator that a stop has been requested by a call to stop().
|
protected java.util.Map<java.lang.String,java.util.List<IOPort>> |
_subscribedPorts
Keep track of all published ports accessible in this container.
|
_levelCrossingLinks
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
CompositeActor()
Construct a CompositeActor in the default workspace with no container
and an empty string as its name.
|
CompositeActor(CompositeEntity container,
java.lang.String name)
Create an actor with a name and a container.
|
CompositeActor(Workspace workspace)
Construct a CompositeActor in the specified workspace with no container
and an empty string as a name.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_actorFiring(FiringEvent.FiringEventType type,
int multiplicity)
Send an actor firing event type to all actor firing listeners that
have registered with this actor.
|
protected void |
_actorFiring(FiringEvent event)
Send an actor firing event to all actor firing listeners that
have registered with this actor.
|
protected void |
_addEntity(ComponentEntity entity)
Add an actor to this container with minimal error checking.
|
protected void |
_addPort(Port port)
Add a port to this actor.
|
protected void |
_addRelation(ComponentRelation relation)
Add a relation to this container.
|
protected void |
_finishedAddEntity(ComponentEntity entity)
Notify this actor that the given entity has been added inside it.
|
protected void |
_setDirector(Director director)
Set the local director for execution of this CompositeActor.
|
protected void |
_transferPortParameterInputs()
Read inputs from ParameterPorts and update.
|
void |
addActorFiringListener(ActorFiringListener listener)
Append a listener to the current set of actor firing listeners.
|
void |
addInitializable(Initializable initializable)
Add the specified object to the set of objects whose
preinitialize(), initialize(), and wrapup()
methods should be invoked upon invocation of the corresponding
methods of this object.
|
void |
addPiggyback(Executable piggyback)
Add the specified object to the set of objects whose action
methods should be invoked upon invocation of the corresponding
actions methods of this object.
|
java.lang.Object |
clone(Workspace workspace)
Clone the actor into the specified workspace.
|
void |
connectionsChanged(Port port)
Invalidate the schedule and type resolution and create
new receivers if the specified port is an opaque
output port.
|
void |
createReceivers()
Create receivers for each port.
|
void |
createSchedule()
Create the schedule for this model, if necessary.
|
void |
fire()
If this actor is opaque, transfer any data from the input ports
of this composite to the ports connected on the inside, and then
invoke the fire() method of its local director.
|
CausalityInterface |
getCausalityInterface()
Return a causality interface for this actor.
|
Director |
getDirector()
Return the director responsible for execution of the contained
actors.
|
Director |
getExecutiveDirector()
Return the executive director of this CompositeActor.
|
Manager |
getManager()
Get the manager responsible for execution of this composite actor.
|
IOPort |
getPublishedPort(java.lang.String name)
Get the published port with named name.
|
java.lang.String |
getPublishedPortChannel(IOPort port)
Get the channel name of a published port.
|
java.util.List<IOPort> |
getPublishedPorts(java.util.regex.Pattern pattern)
Get the published ports with names that match a regular expression.
|
java.lang.String |
getSubscribedPortChannel(IOPort port)
Get the name of the channel that the port subscribes to.
|
boolean |
inferringWidths()
Determine whether widths are currently being inferred or not.
|
void |
inferWidths()
Infer the width of the relations for which no width has been
specified yet.
|
void |
initialize()
Initialize this actor.
|
java.util.List |
inputPortList()
List the input ports of this actor.
|
boolean |
isFireFunctional()
If this actor is opaque, invoke the isFireFunctional() method
of the local director and return its result.
|
boolean |
isOpaque()
Return true if this actor contains a local director.
|
boolean |
isPublishedPort(IOPort port)
Return true if a port is in the published port list
at this level.
|
boolean |
isStrict()
Return false if all input ports have non-empty default values,
or if this actor is opaque and the contained director indicates
that it is non-strict.
|
int |
iterate(int count)
Invoke a specified number of iterations of the actor.
|
void |
linkToPublishedPort(java.util.regex.Pattern pattern,
TypedIOPort subscriberPort)
Link the subscriberPort with a already registered "published port" coming
from a publisher.
|
void |
linkToPublishedPort(java.util.regex.Pattern pattern,
TypedIOPort subscriberPort,
boolean global)
Link the subscriberPort with a already registered "published port" coming
from a publisher.
|
IOPort |
linkToPublishedPort(java.lang.String name,
IOPort subscriberPort)
Link the subscriberPort with a already registered "published port" coming
from a publisher.
|
IOPort |
linkToPublishedPort(java.lang.String name,
IOPort subscriberPort,
boolean global)
Link the subscriberPort with an already registered "published port" coming
from a publisher.
|
boolean |
needsWidthInference()
Return whether the current widths of the relation in the model
are no longer valid anymore and the widths need to be inferred again.
|
Receiver |
newInsideReceiver()
Return a new receiver of a type compatible with the local director.
|
Port |
newPort(java.lang.String name)
Create a new IOPort with the specified name.
|
Receiver |
newReceiver()
Return a new receiver of a type compatible with the executive director.
|
ComponentRelation |
newRelation(java.lang.String name)
Create a new IORelation with the specified name, add it to the
relation list, and return it.
|
void |
notifyConnectivityChange()
Notify the manager that the connectivity in the model changed
(width of relation changed, relations added, linked to different ports, ...).
|
java.util.List |
outputPortList()
Return an enumeration of the output ports.
|
boolean |
postfire()
If this actor is opaque, invoke the postfire() method of its
local director and transfer output data.
|
boolean |
prefire()
If this actor is opaque, invoke the prefire() method of the local
director.
|
void |
preinitialize()
Create receivers and invoke the
preinitialize() method of the local director.
|
void |
recordFiring(FiringEvent.FiringEventType type)
Record a firing event.
|
void |
registerPublisherPort(java.lang.String name,
IOPort port)
Register a "published port" coming from a publisher.
|
void |
registerPublisherPort(java.lang.String name,
IOPort port,
boolean global)
Register a "published port" coming from a publisher.
|
void |
removeActorFiringListener(ActorFiringListener listener)
Unregister an actor firing listener.
|
void |
removeInitializable(Initializable initializable)
Remove the specified object from the list of objects whose
preinitialize(), initialize(), and wrapup()
methods should be invoked upon invocation of the corresponding
methods of this object.
|
void |
removePiggyback(Executable piggyback)
Remove the specified object from the list of objects whose action
methods should be invoked upon invocation of the corresponding
actions methods of this object.
|
void |
requestChange(ChangeRequest change)
Queue a change request.
|
void |
setContainer(CompositeEntity container)
Override the base class to invalidate the schedule and
resolved types of the director.
|
void |
setDirector(Director director)
Set the local director for execution of this CompositeActor.
|
void |
setManager(Manager manager)
Set the Manager for execution of this CompositeActor.
|
void |
stop()
Request that execution stop as soon as possible.
|
void |
stopFire()
Request that execution of the current iteration complete.
|
void |
terminate()
If this is an opaque CompositeActor, then look to our director
for help.
|
void |
unlinkToPublishedPort(java.util.regex.Pattern pattern,
TypedIOPort subscriberPort)
Unlink the subscriberPort with a already registered "published port" coming
from a publisher.
|
void |
unlinkToPublishedPort(java.util.regex.Pattern pattern,
TypedIOPort subscriberPort,
boolean global)
Unlink the subscriberPort with a already registered "published port" coming
from a publisher.
|
void |
unlinkToPublishedPort(java.lang.String name,
IOPort subscriberPort)
Unlink the subscriberPort with a already registered "published port" coming
from a publisher.
|
void |
unlinkToPublishedPort(java.lang.String name,
IOPort subscriberPort,
boolean global)
Unlink the subscriberPort with a already registered "published port" coming
from a publisher.
|
void |
unregisterPublisherPort(java.lang.String name,
IOPort publisherPort)
Unregister a "published port" coming
from a publisher.
|
void |
unregisterPublisherPort(java.lang.String name,
IOPort publisherPort,
boolean global)
Unregister a "published port" coming
from a publisher.
|
void |
wrapup()
If this actor is opaque, then invoke the wrapup() method of the local
director.
|
_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, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, 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
getDerivedLevel, getDerivedList, propagateValue
protected java.util.LinkedList<ActorFiringListener> _actorFiringListeners
protected CausalityInterface _causalityInterface
protected transient java.util.Set<Executable> _derivedPiggybacks
protected transient java.util.Set<Initializable> _initializables
protected boolean _notifyingActorFiring
protected transient java.util.Set<Executable> _piggybacks
protected java.util.Map<java.lang.String,java.util.Set<IOPort>> _publishedPorts
protected java.util.Map<java.lang.String,java.util.List<IOPort>> _subscribedPorts
protected java.util.Map<java.lang.String,IORelation> _publisherRelations
protected boolean _stopRequested
public CompositeActor()
public CompositeActor(Workspace workspace)
workspace
- The workspace that will list the actor.public CompositeActor(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container actor.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 addActorFiringListener(ActorFiringListener listener)
addActorFiringListener
in interface FiringsRecordable
listener
- The listener to which to send actor firing messages.removeActorFiringListener(ActorFiringListener)
public void addInitializable(Initializable initializable)
addInitializable
in interface Initializable
initializable
- The object whose methods should be invoked.removeInitializable(Initializable)
,
addPiggyback(Executable)
public void addPiggyback(Executable piggyback)
piggyback
- The piggyback object.addInitializable(Initializable)
,
removePiggyback(Executable)
public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone
in class CompositeEntity
workspace
- The workspace for the cloned object.java.lang.CloneNotSupportedException
- If the actor contains
level crossing transitions so that its connections cannot be cloned,
or if one of the attributes cannot be cloned.NamedObj.exportMoML(Writer, int, String)
,
NamedObj.setDeferringChangeRequests(boolean)
public void connectionsChanged(Port port)
connectionsChanged
in class Entity
port
- The port that has connection changes.public void fire() throws IllegalActionException
fire
in interface Executable
IllegalActionException
- If there is no director, or if
the director's fire() method throws it, or if the actor is not
opaque.public void createReceivers() throws IllegalActionException
createReceivers
in interface Actor
IllegalActionException
- If any port throws it.AtomicActor.createReceivers()
,
createReceivers()
public void createSchedule() throws IllegalActionException
IllegalActionException
- If the schedule can't be created.public CausalityInterface getCausalityInterface()
CausalityInterfaceForComposites
.
If this is called multiple times, the same object is returned each
time unless the director has changed since the last call, in
which case a new object is returned.getCausalityInterface
in interface Actor
public Director getDirector()
getDirector
in interface Actor
setDirector(Director)
public Director getExecutiveDirector()
getExecutiveDirector
in interface Actor
public Manager getManager()
getManager
in interface Actor
setManager(Manager)
public final IOPort getPublishedPort(java.lang.String name) throws IllegalActionException, NameDuplicationException
name
- The name of the published port.IllegalActionException
- If the publisher can't be found.NameDuplicationException
- If there are multiple
publishers with the same name.public final java.util.List<IOPort> getPublishedPorts(java.util.regex.Pattern pattern) throws IllegalActionException, NameDuplicationException
pattern
- The regular expression pattern to match.IllegalActionException
- If the publisher can't be found.NameDuplicationException
- If there are multiple
publishers with the same name.public java.lang.String getPublishedPortChannel(IOPort port)
port
- The published port.public java.lang.String getSubscribedPortChannel(IOPort port)
port
- The subscribed port.public boolean inferringWidths()
public void inferWidths() throws IllegalActionException
IllegalActionException
- If the widths of the
relations at port are not consistent or if the width cannot be
inferred for a relation.public void initialize() throws IllegalActionException
initialize
in interface Initializable
IllegalActionException
- If there is no director, or
if the director's initialize() method throws it, or if the
actor is not opaque.public java.util.List inputPortList()
inputPortList
in interface Actor
public boolean isFireFunctional()
isFireFunctional
in interface Executable
public boolean isOpaque()
isOpaque
in class CompositeEntity
CompositeEntity
public boolean isPublishedPort(IOPort port)
port
- The port to be checked against the list of published ports.registerPublisherPort(String, IOPort, boolean)
.public boolean isStrict() throws IllegalActionException
isStrict
in interface Executable
IllegalActionException
- Thrown if causality interface
cannot be computed, or if the defaultValue expression cannot be
evaluated on an input port.public int iterate(int count) throws IllegalActionException
This base class method actually invokes prefire(), fire(), and postfire(), as described above, but a derived class may override the method to execute more efficient code.
iterate
in interface Executable
count
- The number of iterations to perform.IllegalActionException
- If iterating is not
permitted, or if prefire(), fire(), or postfire() throw it.public IOPort linkToPublishedPort(java.lang.String name, IOPort subscriberPort) throws IllegalActionException, NameDuplicationException
name
- The name is being used in the matching process
to match publisher and subscriber.subscriberPort
- The subscribed port.NameDuplicationException
- If there are name conflicts
as a result of the added relations or ports.IllegalActionException
- If the published port cannot be found.public IOPort linkToPublishedPort(java.lang.String name, IOPort subscriberPort, boolean global) throws IllegalActionException, NameDuplicationException
name
- The name being used in the matching process
to match publisher and subscriber.subscriberPort
- The subscriber port.global
- Specification of whether the data is subscribed
globally. If set to true, then subscribers will see values
published by publishers anywhere in the model that reference
the same channel by name. If set to false, then only values
published by publishers that are fired by the same director
are seen by this subscriber.NameDuplicationException
- If there are name conflicts
as a result of the added relations or ports.IllegalActionException
- If the published port cannot be found.public void linkToPublishedPort(java.util.regex.Pattern pattern, TypedIOPort subscriberPort) throws IllegalActionException, NameDuplicationException
pattern
- The pattern is being used in the matching process
to match publisher and subscriber.subscriberPort
- The subscribed port.NameDuplicationException
- If there are name conflicts
as a result of the added relations or ports.IllegalActionException
- If the published port cannot be found.public void linkToPublishedPort(java.util.regex.Pattern pattern, TypedIOPort subscriberPort, boolean global) throws IllegalActionException, NameDuplicationException
pattern
- The pattern is being used in the matching process
to match publisher and subscriber.subscriberPort
- The subscribed port.global
- Specification of whether the data is subscribed
globally. If set to true, then subscribers will see values
published by publishers anywhere in the model that reference
the same channel by name. If set to false, then only values
published by publishers that are fired by the same director
are seen by this subscriber.NameDuplicationException
- If there are name conflicts
as a result of the added relations or ports.IllegalActionException
- If the published port cannot be found.public boolean needsWidthInference() throws KernelRuntimeException
KernelRuntimeException
- If toplevel not a CompositeActor.public void notifyConnectivityChange()
public Receiver newInsideReceiver() throws IllegalActionException
IllegalActionException
- If there is no local director.public Port newPort(java.lang.String name) throws NameDuplicationException
newPort
in class ComponentEntity
name
- The name for the new port.NameDuplicationException
- If the actor already has a port
with the specified name.public Receiver newReceiver() throws IllegalActionException
newReceiver
in interface Actor
IllegalActionException
- If there is no executive director.public ComponentRelation newRelation(java.lang.String name) throws IllegalActionException, NameDuplicationException
newRelation
in class CompositeEntity
name
- The name of the new relation.IllegalActionException
- If name argument is null.NameDuplicationException
- If name collides with a name
already on the container's contents list.public java.util.List outputPortList()
outputPortList
in interface Actor
public boolean postfire() throws IllegalActionException
postfire
in interface Executable
IllegalActionException
- If there is no director,
or if the director's postfire() method throws it, or if this
actor is not opaque.public boolean prefire() throws IllegalActionException
prefire
in interface Executable
IllegalActionException
- If there is no director,
or if the director's prefire() method throws it, or if this actor
is not opaque.public void preinitialize() throws IllegalActionException
preinitialize
in interface Initializable
IllegalActionException
- If there is no director, or if
the director's preinitialize() method throws it, or if this actor
is not opaque.public void recordFiring(FiringEvent.FiringEventType type)
recordFiring
in interface FiringsRecordable
type
- The firing event to be recorded.public void registerPublisherPort(java.lang.String name, IOPort port) throws NameDuplicationException, IllegalActionException
name
- The name is being used in the matching process
to match publisher and subscriber.port
- The published port.NameDuplicationException
- If the published port
is already registered.IllegalActionException
- If the published port can't
be added.public void registerPublisherPort(java.lang.String name, IOPort port, boolean global) throws NameDuplicationException, IllegalActionException
name
- The name is being used in the matching process
to match publisher and subscriber.port
- The published port.global
- If true, publish globally. If false, publish
only to subscribers that are fired by the same director.NameDuplicationException
- If the published port
is already registered.IllegalActionException
- If the published port can't
be added.public void removeActorFiringListener(ActorFiringListener listener)
removeActorFiringListener
in interface FiringsRecordable
listener
- The listener to remove from the list of listeners
to which actor firing messages are sent.addActorFiringListener(ActorFiringListener)
public void removeInitializable(Initializable initializable)
removeInitializable
in interface Initializable
initializable
- The object whose methods should no longer be invoked.addInitializable(Initializable)
,
removePiggyback(Executable)
public void removePiggyback(Executable piggyback)
piggyback
- The piggyback object.removeInitializable(Initializable)
,
addPiggyback(Executable)
public void requestChange(ChangeRequest change)
requestChange
in interface Changeable
requestChange
in class NamedObj
change
- The requested change.NamedObj.executeChangeRequests()
,
NamedObj.setDeferringChangeRequests(boolean)
,
Changeable
public void setContainer(CompositeEntity container) throws IllegalActionException, NameDuplicationException
setContainer
in class CompositeEntity
container
- The proposed container.IllegalActionException
- If the action would result in a
recursive containment structure, or if
this entity and container are not in the same workspace.NameDuplicationException
- If the container already has
an entity with the name of this entity.ComponentEntity.getContainer()
public void setDirector(Director director) throws IllegalActionException, NameDuplicationException
director
- The Director responsible for execution.IllegalActionException
- If the director is not in
the same workspace as this actor. It may also be thrown in derived
classes if the director is not compatible.NameDuplicationException
- If an attribute already exists
in this container with the same name as the given director.getDirector()
public void setManager(Manager manager) throws IllegalActionException
manager
- The ManagerIllegalActionException
- If this actor has a
container, or the manager is not in the same workspace as this
actor.getManager()
public void stop()
stop
in interface Executable
public void stopFire()
stopFire
in interface Executable
public void terminate()
terminate
in interface Executable
public void unlinkToPublishedPort(java.lang.String name, IOPort subscriberPort) throws IllegalActionException
name
- The name is being used in the matching process
to match publisher and subscriber.subscriberPort
- The subscribed port.IllegalActionException
- If the published port cannot be found.public void unlinkToPublishedPort(java.lang.String name, IOPort subscriberPort, boolean global) throws IllegalActionException
name
- The name is being used in the matching process
to match publisher and subscriber.subscriberPort
- The subscribed port.global
- Specification of whether the data is subscribed
globally. If set to true, then subscribers will see values
published by publishers anywhere in the model that reference
the same channel by name. If set to false, then only values
published by publishers that are fired by the same director
are seen by this subscriber.IllegalActionException
- If the published port cannot be found.public void unlinkToPublishedPort(java.util.regex.Pattern pattern, TypedIOPort subscriberPort) throws IllegalActionException
pattern
- The pattern is being used in the matching process
to match publisher and subscriber.subscriberPort
- The subscribed port.IllegalActionException
- If the published port cannot be found.public void unlinkToPublishedPort(java.util.regex.Pattern pattern, TypedIOPort subscriberPort, boolean global) throws IllegalActionException
pattern
- The pattern is being used in the matching process
to match publisher and subscriber.subscriberPort
- The subscribed port.global
- Specification of whether the data is subscribed
globally. If set to true, then subscribers will see values
published by publishers anywhere in the model that reference
the same channel by name. If set to false, then only values
published by publishers that are fired by the same director
are seen by this subscriber.IllegalActionException
- If the published port cannot be found.public void unregisterPublisherPort(java.lang.String name, IOPort publisherPort) throws IllegalActionException, NameDuplicationException
name
- The name is being used in the matching process
to match publisher and subscriber. This will be the port
that should be removedpublisherPort
- The publisher port.IllegalActionException
- If the container of the port cannot
be set.NameDuplicationException
- If the container of the port cannot
be setpublic void unregisterPublisherPort(java.lang.String name, IOPort publisherPort, boolean global) throws IllegalActionException, NameDuplicationException
name
- The name is being used in the matching process
to match publisher and subscriber. This will be the port
that should be removedpublisherPort
- The publisher port.global
- If true, unregister the port all the way up the hierarchy.IllegalActionException
- If the container of the port cannot
be set.NameDuplicationException
- If the container of the port cannot
be setpublic void wrapup() throws IllegalActionException
wrapup
in interface Initializable
IllegalActionException
- If there is no director,
or if the director's wrapup() method throws it, or if this
actor is not opaque.protected final void _actorFiring(FiringEvent event)
event
- The event.protected final void _actorFiring(FiringEvent.FiringEventType type, int multiplicity)
type
- The type.multiplicity
- The multiplicity of the firing, that is,
the number of times the firing will occur or has occurred.protected void _addEntity(ComponentEntity entity) throws IllegalActionException, NameDuplicationException
_addEntity
in class CompositeEntity
entity
- Actor to contain.IllegalActionException
- If the actor has no name, or the
action would result in a recursive containment structure, or the
argument does not implement the Actor interface.NameDuplicationException
- If the name collides with a name
already on the actor contents list.protected void _addPort(Port port) throws IllegalActionException, NameDuplicationException
_addPort
in class Entity
port
- The port to add to this actor.IllegalActionException
- If the port class is not
acceptable to this actor, or the port has no name.NameDuplicationException
- If the port name collides with a
name already in the actor.protected void _addRelation(ComponentRelation relation) throws IllegalActionException, NameDuplicationException
_addRelation
in class CompositeEntity
relation
- Relation to contain.IllegalActionException
- If the relation has no name, or is
not an instance of IORelation.NameDuplicationException
- If the name collides with a name
already on the contained relations list.protected void _finishedAddEntity(ComponentEntity entity)
_finishedAddEntity
in class CompositeEntity
entity
- Actor to contain.protected void _setDirector(Director director) throws IllegalActionException, NameDuplicationException
director
- The Director responsible for execution.IllegalActionException
- If removing the old director
causes this to be thrown. Should not be thrown.NameDuplicationException
- If removing the old director
causes this to be thrown. Should not be thrown.protected void _transferPortParameterInputs() throws IllegalActionException
IllegalActionException
- If reading from parameter associated
with port fails.