Class AbstractWorkOrchestrator<W>

  • Type Parameters:
    W - The type of batched works.

    public abstract class AbstractWorkOrchestrator<W>
    extends Object
    An abstract base for orchestrator implementations, implementing a thread-safe shutdown.
    • Constructor Detail

      • AbstractWorkOrchestrator

        protected AbstractWorkOrchestrator​(String name)
    • Method Detail

      • name

        protected final String name()
      • start

        public final void start​(ConfigurationPropertySource propertySource)
        Start any resource necessary to operate the orchestrator at runtime.

        Called by the owner of this orchestrator once after bootstrap, before any other method is called.

        Parameters:
        propertySource - The property source to extract configuration from.
      • preStop

        public final CompletableFuture<?> preStop()
        Stop accepting works and return a future that completes when all works have been completely executed.

        Optionally called by the owner of this orchestrator before stop(), if it needs to wait for work completion.

        Returns:
        A future that completes when all ongoing works have been completely executed.
      • stop

        public final void stop()
        Forcibly shut down ongoing work and release any resource necessary to operate the orchestrator at runtime.

        Called by the owner of this orchestrator on shutdown.

      • doStop

        protected abstract void doStop()
      • submit

        public final void submit​(W work)