Class CommandRuntime

java.lang.Object
com.ultikits.ultitools.abstracts.command.CommandRuntime

@Internal public final class CommandRuntime extends Object
Framework services for executors constructed outside the root container.
  • Field Details

  • 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

      static CommandWaitBudget waitBudget()
    • overrideWaitBudgets

      static AutoCloseable overrideWaitBudgets(Supplier<CommandWaitBudget> factory)
    • messages

      public static Messages messages()
      Returns the framework's root-container messages, never a module's namespace binding.
    • scheduler

      public static Scheduler scheduler()
      Returns the framework-owned scheduler, not the dispatching module's scheduler.
    • awaitAsyncCommands

      public static void awaitAsyncCommands(Iterable<?> beans)
      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

      static AutoCloseable override(Messages messages, Scheduler scheduler)
      Temporarily replaces both services for a test; close scopes in reverse installation order.
      Parameters:
      messages - test message service
      scheduler - test scheduler
      Returns:
      a scope restoring the previous services