Package com.tnsai.hooks.events
Enum Class AgentState
- All Implemented Interfaces:
Serializable,Comparable<AgentState>,Constable
Lifecycle state of an
Agent. Read via
Agent.getState(); transitions surface as
OnStateTransition hook events for observers.
Standard transition graph:
CREATED ──▶ STARTING ──▶ RUNNING ──▶ STOPPING ──▶ STOPPED
│ │ │
└───────────┴────────────┴──────▶ FAILED (terminal)
FAILED is terminal — agents cannot recover in-place; an
operator must construct a new instance. STOPPED is also
terminal but represents a clean shutdown rather than an error.
- Since:
- 0.5.0 (issue #21; foundation seeded by #60)
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionConstructed but no lazy initialisation has run yet.Unrecoverable error during initialisation or execution.Ready to process messages.Lazy initialisation in progress.Fully stopped, resources released.stop()has been called; in-flight work is being drained. -
Method Summary
Modifier and TypeMethodDescriptionstatic AgentStateReturns the enum constant of this class with the specified name.static AgentState[]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
-
CREATED
Constructed but no lazy initialisation has run yet. -
STARTING
Lazy initialisation in progress.chat()blocks or rejects. -
RUNNING
Ready to process messages. The only state in whichchat()succeeds. -
STOPPING
stop()has been called; in-flight work is being drained. -
STOPPED
Fully stopped, resources released. Terminal — no transitions out. -
FAILED
Unrecoverable error during initialisation or execution. Terminal — no transitions out; construct a new agent instance to retry.
-
-
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
-