Enum Class GroupLifecycle

java.lang.Object
java.lang.Enum<GroupLifecycle>
com.tnsai.agents.groups.GroupLifecycle
All Implemented Interfaces:
Serializable, Comparable<GroupLifecycle>, Constable

public enum GroupLifecycle extends Enum<GroupLifecycle>
Lifecycle states for an AgentGroup.

State transitions:

 FORMING → FORMED → ACTIVE → STOPPING → STOPPED
                      ↓                    ↓
                   DISSOLVING → DISSOLVED ←┘
 
  • Enum Constant Details

    • FORMING

      public static final GroupLifecycle FORMING
      Group is being formed, members are joining. Not yet ready to accept work.
    • FORMED

      public static final GroupLifecycle FORMED
      Group has minimum members and is ready to start. Waiting for explicit start() call.
    • ACTIVE

      public static final GroupLifecycle ACTIVE
      Group is active and accepting work. Members can communicate and coordinate.
    • STOPPING

      public static final GroupLifecycle STOPPING
      Group is stopping gracefully. In-flight operations are completing, no new work accepted.
    • STOPPED

      public static final GroupLifecycle STOPPED
      Group has stopped. Can be restarted or dissolved.
    • DISSOLVING

      public static final GroupLifecycle DISSOLVING
      Group is being dissolved. Members are being removed, resources cleaned up.
    • DISSOLVED

      public static final GroupLifecycle DISSOLVED
      Group is permanently dissolved. Cannot be restarted or used.
  • Method Details

    • values

      public static GroupLifecycle[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static GroupLifecycle valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getDescription

      public String getDescription()
      Returns a human-readable description of this state.
      Returns:
      state description
    • canAcceptMembers

      public boolean canAcceptMembers()
      Checks if this state allows accepting new members.
      Returns:
      true if members can join
    • canAcceptWork

      public boolean canAcceptWork()
      Checks if this state allows accepting new work.
      Returns:
      true if work can be accepted
    • isTerminal

      public boolean isTerminal()
      Checks if this is a terminal state.
      Returns:
      true if terminal
    • canTransitionTo

      public boolean canTransitionTo(GroupLifecycle target)
      Checks if transition to target state is valid.
      Parameters:
      target - target state
      Returns:
      true if transition is valid