Class SchedulerIIAR

All Implemented Interfaces:
CallableByActionName, AutoCloseable

public class SchedulerIIAR extends IIActorRef<WorkflowScheduler>
Interpreter-interfaced actor reference for WorkflowScheduler instances.

This class provides a concrete implementation of IIActorRef specifically for WorkflowScheduler objects. It delegates action invocations directly to the scheduler's WorkflowScheduler.callByActionName(String, String) method.

Usage Example:


 IIActorSystem system = new IIActorSystem("my-system");

 // Create scheduler
 WorkflowScheduler scheduler = new WorkflowScheduler(system);
 SchedulerIIAR schedulerRef = new SchedulerIIAR("scheduler", scheduler, system);
 system.addIIActor(schedulerRef);

 // Schedule a periodic task
 schedulerRef.callByActionName("scheduleAtFixedRate",
     "healthcheck,server,check,,0,10,SECONDS");

 // Cancel a task
 schedulerRef.callByActionName("cancel", "healthcheck");
 
Since:
2.5.0
Author:
devteam@scivicslab.com
See Also:
  • Constructor Details

    • SchedulerIIAR

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

      public SchedulerIIAR(String actorName, WorkflowScheduler object, IIActorSystem system)
      Constructs a new SchedulerIIAR with the specified actor name, scheduler object, and actor system.
      Parameters:
      actorName - the name of this actor
      object - the WorkflowScheduler 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 scheduler by name with the given arguments.

      This method delegates to the scheduler's WorkflowScheduler.callByActionName(String, String) method.

      Supported actions:

      • scheduleAtFixedRate - Schedule a task at fixed rate
        Args: taskId,targetActor,action,args,initialDelay,period,unit
      • scheduleWithFixedDelay - Schedule a task with fixed delay
        Args: taskId,targetActor,action,args,initialDelay,delay,unit
      • scheduleOnce - Schedule a one-time task
        Args: taskId,targetActor,action,args,delay,unit
      • cancel - Cancel a scheduled task
        Args: taskId
      • getTaskCount - Get number of scheduled tasks
        Args: (none)
      • isScheduled - Check if a task is scheduled
        Args: taskId
      Specified by:
      callByActionName in interface CallableByActionName
      Overrides:
      callByActionName in class IIActorRef<WorkflowScheduler>
      Parameters:
      actionName - the name of the action to execute
      arg - the argument string (format depends on the action)
      Returns:
      an ActionResult indicating success or failure with a message