public class Publisher extends TypedAtomicActor
Subscriberthat names the same channel. If
globalis false (the default), then this publisher will only send to instances of Subscriber that are under the control of the same director. That is, it can be at a different level of the hierarchy, or in an entirely different composite actor, as long as the relevant composite actors are transparent (have no director). If
globalis true, then the subscriber may be anywhere in the model, as long as its global parameter is also true.
It is an error to have two instances of Publisher using the same channel under the control of the same director. When you create a new Publisher, by default, it has no channel name. You have to specify a channel name to use it.
How it works:
This actor has a hidden output port. When the channel name
is specified, typically during model construction, this actor
causes a relation to be created in the least opaque composite
actor above it in the hierarchy and links to that relation.
In addition, if
global is set to true, it causes
a port to be created in that composite, and also links that
port to the relation on the inside. The relation is recorded by the opaque
composite. When a Subscriber is preinitialized that refers
to the same channel, that Subscriber finds the relation (by
finding the least opaque composite actor above it) and links
to the relation. Some of these links are "liberal links" in that
they cross levels of the hierarchy.
Since publishers are linked to subscribers, any data dependencies that the director might assume on a regular "wired" connection will also be assumed across Publisher-Subscriber pairs. Similarly, type constraints will propagate across Publisher-Subscriber pairs. That is, the type of the Subscriber output will match the type of the Publisher input.
|Modifier and Type||Field and Description|
The name of the channel.
Specification of whether the published data is global.
The input port.
The output port.
If true, then propagate channel name changes to any Subscribers.
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
|Constructor and Description|
Construct a publisher with the specified container and name.
|Modifier and Type||Method and Description|
Clone the actor into the specified workspace.
Read at most one input token from each input channel and send it to the subscribers, if any.
Override the base class to ensure that links to subscribers have been updated.
Return a Set of Subscribers that are connected to this Publisher.
_containedTypeConstraints, _customTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints
_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, initialize, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, postfire, prefire, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate, wrapup
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
_addPort, _description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, 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, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate
addInitializable, initialize, removeInitializable, wrapup
description, getContainer, getDisplayName, getFullName, getName, getName, setName
public StringParameter channel
public Parameter global
public TypedIOPort input
public PublisherPort output
public Parameter propagateNameChanges
If the value is true, then SubscriptionAggregators that have the same regular expression as the channel name of the Publisher will be updated. However, SubscriptionAggregators usually have regular expressions as channel names, so usually the channel name of the SubscriptionAggregator will not be updated.
Note that if a Publisher is within an Actor Oriented Class definition, then any Subscribers with the same channel name in Actor Oriented Class definitions will not be updated. This is because there is no connection between the Publisher in the Actor Oriented Class definition and the Subscriber. However, if the channel name in a Publisher in an instance of an Actor Oriented Class is updated, then the corresponding Subscribers in instances of Actor Oriented Class will be updated.
public Publisher(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
workspace- The workspace for the new object.
java.lang.CloneNotSupportedException- If a derived class contains an attribute that cannot be cloned.
NamedObj.exportMoML(Writer, int, String),
public void fire() throws IllegalActionException
public void preinitialize() throws IllegalActionException
public java.util.Set<AtomicActor> subscribers() throws KernelException
KernelException- If thrown when a Manager is added to the top level or if preinitialize() fails.