|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.actor.AtomicActor
ptolemy.actor.TypedAtomicActor
jni.GenericJNIActor
EmbeddedCActor for a more recent implementation.
public class GenericJNIActor
Use the Java Native Interface to execute a native method. To use this actor, first configure the arguments of the native method by right clicking on the actor and selecting 'Configure Arguments', then configure the library name and location, then create the JNI files.
Note that under Windows, your path needs to include the directory
named by the libraryDirectory Parameter.
For further details, see JNIUtilities.
JNIUtilities,
Serialized Form
| Red (vincent.arnould) |
| Red (vincent.arnould) |
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class ptolemy.kernel.Entity |
|---|
Entity.ContainedObjectsIterator |
| Field Summary | |
|---|---|
private NamedList |
_argumentsList
Deprecated. |
private java.lang.Class |
_class
Deprecated. |
private int |
_methodIndex
Deprecated. |
private java.lang.reflect.Method[] |
_methods
Deprecated. |
Parameter |
libraryDirectory
Deprecated. The directory that contains the native library, which under Windows should include a dll, an h file and a lib file. |
Parameter |
nativeFunction
Deprecated. The name of the native library. |
Parameter |
nativeLibrary
Deprecated. The name of the native library. |
| Fields inherited from class ptolemy.actor.AtomicActor |
|---|
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested |
| Fields inherited from class ptolemy.kernel.util.NamedObj |
|---|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
| Fields inherited from interface ptolemy.actor.Executable |
|---|
COMPLETED, NOT_READY, STOP_ITERATING |
| Constructor Summary | |
|---|---|
GenericJNIActor()
Deprecated. Construct an entity in the default workspace with an empty string as its name. |
|
GenericJNIActor(CompositeEntity container,
java.lang.String name)
Deprecated. Construct an entity in the given workspace with the given name. |
|
GenericJNIActor(Workspace workspace)
Deprecated. Construct an entity in the given workspace with an empty string as a name. |
|
| Method Summary | |
|---|---|
protected void |
_addArgument(Argument arg)
Deprecated. Add an argument to this entity. |
void |
addArgumentReturn()
Deprecated. Add a return argument to this entity. |
java.util.List |
argumentsList()
Deprecated. Get the arguments belonging to this entity. |
void |
attributeChanged(Attribute attribute)
Deprecated. If the getDirector() returns something other than null, then invalidate the resolved types. |
java.lang.Object |
clone(Workspace workspace)
Deprecated. Clone the object into the specified workspace. |
void |
createPorts()
Deprecated. For each Argument, a port of the same name is created, belonging to this argument. |
void |
fire()
Deprecated. Read the argument of the function from the ports, call the native method throw the generated interface, and put the results on the corresponding ports. |
Argument |
getArgument(java.lang.String name)
Deprecated. Return the argument contained by this entity that has the specified name. |
Argument |
getArgumentReturn()
Deprecated. Return the argument contained by this entity that is return. |
void |
initialize()
Deprecated. Load the generated class and search for its fire method. |
void |
removeAllPorts()
Deprecated. Remove all ports by setting their container to null. |
void |
removeArgument(Argument arg)
Deprecated. Remove an argument from this entity. |
void |
updatePorts()
Deprecated. Update the ports to match the arguments. |
| Methods inherited from class ptolemy.actor.TypedAtomicActor |
|---|
_addPort, _fireAt, _fireAt, attributeTypeChanged, clone, newPort, typeConstraintList, typeConstraints |
| Methods inherited from class ptolemy.kernel.ComponentEntity |
|---|
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName |
| Methods inherited from class ptolemy.kernel.Entity |
|---|
_description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, setClassDefinition, uniqueName |
| Methods inherited from class ptolemy.kernel.InstantiableNamedObj |
|---|
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface ptolemy.actor.Actor |
|---|
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList |
| Methods inherited from interface ptolemy.actor.Executable |
|---|
isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate |
| Methods inherited from interface ptolemy.actor.Initializable |
|---|
addInitializable, preinitialize, removeInitializable, wrapup |
| Methods inherited from interface ptolemy.kernel.util.Nameable |
|---|
description, getContainer, getDisplayName, getFullName, getName, getName, setName |
| Methods inherited from interface ptolemy.kernel.util.Derivable |
|---|
getDerivedLevel, getDerivedList, propagateValue |
| Field Detail |
|---|
public Parameter libraryDirectory
public Parameter nativeFunction
public Parameter nativeLibrary
private NamedList _argumentsList
private java.lang.Class _class
private int _methodIndex
private java.lang.reflect.Method[] _methods
| Constructor Detail |
|---|
public GenericJNIActor()
public GenericJNIActor(Workspace workspace)
workspace - The workspace for synchronization and version
tracking.
public GenericJNIActor(CompositeEntity container,
java.lang.String name)
throws NameDuplicationException,
IllegalActionException
container - The container.name - The name of this object.
IllegalActionException - If the attribute is not of an
acceptable class for the container, or if the name contains a period.
NameDuplicationException - If the name coincides with
an attribute already in the container.| Method Detail |
|---|
public void addArgumentReturn()
throws IllegalActionException,
NameDuplicationException
IllegalActionException - If the argument with the
name "return" is not of an acceptable class for the container.
NameDuplicationException - If there is already an
argument with the name "return"public java.util.List argumentsList()
public void attributeChanged(Attribute attribute)
throws IllegalActionException
attributeChanged in class NamedObjattribute - The attribute that has changed.
IllegalActionException - If the parameters are out of range.
public java.lang.Object clone(Workspace workspace)
throws java.lang.CloneNotSupportedException
clone in class AtomicActorworkspace - The workspace for the cloned object.
java.lang.CloneNotSupportedException - If cloned ports cannot have
as their container the cloned entity (this should not occur), or
if one of the attributes cannot be cloned.NamedObj.exportMoML(Writer, int, String),
NamedObj.setDeferringChangeRequests(boolean)
public void createPorts()
throws IllegalActionException
IllegalActionException - If there is a problem
creating the ports.
public void fire()
throws IllegalActionException
fire in interface Executablefire in class AtomicActorIllegalActionException - If a exception occuredpublic Argument getArgument(java.lang.String name)
name - The name of the desired argument.
public Argument getArgumentReturn()
public void initialize()
throws IllegalActionException
initialize in interface Initializableinitialize in class AtomicActorIllegalActionException - If a derived class throws it.public void removeAllPorts()
removeAllPorts in class Entity
public void removeArgument(Argument arg)
throws IllegalActionException
arg - The argument to be removed.
IllegalActionException - If there is a problem removing
the argument.
public void updatePorts()
throws IllegalActionException
IllegalActionException - If there is a problem updating
the ports.
protected void _addArgument(Argument arg)
throws IllegalActionException,
NameDuplicationException
arg - The argument to be added.
IllegalActionException - If the argument
is not of an acceptable class for the container or the name contains
a period.
NameDuplicationException - If there is already an
argument with the same name.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||