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
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
-
Field Summary
Fields inherited from class com.scivicslab.pojoactor.core.ActorRef
actorName, actorSystem, object -
Constructor Summary
ConstructorsConstructorDescriptionIIActorRef(String actorName, T object) Constructs a new IIActorRef with the specified actor name and object.IIActorRef(String actorName, T object, IIActorSystem system) Constructs a new IIActorRef with the specified actor name, object, and actor system. -
Method Summary
Modifier and TypeMethodDescriptionabstract ActionResultcallByActionName(String actionName, String args) Executes an action identified by its name with the given arguments.Methods inherited from class com.scivicslab.pojoactor.core.ActorRef
ask, ask, askNow, clearJsonState, clearPendingMessages, close, createChild, getJsonBoolean, getJsonInt, getJsonString, getJsonString, getName, getNamesOfChildren, getParentName, hasJson, hasJsonState, initLogger, isAlive, json, putJson, setParentName, system, tell, tell, tellNow
-
Constructor Details
-
IIActorRef
Constructs a new IIActorRef with the specified actor name and object.- Parameters:
actorName- the name of the actorobject- the actor object instance
-
IIActorRef
Constructs a new IIActorRef with the specified actor name, object, and actor system.- Parameters:
actorName- the name of the actorobject- the actor object instancesystem- the actor system managing this actor
-
-
Method Details
-
callByActionName
Executes an action identified by its name with the given arguments.Implementations should parse the
argsstring 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
ActionResultindicating success or failure, along with any result data serialized as a string.- Specified by:
callByActionNamein interfaceCallableByActionName- Parameters:
actionName- the name of the action to executeargs- string arguments to pass to the action (format defined by implementation)- Returns:
- an
ActionResultindicating success or failure and any result data
- Comma-separated values:
-