Class ProcessorBase<T>
java.lang.Object
org.apache.activemq.artemis.utils.actors.HandlerBase
org.apache.activemq.artemis.utils.actors.ProcessorBase<T>
- Direct Known Subclasses:
Actor,OrderedExecutor,ThresholdActor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidvoidflush()final booleanWARNING: This will only flush when all the activity is suspended. don't expect success on this call if another thread keeps feeding the queue this is only valid on situations where you are not feeding the queue, like in shutdown and failover situations.final booleanfinal intThis method is safe to be called by different threads and its accuracy is subject to concurrent modifications.voidshutdown()It will shutdown and wait 30 seconds for timeout.voidintshutdownNow(Consumer<? super T> onPendingItem, int timeout, TimeUnit unit) It will shutdown the executor however it will not wait for finishing tasksfinal intstatus()protected voidvoidyield()Methods inherited from class org.apache.activemq.artemis.utils.actors.HandlerBase
enter, inHandler, leave
-
Field Details
-
STATE_NOT_RUNNING
public static final int STATE_NOT_RUNNING- See Also:
-
STATE_RUNNING
public static final int STATE_RUNNING- See Also:
-
STATE_FORCED_SHUTDOWN
public static final int STATE_FORCED_SHUTDOWN- See Also:
-
tasks
-
requestedShutdown
protected volatile boolean requestedShutdown
-
-
Constructor Details
-
ProcessorBase
-
-
Method Details
-
shutdown
public void shutdown()It will shutdown and wait 30 seconds for timeout. -
flush
public void flush() -
shutdown
-
yield
public void yield() -
shutdownNow
It will shutdown the executor however it will not wait for finishing tasks -
doTask
-
isFlushed
public final boolean isFlushed() -
flush
WARNING: This will only flush when all the activity is suspended. don't expect success on this call if another thread keeps feeding the queue this is only valid on situations where you are not feeding the queue, like in shutdown and failover situations. -
task
-
remaining
public final int remaining()This method is safe to be called by different threads and its accuracy is subject to concurrent modifications. It is meant to be used only for test purposes, because of itsO(n)cost.- Returns:
- the remaining items to be processed
-
status
public final int status()
-