Class Stop
This message can be used to signal that one or more Active Objects should terminate their processing. It optionally includes a list of objects that have been visited in the process of stopping, and it can be marked as 'force' which means the stop operation is mandatory and cannot be ignored by the Active Object.
- Author:
- Sergey Grachev
-
Method Summary
Modifier and TypeMethodDescriptionstatic Stopforce()Creates a new stop message with the force flag set to true.booleanChecks whether the given object ID has been visited during the stopping process.static StopCreates a new stop message with the force flag set to false.voidstopping(ActiveObject<?> object) Records an Active Object as part of the stopping process.static Stopupstream(ActiveObject<?> source, Stop message) Creates a new stop message that is an upstream continuation of the given stop message.
-
Method Details
-
upstream
Creates a new stop message that is an upstream continuation of the given stop message.The new message will have the specified source Active Object, and it will inherit the chain, visited set, and force flag from the original message.
- Parameters:
source- the new source Active Object for this stop messagemessage- the original stop message to continue upstream from- Returns:
- a new Stop message that continues the stopping process upstream
-
force
Creates a new stop message with the force flag set to true.The resulting stop operation will be mandatory and cannot be ignored by any Active Object.
- Returns:
- a new forced Stop message
-
nonBlocked
Creates a new stop message with the force flag set to false.The resulting stop operation can potentially be ignored by an Active Object, depending on its implementation.
- Returns:
- a new non-forced Stop message
-
isVisited
Checks whether the given object ID has been visited during the stopping process.- Parameters:
objectId- the object ID to check for in the visited set- Returns:
- true if the object ID has been visited, false otherwise
-
stopping
Records an Active Object as part of the stopping process.The specified object will be added to the chain, and its ID will be recorded in the visited set.
- Parameters:
object- the Active Object to record as being stopped
-