Package csw.command.client
Class MiniCRM
java.lang.Object
csw.command.client.MiniCRM
miniCRM is described here.
miniCRM is designed to be a limited commandResponseManager, which encapsulates commands sent to one
Assembly or HCD. A miniCRM supports the two CommandService methods called query and queryFinal.
It keeps three list types: StartedList, ResponseList, and WaiterList
StartedList: This is a list of commands that have returned Started by the handlers. They are still
executing, having returned Started
ResponseList: This is a list of SubmitResponses published by the component. This is called by the handlers
when they publish the final SubmitResponse for a started command
WaiterList: This is a list of queryFinal callers. The list contains tuples of (id, ActorRef[SubmitResponse]).
Each entry is an actor waiting for the final response for the command with the given id.
miniCRM is written in the "immutable" style so all state is passed between calls to new Behaviors
The ComponentBehavior only submits Started commands to the miniCRM when a Started is returned from a submit handler. When a Started SubmitResponse is received, miniCRM receives an AddStarted call from ComponentBehavior. Whenever the component publishes the final completion message, it calls AddResponse, which triggers calls to any waiters associated with the runId.
Query and QueryFinal are used by the CommandService to provide the status of a command. Both of these methods look within the three lists above for their responses. Note that miniCRM does not handle any other commands besides ones that return Started.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic akka.actor.typed.Behavior<MiniCRM.CRMMessage>
make
(int startedSize, int responseSize, int waiterSize)
-
Constructor Details
-
MiniCRM
public MiniCRM()
-
-
Method Details
-
make
public static akka.actor.typed.Behavior<MiniCRM.CRMMessage> make(int startedSize, int responseSize, int waiterSize)
-