Class UiRuntime

java.lang.Object
com.ultikits.ultitools.ui.runtime.UiRuntime
All Implemented Interfaces:
AutoCloseable

@Internal public final class UiRuntime extends Object implements AutoCloseable
Shared registration, lifecycle and ordered execution for all owners' UI services.
  • Field Details

  • Constructor Details

  • Method Details

    • service

      public UiService service(String owner)
      Issues a fresh service for one module copy. Call once per copy and retain it for injection and unloading; names are diagnostic only. A closed runtime issues an already-unloaded service.
    • ownerName

      public String ownerName(UiSession<?> session)
      Returns a diagnostic name for backend logging, read once when opening a session.
    • register

      public void register(UiBackend backend)
      Registers a backend, rejecting an equal priority independently of the supported intent types.
    • lane

      ViewerLane lane(org.bukkit.entity.Player viewer)
    • add

      boolean add(RuntimeSession<?> session)
    • select

      @Nullable @Nullable UiBackend select(RuntimeSession<?> session)
    • replacePrevious

      void replacePrevious(RuntimeSession<?> session)
    • activate

      boolean activate(RuntimeSession<?> session, UiBackend backend)
    • removeLocked

      void removeLocked(RuntimeSession<?> session)
    • deferInterruptedClose

      public void deferInterruptedClose(GridSession session)
      Defers CANT_USE's reason to the original close continuation, allowing a same-tick quit to win. Cleanup is not queued a second tick later. The viewer lane hands off to the global pump on retirement.
    • quit

      public void quit(org.bukkit.entity.Player player)
      Handles a viewer quitting; continuations move to the global pump.
    • unload

      public void unload(UiService owner)
      Synchronously unloads exactly the module copy that received this service, never a same-name replacement.
    • unloadService

      private void unloadService(RuntimeUiService service)
    • applyGesture

      public boolean applyGesture(GridSession session, ViewerItems side, Gesture gesture)
      Applies a gesture against the backend's rendered snapshot, refusing a terminal session.
    • rendered

      public Grid rendered(GridSession session)
      Returns the immutable grid snapshot used for gestures and the last backend notification.
    • picture

      public Map<GridSlot, org.bukkit.inventory.ItemStack> picture(GridSession session)
      Returns defensive copies of the last drawn bound slots.
    • ownGrid

      private RuntimeGridSession ownGrid(GridSession session)
    • redraw

      void redraw(SlotContainer container)
    • isServerThread

      boolean isServerThread()
    • checkThread

      void checkThread()
    • warn

      void warn(String owner, String message, Throwable failure)
    • log

      void log(LogRecord record)
    • rethrowFatal

      static void rethrowFatal(Throwable failure)
    • beginShutdown

      public void beginShutdown()
      Starts one shared storage-wait budget for the complete server stop; repeated calls never extend it.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable