Class LifecyclePolicy
java.lang.Object
com.soklet.LifecyclePolicy
Immutable startup and shutdown deadline policy shared by every configured
lifecycle component.
Every timeout accepts Duration.ZERO as an immediate deadline, not
an unlimited wait or a disabled phase. Zero leaves no waiting allowance for
startup, startup cancelation, graceful drain or forced termination proof.
Use positive budgets for normal operation; shutdown completion depends on
physical termination evidence, not merely requesting interruption.
Each timeout and the sum of startup cancelation, graceful shutdown, and forced shutdown timeouts must fit in signed 64-bit nanoseconds. These three phases share one shutdown-intent origin; startup has its own independent budget. The combined bound keeps monotonic deadline comparisons valid even when the clock wraps.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classMutable builder for an immutableLifecyclePolicy. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull LifecyclePolicy.Builderbuilder()static @NonNull LifecyclePolicybooleaninthashCode()
-
Method Details
-
defaultInstance
- Returns:
- the shared default lifecycle policy
-
builder
- Returns:
- a mutable builder initialized with the default policy
-
getStartupTimeout
- Returns:
- startup timeout
-
getStartupCancelationTimeout
- Returns:
- budget for canceling an in-flight startup call
-
getGracefulShutdownTimeout
- Returns:
- graceful shutdown timeout
-
getForcedShutdownTimeout
- Returns:
- forced shutdown timeout
-
equals
-
hashCode
-