java.lang.Object
com.github.devmix.process.acto.messages.Stop

public final class Stop extends Object
Represents a message to stop an Active Object or a chain of Active Objects.

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 Details

    • upstream

      public static Stop upstream(ActiveObject<?> source, Stop message)
      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 message
      message - the original stop message to continue upstream from
      Returns:
      a new Stop message that continues the stopping process upstream
    • force

      public static Stop 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

      public static Stop 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

      public boolean isVisited(Object objectId)
      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

      public void stopping(ActiveObject<?> object)
      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