ptolemy.actor.lib.embeddedJava
Class EmbeddedJavaActor
java.lang.Object
ptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.kernel.CompositeEntity
ptolemy.actor.CompositeActor
ptolemy.actor.TypedCompositeActor
ptolemy.actor.lib.embeddedJava.CompiledCompositeActor
ptolemy.actor.lib.embeddedJava.EmbeddedJavaActor
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable
public class EmbeddedJavaActor
- extends CompiledCompositeActor
An actor of this class executes compiled embedded Java code.
To use this actor within Vergil, double click on the actor and
insert Java code into the code templates, as indicated by the sample
template. Normally you will also need to add ports to the actor.
You may need to set the types of these ports as well.
- Since:
- Ptolemy II 8.0
- Version:
- $Id: EmbeddedJavaActor.java 57044 2010-01-27 22:41:05Z cxh $
- Author:
- Gang Zhou, Contributor: Bert Rodiers
- See Also:
- Serialized Form
- Accepted Rating:
- Proposed Rating:
Fields inherited from class ptolemy.kernel.util.NamedObj |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
Method Summary |
protected java.lang.String |
_getFileDependencies()
Get the fileDependencies part of the generated code. |
protected java.lang.String |
_getFireBlock()
Get the fireBlock part of the generated code. |
protected java.lang.String |
_getInitBlock()
Get the initBlock part of the generated code. |
protected java.lang.String |
_getPreinitBlock()
Get the preinitBlock part of the generated code. |
protected java.lang.String |
_getWrapupBlock()
Get the wrapupBlock part of the generated code. |
void |
preinitialize()
Create the embedded actor and add ports to it. |
protected void |
setEmbeddedActor()
Create a new instance instance of EmbeddedActor. |
void |
wrapup()
Remove inside relations. |
Methods inherited from class ptolemy.actor.CompositeActor |
_actorFiring, _actorFiring, _finishedAddEntity, _getPublishedPort, _setDirector, addActorFiringListener, addInitializable, addPiggyback, clone, connectionsChanged, createReceivers, createSchedule, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inferringWidths, inferWidths, inputPortList, isFireFunctional, isOpaque, isStrict, iterate, linkToPublishedPort, linkToPublishedPort, needsWidthInference, newInsideReceiver, newReceiver, notifyConnectivityChange, outputPortList, postfire, prefire, recordFiring, registerPublisherPort, removeActorFiringListener, removeInitializable, removePiggyback, requestChange, setContainer, setDirector, setManager, stop, stopFire, terminate, unlinkToPublishedPort, unlinkToPublishedPort, unregisterPublisherPort |
Methods inherited from class ptolemy.kernel.CompositeEntity |
_adjustDeferrals, _deepOpaqueEntityList, _description, _exportMoMLContents, _recordDecoratedAttributes, _removeEntity, _removeRelation, _validateSettables, allAtomicEntityList, allCompositeEntityList, allowLevelCrossingConnect, classDefinitionList, connect, connect, containedObjectsIterator, deepEntityList, deepGetEntities, deepOpaqueEntityList, deepRelationSet, entityList, entityList, exportLinks, exportMoML, getAttribute, getEntities, getEntity, getPort, getRelation, getRelations, isAtomic, lazyAllAtomicEntityList, lazyAllCompositeEntityList, lazyClassDefinitionList, lazyDeepEntityList, lazyEntityList, lazyRelationList, numberOfEntities, numberOfRelations, numEntities, numRelations, relationList, removeAllEntities, removeAllRelations, setClassDefinition, statistics, uniqueName |
Methods inherited from class ptolemy.kernel.ComponentEntity |
_checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName |
Methods inherited from class ptolemy.kernel.util.NamedObj |
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, attributeTypeChanged, clone, 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, propagateValue, propagateValues, removeChangeListener, removeDebugListener, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
embeddedJavaCode
public StringAttribute embeddedJavaCode
- The Java code that specifies the function of this actor. The
default value is the code necessary to implement a identity
function.
_embeddedActor
protected EmbeddedJavaActor.EmbeddedActor _embeddedActor
- The embedded actor used to contain the ports to the C
implementation.
EmbeddedJavaActor
public EmbeddedJavaActor(CompositeEntity container,
java.lang.String name)
throws NameDuplicationException,
IllegalActionException
- Construct an actor with the given container and name.
In addition to invoking the base class constructor,
create the embeddedJavaCode parameter, and initialize
it to provide an empty template.
- Parameters:
container
- The container.name
- The name of this actor.
- Throws:
NameDuplicationException
- If the container already
has an actor with this name.
IllegalActionException
- If the actor cannot be contained
by the proposed container.
preinitialize
public void preinitialize()
throws IllegalActionException
- Create the embedded actor and add ports to it.
- Specified by:
preinitialize
in interface Initializable
- Overrides:
preinitialize
in class CompositeActor
- Throws:
IllegalActionException
- If there is no director, or if
the director's preinitialize() method throws it, or if this actor
is not opaque.
wrapup
public void wrapup()
throws IllegalActionException
- Remove inside relations.
- Specified by:
wrapup
in interface Initializable
- Overrides:
wrapup
in class CompiledCompositeActor
- Throws:
IllegalActionException
- If there is no director,
or if the director's wrapup() method throws it, or if this
actor is not opaque.
setEmbeddedActor
protected void setEmbeddedActor()
throws IllegalActionException,
NameDuplicationException
- Create a new instance instance of EmbeddedActor.
Derived classes should override this method and create their
own instances as necessary.
- Throws:
NameDuplicationException
- If the container already
has an actor with this name.
IllegalActionException
- If the actor cannot be contained
by the proposed container.
_getFileDependencies
protected java.lang.String _getFileDependencies()
- Get the fileDependencies part of the generated code.
- Returns:
- The string containing the codegen fileDependencies function.
_getFireBlock
protected java.lang.String _getFireBlock()
- Get the fireBlock part of the generated code.
- Returns:
- The string containing the codegen fireBlock function.
_getInitBlock
protected java.lang.String _getInitBlock()
- Get the initBlock part of the generated code.
- Returns:
- The string containing the codegen initBlock function.
_getPreinitBlock
protected java.lang.String _getPreinitBlock()
- Get the preinitBlock part of the generated code.
- Returns:
- The string containing the codegen preinitBlock function.
_getWrapupBlock
protected java.lang.String _getWrapupBlock()
- Get the wrapupBlock part of the generated code.
- Returns:
- The string containing the codegen wrapupBlock function.