|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.emory.mathcs.backport.java.util.concurrent.AbstractExecutorService
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor
edu.emory.mathcs.util.concurrent.SecureThreadPoolExecutor
Version of ThreadPoolExecutor that ensures propagation of access control
context and thread context
from call initiator to the
thread executing the call.
In other words, the executing call will observe access control context,
delegatable thread locals, and context class loader, as they existed when
the call was scheduled.
Nested Class Summary |
Nested classes inherited from class edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor |
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy |
Constructor Summary | |
SecureThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue workQueue)
Creates a new SecureThreadPoolExecutor with the given initial parameters and default thread factory and handler. |
|
SecureThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue workQueue,
RejectedExecutionHandler handler)
Creates a new SecureThreadPoolExecutor with the given initial parameters. |
|
SecureThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue workQueue,
java.lang.ThreadGroup threadGroup,
java.lang.String name)
Creates a new SecureThreadPoolExecutor with the given initial parameters and default thread factory and handler. |
|
SecureThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue workQueue,
java.lang.ThreadGroup threadGroup,
java.lang.String name,
RejectedExecutionHandler handler)
Creates a new SecureThreadPoolExecutor with the given initial parameters. |
Method Summary | |
void |
execute(java.lang.Runnable runnable)
Executes the given task sometime in the future. |
void |
setThreadFactory(ThreadFactory factory)
This method is disabled to prevent circumventing the context delegation performed by thie executor. |
Methods inherited from class edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor |
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, shutdown, shutdownNow, terminated |
Methods inherited from class edu.emory.mathcs.backport.java.util.concurrent.AbstractExecutorService |
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SecureThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue workQueue)
Executors
factory methods instead of this general purpose constructor.
corePoolSize
- the number of threads to keep in the
pool, even if they are idle.maximumPoolSize
- the maximum number of threads to allow in the
pool.keepAliveTime
- when the number of threads is greater than
the core, this is the maximum time that excess idle threads
will wait for new tasks before terminating.unit
- the time unit for the keepAliveTime
argument.workQueue
- the queue to use for holding tasks before they
are executed. This queue will hold only the Runnable
tasks submitted by the execute method.
java.lang.IllegalArgumentException
- if corePoolSize, or
keepAliveTime less than zero, or if maximumPoolSize less than or
equal to zero, or if corePoolSize greater than maximumPoolSize.
java.lang.NullPointerException
- if workQueue is nullpublic SecureThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue workQueue, java.lang.ThreadGroup threadGroup, java.lang.String name)
Executors
factory methods instead of this general purpose constructor.
corePoolSize
- the number of threads to keep in the
pool, even if they are idle.maximumPoolSize
- the maximum number of threads to allow in the
pool.keepAliveTime
- when the number of threads is greater than
the core, this is the maximum time that excess idle threads
will wait for new tasks before terminating.unit
- the time unit for the keepAliveTime
argument.workQueue
- the queue to use for holding tasks before they
are executed. This queue will hold only the Runnable
tasks submitted by the execute method.threadGroup
- the thread group in which threads will be createdname
- the name prefix for threads
java.lang.IllegalArgumentException
- if corePoolSize, or
keepAliveTime less than zero, or if maximumPoolSize less than or
equal to zero, or if corePoolSize greater than maximumPoolSize.
java.lang.NullPointerException
- if workQueue is nullpublic SecureThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue workQueue, RejectedExecutionHandler handler)
corePoolSize
- the number of threads to keep in the
pool, even if they are idle.maximumPoolSize
- the maximum number of threads to allow in the
pool.keepAliveTime
- when the number of threads is greater than
the core, this is the maximum time that excess idle threads
will wait for new tasks before terminating.unit
- the time unit for the keepAliveTime
argument.workQueue
- the queue to use for holding tasks before they
are executed. This queue will hold only the Runnable
tasks submitted by the execute method.handler
- the handler to use when execution is blocked
because the thread bounds and queue capacities are reached.
java.lang.IllegalArgumentException
- if corePoolSize, or
keepAliveTime less than zero, or if maximumPoolSize less than or
equal to zero, or if corePoolSize greater than maximumPoolSize.
java.lang.NullPointerException
- if workQueue
or handler are null.public SecureThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue workQueue, java.lang.ThreadGroup threadGroup, java.lang.String name, RejectedExecutionHandler handler)
corePoolSize
- the number of threads to keep in the
pool, even if they are idle.maximumPoolSize
- the maximum number of threads to allow in the
pool.keepAliveTime
- when the number of threads is greater than
the core, this is the maximum time that excess idle threads
will wait for new tasks before terminating.unit
- the time unit for the keepAliveTime
argument.workQueue
- the queue to use for holding tasks before they
are executed. This queue will hold only the Runnable
tasks submitted by the execute method.threadGroup
- the thread group in which threads will be createdname
- the name prefix for threadshandler
- the handler to use when execution is blocked
because the thread bounds and queue capacities are reached.
java.lang.IllegalArgumentException
- if corePoolSize, or
keepAliveTime less than zero, or if maximumPoolSize less than or
equal to zero, or if corePoolSize greater than maximumPoolSize.
java.lang.NullPointerException
- if workQueue
or handler are null.Method Detail |
public void execute(java.lang.Runnable runnable)
ThreadPoolExecutor
execute
in interface Executor
execute
in class ThreadPoolExecutor
runnable
- the task to executepublic void setThreadFactory(ThreadFactory factory)
setThreadFactory
in class ThreadPoolExecutor
factory
- the new thread factoryThreadPoolExecutor.getThreadFactory()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |