Class CommandRuntime
java.lang.Object
com.ultikits.ultitools.abstracts.command.CommandRuntime
Framework services for executors constructed outside the root container.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static CommandWaitBudgetprivate static CommandRuntime.Servicesprivate static Supplier<CommandWaitBudget> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidawaitAsyncCommands(Iterable<?> beans) Drains instantiated command executors before their container's other resources are released.static voidStarts a new framework enable lifecycle, with no active server-stop allowance.static voidStarts the command shutdown allowance once; repeated calls never replenish it.static Messagesmessages()Returns the framework's root-container messages, never a module's namespace binding.(package private) static AutoCloseableTemporarily replaces both services for a test; close scopes in reverse installation order.(package private) static AutoCloseableoverrideWaitBudgets(Supplier<CommandWaitBudget> factory) static SchedulerReturns the framework-owned scheduler, not the dispatching module's scheduler.(package private) static CommandWaitBudget
-
Field Details
-
testServices
-
shutdownBudget
-
waitBudgets
-
-
Constructor Details
-
CommandRuntime
private CommandRuntime()
-
-
Method Details
-
beginShutdown
public static void beginShutdown()Starts the command shutdown allowance once; repeated calls never replenish it. -
beginEnable
public static void beginEnable()Starts a new framework enable lifecycle, with no active server-stop allowance. -
waitBudget
-
overrideWaitBudgets
-
messages
Returns the framework's root-container messages, never a module's namespace binding. -
scheduler
Returns the framework-owned scheduler, not the dispatching module's scheduler. -
awaitAsyncCommands
Drains instantiated command executors before their container's other resources are released. Aliases of the same bean are visited only once; no lazy beans are constructed. All executors stop accepting work before the first wait. A module unload shares one ten-second allowance; during server stop every drain shares the shutdown's remaining allowance instead. Only actual command waiting consumes it, not intervening service cleanup.- Parameters:
beans- the container's existing singleton values
-
override
Temporarily replaces both services for a test; close scopes in reverse installation order.- Parameters:
messages- test message servicescheduler- test scheduler- Returns:
- a scope restoring the previous services
-