public class ImmediateExecutor extends java.util.concurrent.AbstractExecutorService implements LocalAwareExecutorService
LocalAwareExecutorService.MaximumPoolSizeListener
Modifier and Type | Field and Description |
---|---|
static ImmediateExecutor |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit) |
void |
execute(java.lang.Runnable command) |
void |
execute(java.lang.Runnable command,
ExecutorLocals locals) |
int |
getActiveTaskCount()
Returns the approximate number of threads that are actively
executing tasks.
|
long |
getCompletedTaskCount()
Returns the approximate total number of tasks that have
completed execution.
|
int |
getCorePoolSize()
Returns maximum pool size of thread pool.
|
int |
getMaximumPoolSize()
Returns maximum pool size of thread pool.
|
int |
getPendingTaskCount()
Returns the approximate total of tasks waiting to be executed.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
void |
maybeExecuteImmediately(java.lang.Runnable command) |
void |
setCorePoolSize(int newCorePoolSize)
Allows user to resize maximum size of the thread pool.
|
void |
setMaximumPoolSize(int newMaximumPoolSize)
Allows user to resize maximum size of the thread pool.
|
void |
shutdown() |
java.util.List<java.lang.Runnable> |
shutdownNow() |
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMaxTasksQueued
public static final ImmediateExecutor INSTANCE
public void execute(java.lang.Runnable command, ExecutorLocals locals)
execute
in interface LocalAwareExecutorService
public void maybeExecuteImmediately(java.lang.Runnable command)
maybeExecuteImmediately
in interface LocalAwareExecutorService
public void execute(java.lang.Runnable command)
execute
in interface java.util.concurrent.Executor
public int getActiveTaskCount()
LocalAwareExecutorService
getActiveTaskCount
in interface LocalAwareExecutorService
public long getCompletedTaskCount()
LocalAwareExecutorService
getCompletedTaskCount
in interface LocalAwareExecutorService
public int getPendingTaskCount()
LocalAwareExecutorService
getPendingTaskCount
in interface LocalAwareExecutorService
public int getCorePoolSize()
ResizableThreadPool
getCorePoolSize
in interface ResizableThreadPool
public int getMaximumPoolSize()
ResizableThreadPool
getMaximumPoolSize
in interface ResizableThreadPool
public void setCorePoolSize(int newCorePoolSize)
ResizableThreadPool
setCorePoolSize
in interface ResizableThreadPool
public void setMaximumPoolSize(int newMaximumPoolSize)
ResizableThreadPool
setMaximumPoolSize
in interface ResizableThreadPool
public void shutdown()
shutdown
in interface java.util.concurrent.ExecutorService
public java.util.List<java.lang.Runnable> shutdownNow()
shutdownNow
in interface java.util.concurrent.ExecutorService
public boolean isShutdown()
isShutdown
in interface java.util.concurrent.ExecutorService
public boolean isTerminated()
isTerminated
in interface java.util.concurrent.ExecutorService
public boolean awaitTermination(long timeout, java.util.concurrent.TimeUnit unit)
awaitTermination
in interface java.util.concurrent.ExecutorService
Copyright © 2009-2022 The Apache Software Foundation