Class AccumulatorIIAR

All Implemented Interfaces:
CallableByActionName, AutoCloseable

public class AccumulatorIIAR extends IIActorRef<Accumulator>
Interpreter-interfaced actor reference for Accumulator implementations.

This class provides a common IIActorRef implementation for all Accumulator types. The actual accumulation behavior is determined by the POJO passed to the constructor.

Supported Actions

  • add - Adds a result (requires JSON object with source, type, data)
  • getSummary - Returns formatted summary of all results
  • getCount - Returns the number of added results
  • clear - Clears all accumulated results

Example Workflow Usage


 steps:
   - states: ["0", "1"]
     actions:
       - actor: accumulator
         method: add
         arguments:
           source: "node-1"
           type: "cpu"
           data: "Intel Xeon"
 
Since:
2.8.0
Author:
devteam@scivics-lab.com
  • Constructor Details

    • AccumulatorIIAR

      public AccumulatorIIAR(String actorName, Accumulator object, IIActorSystem system)
      Constructs a new AccumulatorIIAR.
      Parameters:
      actorName - the name of this actor
      object - the Accumulator implementation
      system - the actor system
  • Method Details

    • callByActionName

      public ActionResult callByActionName(String actionName, String arg)
      Description copied from class: IIActorRef
      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
      Specified by:
      callByActionName in class IIActorRef<Accumulator>
      Parameters:
      actionName - the name of the action to execute
      arg - string arguments to pass to the action (format defined by implementation)
      Returns:
      an ActionResult indicating success or failure and any result data