Class InterpreterIIAR
java.lang.Object
com.scivicslab.pojoactor.core.ActorRef<Interpreter>
com.scivicslab.pojoactor.workflow.IIActorRef<Interpreter>
com.scivicslab.pojoactor.workflow.InterpreterIIAR
- All Implemented Interfaces:
CallableByActionName,AutoCloseable
Interpreter-interfaced actor reference for
Interpreter instances.
This class provides a concrete implementation of IIActorRef
specifically for Interpreter objects. It handles action invocations
by name, supporting actions such as reading YAML/JSON workflow definitions
and executing workflow code.
Supported actions include:
execCode- Executes the loaded workflow codereadYaml- Reads a YAML workflow definition from a file pathreadJson- Reads a JSON workflow definition from a file path
- Author:
- devteam@scivics-lab.com
-
Field Summary
Fields inherited from class com.scivicslab.pojoactor.core.ActorRef
actorName, actorSystem, object -
Constructor Summary
ConstructorsConstructorDescriptionInterpreterIIAR(String actorName, Interpreter object) Constructs a new InterpreterIIAR with the specified actor name and interpreter object.InterpreterIIAR(String actorName, Interpreter object, IIActorSystem system) Constructs a new InterpreterIIAR with the specified actor name, interpreter object, and actor system. -
Method Summary
Modifier and TypeMethodDescriptioncallByActionName(String actionName, String arg) Invokes an action on the interpreter by name with the given arguments.Methods inherited from class com.scivicslab.pojoactor.core.ActorRef
ask, ask, askNow, clearJsonState, clearPendingMessages, close, createChild, getJsonBoolean, getJsonInt, getJsonString, getJsonString, getName, getNamesOfChildren, getParentName, hasJson, hasJsonState, initLogger, isAlive, json, putJson, setParentName, system, tell, tell, tellNow
-
Constructor Details
-
InterpreterIIAR
Constructs a new InterpreterIIAR with the specified actor name and interpreter object.- Parameters:
actorName- the name of this actorobject- theInterpreterinstance managed by this actor reference
-
InterpreterIIAR
Constructs a new InterpreterIIAR with the specified actor name, interpreter object, and actor system.- Parameters:
actorName- the name of this actorobject- theInterpreterinstance managed by this actor referencesystem- the actor system managing this actor
-
-
Method Details
-
callByActionName
Invokes an action on the interpreter by name with the given arguments.This method handles the following actions:
execCode- Executes the workflow code and returns the resultreadYaml- Reads a YAML file from the path specified inargreadJson- Reads a JSON file from the path specified inarg
- Specified by:
callByActionNamein interfaceCallableByActionName- Specified by:
callByActionNamein classIIActorRef<Interpreter>- Parameters:
actionName- the name of the action to executearg- the argument string (typically a file path for read operations)- Returns:
- an
ActionResultindicating success or failure with a message
-