Class AccumulatorFactory

java.lang.Object
com.scivicslab.pojoactor.workflow.accumulator.AccumulatorFactory

public class AccumulatorFactory extends Object
Factory for creating Accumulator instances and actors.

Usage Example


 // Create just the POJO
 Accumulator acc = AccumulatorFactory.create("streaming");

 // Create and register an actor
 AccumulatorIIAR actor = AccumulatorFactory.createActor("buffered", "myAccumulator", system);
 
Since:
2.8.0
Author:
devteam@scivics-lab.com
  • Constructor Details

    • AccumulatorFactory

      public AccumulatorFactory()
  • Method Details

    • create

      public static Accumulator create(String type)
      Creates an Accumulator instance of the specified type.
      Parameters:
      type - the accumulator type: "streaming", "buffered", "table", or "json"
      Returns:
      the Accumulator instance
      Throws:
      IllegalArgumentException - if the type is unknown
    • createActor

      public static AccumulatorIIAR createActor(String type, String actorName, IIActorSystem system)
      Creates an AccumulatorIIAR and registers it with the actor system.
      Parameters:
      type - the accumulator type: "streaming", "buffered", "table", or "json"
      actorName - the name for the actor
      system - the actor system to register with
      Returns:
      the created AccumulatorIIAR
      Throws:
      IllegalArgumentException - if the type is unknown
    • createActor

      public static AccumulatorIIAR createActor(String type, IIActorSystem system)
      Creates an AccumulatorIIAR with the default name "accumulator" and registers it.
      Parameters:
      type - the accumulator type: "streaming", "buffered", "table", or "json"
      system - the actor system to register with
      Returns:
      the created AccumulatorIIAR
      Throws:
      IllegalArgumentException - if the type is unknown