Package com.tnsai.agents.groups
Enum Class GroupLifecycle
- All Implemented Interfaces:
Serializable,Comparable<GroupLifecycle>,Constable
Lifecycle states for an AgentGroup.
State transitions:
FORMING → FORMED → ACTIVE → STOPPING → STOPPED
↓ ↓
DISSOLVING → DISSOLVED ←┘
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionGroup is active and accepting work.Group is permanently dissolved.Group is being dissolved.Group has minimum members and is ready to start.Group is being formed, members are joining.Group has stopped.Group is stopping gracefully. -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if this state allows accepting new members.booleanChecks if this state allows accepting new work.booleancanTransitionTo(GroupLifecycle target) Checks if transition to target state is valid.Returns a human-readable description of this state.booleanChecks if this is a terminal state.static GroupLifecycleReturns the enum constant of this class with the specified name.static GroupLifecycle[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
FORMING
Group is being formed, members are joining. Not yet ready to accept work. -
FORMED
Group has minimum members and is ready to start. Waiting for explicit start() call. -
ACTIVE
Group is active and accepting work. Members can communicate and coordinate. -
STOPPING
Group is stopping gracefully. In-flight operations are completing, no new work accepted. -
STOPPED
Group has stopped. Can be restarted or dissolved. -
DISSOLVING
Group is being dissolved. Members are being removed, resources cleaned up. -
DISSOLVED
Group is permanently dissolved. Cannot be restarted or used.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
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
Checks if transition to target state is valid.- Parameters:
target- target state- Returns:
- true if transition is valid
-