Class InterpreterIIAR

All Implemented Interfaces:
CallableByActionName, AutoCloseable

public class InterpreterIIAR extends IIActorRef<Interpreter>
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 code
  • readYaml - Reads a YAML workflow definition from a file path
  • readJson - Reads a JSON workflow definition from a file path
Author:
devteam@scivics-lab.com
  • Constructor Details

    • InterpreterIIAR

      public InterpreterIIAR(String actorName, Interpreter object)
      Constructs a new InterpreterIIAR with the specified actor name and interpreter object.
      Parameters:
      actorName - the name of this actor
      object - the Interpreter instance managed by this actor reference
    • InterpreterIIAR

      public InterpreterIIAR(String actorName, Interpreter object, IIActorSystem system)
      Constructs a new InterpreterIIAR with the specified actor name, interpreter object, and actor system.
      Parameters:
      actorName - the name of this actor
      object - the Interpreter instance managed by this actor reference
      system - the actor system managing this actor
  • Method Details

    • callByActionName

      public ActionResult callByActionName(String actionName, String arg)
      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 result
      • readYaml - Reads a YAML file from the path specified in arg
      • readJson - Reads a JSON file from the path specified in arg
      Specified by:
      callByActionName in interface CallableByActionName
      Specified by:
      callByActionName in class IIActorRef<Interpreter>
      Parameters:
      actionName - the name of the action to execute
      arg - the argument string (typically a file path for read operations)
      Returns:
      an ActionResult indicating success or failure with a message