Class ScheduledObjectOneWorkExecutor.ScheduledRuntimeData
java.lang.Object
de.aristaflow.adept2.util.threading.executor.AbstractObjectOneWorkExecutor.RuntimeData
de.aristaflow.adept2.util.threading.executor.ScheduledObjectOneWorkExecutor.ScheduledRuntimeData
- Enclosing class:
- ScheduledObjectOneWorkExecutor<O>
public static class ScheduledObjectOneWorkExecutor.ScheduledRuntimeData
extends AbstractObjectOneWorkExecutor.RuntimeData
This class extends
RuntimeData by a runnable which will be delayed and the
corresponding future stemming from scheduling the runnable in the scheduling executor. If the
runtime data, i. e. the object for which the runtime data is registered, has no delayed
runnable (but a simple pending runnable), the delayed runnable and the corresponding future
will be null.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ScheduledFuture<?>The future of the delayed runnable returned from the scheduled executor ornull.protected RunnableThe delayed runnable of this scheduled runtime data ornull.Fields inherited from class de.aristaflow.adept2.util.threading.executor.AbstractObjectOneWorkExecutor.RuntimeData
blockUntilFlush, pendingAfterFlush, pendingBeforeFlush -
Constructor Summary
ConstructorsConstructorDescriptionCreates new scheduled runtime data having the work of the designated runtime and no delayed runnable.ScheduledRuntimeData(ScheduledObjectOneWorkExecutor.ScheduledRuntimeData rtData, boolean blockUntilFlush) Creates new scheduled runtime data having the work of the designated runtime data and the designated work pending for after the next flush and optionally blocks until the next flush.ScheduledRuntimeData(ScheduledObjectOneWorkExecutor.ScheduledRuntimeData rtData, Runnable pendingAfterFlush) Creates new scheduled runtime data having the work of the designated runtime data and the designated work pending for after the next flush.ScheduledRuntimeData(Runnable pendingBeforeFlush, ScheduledObjectOneWorkExecutor.ScheduledRuntimeData rtData) Creates new scheduled runtime data having the work of the designated runtime data and the designated work pending for before the next flush.ScheduledRuntimeData(Runnable pendingBeforeFlush, Runnable pendingAfterFlush) Creates new scheduled runtime data having the designated pending work and no delayed runnable.ScheduledRuntimeData(Runnable pendingBeforeFlush, Runnable pendingAfterFlush, boolean blockUntilFlush, Runnable delayedRunnable, ScheduledFuture<?> scheduled) Creates new scheduled runtime data having the designated pending work and the designated delayed runnable (and the corresponding future).ScheduledRuntimeData(Runnable delayedRunnable, ScheduledFuture<?> scheduled) Creates new scheduled runtime data having no pending work and the designated delayed runnable (and the corresponding future). -
Method Summary
Modifier and TypeMethodDescriptionvoidAborts the delayed runnable and future, that is, the delayed runnable will not be executed.Gets the delayed runnable of this scheduled runtime data ornull.booleanGets whether this scheduled runtime data has a delayed runnable.booleanGets whether this runtime data has pending work.Methods inherited from class de.aristaflow.adept2.util.threading.executor.AbstractObjectOneWorkExecutor.RuntimeData
blockUntilFlush, getPendingAfterFlush, getPendingBeforeFlush, hasPendingAfterFlush, hasPendingBeforeFlush
-
Field Details
-
delayedRunnable
The delayed runnable of this scheduled runtime data ornull. -
delayedFuture
The future of the delayed runnable returned from the scheduled executor ornull.
-
-
Constructor Details
-
ScheduledRuntimeData
Creates new scheduled runtime data having the designated pending work and no delayed runnable.- Parameters:
pendingBeforeFlush- The work (if present) to be run before the next flush ornull.pendingAfterFlush- The work (if present) to be run after the next flush ornull.
-
ScheduledRuntimeData
Creates new scheduled runtime data having the work of the designated runtime and no delayed runnable.- Parameters:
rtData- The runtime data of which to take over the work.
-
ScheduledRuntimeData
public ScheduledRuntimeData(Runnable pendingBeforeFlush, ScheduledObjectOneWorkExecutor.ScheduledRuntimeData rtData) Creates new scheduled runtime data having the work of the designated runtime data and the designated work pending for before the next flush.- Parameters:
pendingBeforeFlush- The work (if present) to be run before the next flush ornull. This overrides the work to be run before the next flush of the designated runtime data.rtData- The runtime data of which to take over the work and to override the work before the next flush with the designated work.
-
ScheduledRuntimeData
public ScheduledRuntimeData(ScheduledObjectOneWorkExecutor.ScheduledRuntimeData rtData, boolean blockUntilFlush) Creates new scheduled runtime data having the work of the designated runtime data and the designated work pending for after the next flush and optionally blocks until the next flush.- Parameters:
rtData- The runtime data of which to take over the work and to override the work after the next flush with the designated work.blockUntilFlush- Whether this runtime data has work that has been executed before a flush and no work should be executed until after the next flush.
-
ScheduledRuntimeData
public ScheduledRuntimeData(ScheduledObjectOneWorkExecutor.ScheduledRuntimeData rtData, Runnable pendingAfterFlush) Creates new scheduled runtime data having the work of the designated runtime data and the designated work pending for after the next flush.- Parameters:
rtData- The runtime data of which to take over the work and to override the work after the next flush with the designated work.pendingAfterFlush- The work (if present) to be run after the next flush ornull. This overrides the work to be run after the next flush of the designated runtime data.
-
ScheduledRuntimeData
Creates new scheduled runtime data having no pending work and the designated delayed runnable (and the corresponding future).- Parameters:
delayedRunnable- The delayed runnable for the scheduled runtime data.scheduled- The future for the scheduled work.
-
ScheduledRuntimeData
public ScheduledRuntimeData(Runnable pendingBeforeFlush, Runnable pendingAfterFlush, boolean blockUntilFlush, Runnable delayedRunnable, ScheduledFuture<?> scheduled) Creates new scheduled runtime data having the designated pending work and the designated delayed runnable (and the corresponding future).- Parameters:
pendingBeforeFlush- The work (if present) to be run before the next flush ornull.pendingAfterFlush- The work (if present) to be run after the next flush ornull.blockUntilFlush- Whether this runtime data has work that has been executed before a flush and no work should be executed until after the next flush.delayedRunnable- The delayed runnable for the scheduled runtime data.scheduled- The future for the scheduled work.
-
-
Method Details
-
hasDelayed
public boolean hasDelayed()Gets whether this scheduled runtime data has a delayed runnable.- Returns:
- Whether this scheduled runtime data has a delayed runnable.
-
hasPendingWork
public boolean hasPendingWork()Description copied from class:AbstractObjectOneWorkExecutor.RuntimeDataGets whether this runtime data has pending work.- Overrides:
hasPendingWorkin classAbstractObjectOneWorkExecutor.RuntimeData- Returns:
- Whether this runtime data has pending work.
-
getDelayedRunnable
Gets the delayed runnable of this scheduled runtime data ornull.- Returns:
- The delayed runnable of this scheduled runtime data or
null.
-
abortDelayed
public void abortDelayed()Aborts the delayed runnable and future, that is, the delayed runnable will not be executed.
-