Class IIActorRef<T>

java.lang.Object
com.scivicslab.pojoactor.core.ActorRef<T>
com.scivicslab.pojoactor.workflow.IIActorRef<T>
Type Parameters:
T - the type of the actor object being referenced
All Implemented Interfaces:
CallableByActionName, AutoCloseable
Direct Known Subclasses:
AccumulatorIIAR, InterpreterIIAR, SchedulerIIAR

public abstract class IIActorRef<T> extends ActorRef<T> implements CallableByActionName
An interpreter-interfaced actor reference that can be invoked by action name strings.

This abstract class extends ActorRef and implements CallableByActionName, providing a bridge between the POJO-actor framework and the workflow interpreter. It allows actors to be invoked dynamically using string-based action names, which is essential for data-driven workflow execution.

Author:
devteam@scivics-lab.com
  • Constructor Details

    • IIActorRef

      public IIActorRef(String actorName, T object)
      Constructs a new IIActorRef with the specified actor name and object.
      Parameters:
      actorName - the name of the actor
      object - the actor object instance
    • IIActorRef

      public IIActorRef(String actorName, T object, IIActorSystem system)
      Constructs a new IIActorRef with the specified actor name, object, and actor system.
      Parameters:
      actorName - the name of the actor
      object - the actor object instance
      system - the actor system managing this actor
  • Method Details

    • callByActionName

      public abstract ActionResult callByActionName(String actionName, String args)
      Executes an action identified by its name with the given arguments.

      Implementations should parse the args string according to their own conventions. Common approaches include:

      • Comma-separated values: "5,3"
      • JSON: "{\"a\":5,\"b\":3}"
      • Key-value pairs: "a=5,b=3"

      The method should return an ActionResult indicating success or failure, along with any result data serialized as a string.

      Specified by:
      callByActionName in interface CallableByActionName
      Parameters:
      actionName - the name of the action to execute
      args - string arguments to pass to the action (format defined by implementation)
      Returns:
      an ActionResult indicating success or failure and any result data