W - The type of batched works.public abstract class AbstractWorkOrchestrator<W> extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractWorkOrchestrator(String name) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
doStart(ConfigurationPropertySource propertySource) |
protected abstract void |
doStop() |
protected abstract void |
doSubmit(W work) |
protected abstract CompletableFuture<?> |
getCompletion() |
protected String |
getName() |
CompletableFuture<?> |
preStop()
Stop accepting works and return a future that completes when all works have been completely executed.
|
void |
start(ConfigurationPropertySource propertySource)
Start any resource necessary to operate the orchestrator at runtime.
|
void |
stop()
Forcibly shut down ongoing work and release any resource necessary to operate the orchestrator at runtime.
|
void |
submit(W work) |
protected AbstractWorkOrchestrator(String name)
protected final String getName()
public final void start(ConfigurationPropertySource propertySource)
Called by the owner of this orchestrator once after bootstrap, before any other method is called.
propertySource - The property source to extract configuration from.public final CompletableFuture<?> preStop()
Optionally called by the owner of this orchestrator before stop(),
if it needs to wait for work completion.
public final void stop()
Called by the owner of this orchestrator on shutdown.
protected abstract void doStart(ConfigurationPropertySource propertySource)
protected abstract void doSubmit(W work) throws InterruptedException
InterruptedExceptionprotected abstract CompletableFuture<?> getCompletion()
protected abstract void doStop()
public final void submit(W work)
Copyright © 2006-2020 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.