Package ptolemy.domains.ptera.lib
Class EventQueueDebugger
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.util.Attribute
-
- ptolemy.kernel.util.SingletonAttribute
-
- ptolemy.domains.ptera.lib.EventQueueDebugger
-
- All Implemented Interfaces:
java.lang.Cloneable
,Initializable
,EventQueueDebugListener
,Changeable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
,Singleton
public class EventQueueDebugger extends SingletonAttribute implements EventQueueDebugListener, Initializable
An attribute to debug the event queue of a Ptera model.- Since:
- Ptolemy II 8.0
- Version:
- $Id$
- Author:
- Thomas Huining Feng
- Pt.AcceptedRating:
- Red (tfeng)
- Pt.ProposedRating:
- Yellow (tfeng)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
-
Field Summary
Fields Modifier and Type Field Description Parameter
active
A Boolean parameter that determines whether this debugger is active.-
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
-
-
Constructor Summary
Constructors Constructor Description EventQueueDebugger(NamedObj container, java.lang.String name)
Construct an attribute with the given container and name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addInitializable(Initializable initializable)
Do nothing.void
initialize()
Do nothing.void
insertActor(int position, Time time, Actor actor, Token arguments)
Invoked when an actor is inserted into the event queue.void
insertEvent(int position, Time time, Event event, Token arguments)
Invoked when an event is inserted into the event queue.void
preinitialize()
Add this attribute as a debug listener to the director.void
removeEvent(int position, boolean isCancelled)
Invoked when an event or actor is removed from the event queue.void
removeInitializable(Initializable initializable)
Do nothing.void
setContainer(NamedObj container)
Set the container and register this as an initializable in the container.void
wrapup()
Remove this attribute from the list of debug listeners in the director.-
Methods inherited from class ptolemy.kernel.util.Attribute
_checkContainer, _getContainedObject, _propagateExistence, clone, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent
-
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, 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, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, 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
-
Methods inherited from interface ptolemy.kernel.util.DebugListener
event, message
-
-
-
-
Field Detail
-
active
public Parameter active
A Boolean parameter that determines whether this debugger is active.
-
-
Constructor Detail
-
EventQueueDebugger
public EventQueueDebugger(NamedObj container, java.lang.String name) throws NameDuplicationException, IllegalActionException
Construct an attribute with the given container and name. If an attribute already exists with the same name as the one specified here, that is an instance of class SingletonAttribute (or a derived class), then that attribute is removed before this one is inserted in the container.- Parameters:
container
- The container.name
- The name of this attribute.- Throws:
IllegalActionException
- If the attribute cannot be contained by the proposed container.NameDuplicationException
- If the container already has an attribute with this name, and the class of that container is not SingletonAttribute.
-
-
Method Detail
-
addInitializable
public void addInitializable(Initializable initializable)
Do nothing.- Specified by:
addInitializable
in interfaceInitializable
- Parameters:
initializable
- Not used.- See Also:
Initializable.removeInitializable(Initializable)
-
initialize
public void initialize() throws IllegalActionException
Do nothing.- Specified by:
initialize
in interfaceInitializable
- Throws:
IllegalActionException
- Not thrown in this class.
-
insertActor
public void insertActor(int position, Time time, Actor actor, Token arguments)
Invoked when an actor is inserted into the event queue.- Specified by:
insertActor
in interfaceEventQueueDebugListener
- Parameters:
position
- The position at which the actor is inserted.time
- The time at which the actor is scheduled to fire.actor
- The actor.arguments
- Arguments to the actor, which must be either an ArrayToken or a RecordToken, or null.
-
insertEvent
public void insertEvent(int position, Time time, Event event, Token arguments)
Invoked when an event is inserted into the event queue.- Specified by:
insertEvent
in interfaceEventQueueDebugListener
- Parameters:
position
- The position at which the event is inserted.time
- The time at which the event is scheduled to fire.event
- The event.arguments
- Arguments to the event, which must be either an ArrayToken or a RecordToken, or null.
-
preinitialize
public void preinitialize() throws IllegalActionException
Add this attribute as a debug listener to the director.- Specified by:
preinitialize
in interfaceInitializable
- Throws:
IllegalActionException
- Not thrown in this class.
-
removeEvent
public void removeEvent(int position, boolean isCancelled)
Invoked when an event or actor is removed from the event queue.- Specified by:
removeEvent
in interfaceEventQueueDebugListener
- Parameters:
position
- The position of the event or actor.isCancelled
- Whether the removal is due to cancellation or successful processing.
-
removeInitializable
public void removeInitializable(Initializable initializable)
Do nothing.- Specified by:
removeInitializable
in interfaceInitializable
- Parameters:
initializable
- Not used.- See Also:
Initializable.addInitializable(Initializable)
-
setContainer
public void setContainer(NamedObj container) throws IllegalActionException, NameDuplicationException
Set the container and register this as an initializable in the container.- Overrides:
setContainer
in classSingletonAttribute
- Parameters:
container
- The container- Throws:
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 that is of class SingletonConfigurableAttribute.- See Also:
Attribute.getContainer()
-
wrapup
public void wrapup() throws IllegalActionException
Remove this attribute from the list of debug listeners in the director.- Specified by:
wrapup
in interfaceInitializable
- Throws:
IllegalActionException
- Not thrown in this class.
-
-