Interface Lifecycle
- All Known Implementing Classes:
AbstractLifecycle, NeonClient, NeonHost, NeonRelay
public interface Lifecycle
Lifecycle contract for Neon components that have a distinct startup and shutdown sequence.
State transitions: CREATED → STARTING → RUNNING on successful start;
RUNNING → STOPPING → STOPPED on successful stop. Any exception during a transition
moves the component to FAILED.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumLifecycle states for a Neon component. -
Method Summary
Modifier and TypeMethodDescriptiongetState()Returns the current lifecycle state.booleanReturnstrueif the component is in theLifecycle.State.RUNNINGstate.voidstart()Starts the component.voidstop()Stops the component.
-
Method Details
-
start
Starts the component. Only valid fromLifecycle.State.CREATED.- Throws:
Exception
-
stop
Stops the component. Only valid fromLifecycle.State.RUNNING.- Throws:
Exception
-
getState
Lifecycle.State getState()Returns the current lifecycle state. -
isRunning
boolean isRunning()Returnstrueif the component is in theLifecycle.State.RUNNINGstate.
-