|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.threads.JBossExecutors
public final class JBossExecutors
Method Summary | |
---|---|
static java.util.concurrent.RejectedExecutionHandler |
abortPolicy()
Get the abort policy for a ThreadPoolExecutor . |
static java.util.concurrent.RejectedExecutionHandler |
callerRunsPolicy()
Get the caller-runs policy for a ThreadPoolExecutor . |
static DirectExecutor |
contextClassLoaderExecutor(DirectExecutor delegate,
java.lang.ClassLoader taskClassLoader)
Create a direct executor which runs tasks with the given context class loader. |
static DirectExecutor |
directExecutor()
Get the direct executor. |
static DirectExecutorService |
directExecutorService()
Get the direct executor service. |
static DirectExecutor |
discardingExecutor()
Get the discarding executor. |
static DirectExecutorService |
discardingExecutorService()
Get the discarding executor service. |
static java.util.concurrent.RejectedExecutionHandler |
discardOldestPolicy()
Get the discard-oldest policy for a ThreadPoolExecutor . |
static java.util.concurrent.RejectedExecutionHandler |
discardPolicy()
Get the discard policy for a ThreadPoolExecutor . |
static DirectExecutor |
exceptionLoggingExecutor(DirectExecutor delegate,
java.lang.Object log)
Create a direct executor which consumes and logs errors that are thrown. |
static java.lang.Runnable |
executorTask(DirectExecutor executor,
java.lang.Runnable task)
Get a task that runs the given task through the given direct executor. |
static java.util.concurrent.RejectedExecutionHandler |
handoffPolicy(java.util.concurrent.Executor target)
Get a handoff policy for a ThreadPoolExecutor . |
static DirectExecutor |
privilegedExecutor(DirectExecutor delegate,
java.security.AccessControlContext context)
Create a direct executor which runs with the privileges given by the supplied AccessControlContext instance. |
static DirectExecutorService |
protectedDirectExecutorService(DirectExecutor target)
Wrap a direct executor with an DirectExecutorService instance which supports all the features of ExecutorService
except for shutting down the executor. |
static java.util.concurrent.ExecutorService |
protectedExecutorService(java.util.concurrent.Executor target)
Wrap an executor with an ExecutorService instance which supports all the features of ExecutorService
except for shutting down the executor. |
static java.util.concurrent.ScheduledExecutorService |
protectedScheduledExecutorService(java.util.concurrent.ScheduledExecutorService target)
Wrap a scheduled executor with a ScheduledExecutorService instance which supports all the features of
ScheduledExecutorService except for shutting down the executor. |
static DirectExecutor |
rejectingExecutor()
Get the rejecting executor. |
static DirectExecutorService |
rejectingExecutorService()
Get the rejecting executor service. |
static java.util.concurrent.Executor |
threadFactoryExecutor(java.util.concurrent.ThreadFactory factory)
Create an executor that executes each task in a new thread. |
static DirectExecutor |
threadNameExecutor(DirectExecutor delegate,
java.lang.String newName)
Create a direct executor which changes the thread name for the duration of a task. |
static DirectExecutor |
threadNameNotateExecutor(DirectExecutor delegate,
java.lang.String notation)
Create a direct executor which adds a note to the thread name for the duration of a task. |
static java.util.concurrent.Executor |
wrappingExecutor(java.util.concurrent.Executor delegate,
DirectExecutor taskWrapper)
An executor which delegates to another executor, wrapping each task in a task wrapper. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static DirectExecutor directExecutor()
public static DirectExecutorService directExecutorService()
public static DirectExecutor rejectingExecutor()
public static DirectExecutorService rejectingExecutorService()
public static DirectExecutor discardingExecutor()
public static DirectExecutorService discardingExecutorService()
public static java.lang.Runnable executorTask(DirectExecutor executor, java.lang.Runnable task)
executor
- the executor to run the task throughtask
- the task to run
public static java.util.concurrent.Executor wrappingExecutor(java.util.concurrent.Executor delegate, DirectExecutor taskWrapper)
delegate
- the delegate executortaskWrapper
- the task wrapper
public static DirectExecutor privilegedExecutor(DirectExecutor delegate, java.security.AccessControlContext context)
AccessControlContext
instance.
delegate
- the executor to delegate to at the privileged levelcontext
- the AccessControlContext
to use
public static DirectExecutor contextClassLoaderExecutor(DirectExecutor delegate, java.lang.ClassLoader taskClassLoader)
delegate
- the executor to delegate totaskClassLoader
- the context class loader to use
public static DirectExecutor threadNameExecutor(DirectExecutor delegate, java.lang.String newName)
delegate
- the executor to delegate tonewName
- the thread name to use
public static DirectExecutor threadNameNotateExecutor(DirectExecutor delegate, java.lang.String notation)
delegate
- the executor to delegate tonotation
- the note to use
public static DirectExecutor exceptionLoggingExecutor(DirectExecutor delegate, java.lang.Object log)
delegate
- the executor to delegate tolog
- the logger to which exceptions are written at the error
level
public static java.util.concurrent.Executor threadFactoryExecutor(java.util.concurrent.ThreadFactory factory)
factory
- the thread factory to use
public static java.util.concurrent.RejectedExecutionHandler abortPolicy()
ThreadPoolExecutor
.
ThreadPoolExecutor.AbortPolicy
public static java.util.concurrent.RejectedExecutionHandler callerRunsPolicy()
ThreadPoolExecutor
.
ThreadPoolExecutor.CallerRunsPolicy
public static java.util.concurrent.RejectedExecutionHandler discardOldestPolicy()
ThreadPoolExecutor
.
ThreadPoolExecutor.DiscardOldestPolicy
public static java.util.concurrent.RejectedExecutionHandler discardPolicy()
ThreadPoolExecutor
.
ThreadPoolExecutor.DiscardPolicy
public static java.util.concurrent.RejectedExecutionHandler handoffPolicy(java.util.concurrent.Executor target)
ThreadPoolExecutor
. The returned instance will
delegate to another executor in the event that the task is rejected.
target
- the target executor
public static java.util.concurrent.ExecutorService protectedExecutorService(java.util.concurrent.Executor target)
ExecutorService
instance which supports all the features of ExecutorService
except for shutting down the executor.
target
- the target executor
public static DirectExecutorService protectedDirectExecutorService(DirectExecutor target)
DirectExecutorService
instance which supports all the features of ExecutorService
except for shutting down the executor.
target
- the target executor
public static java.util.concurrent.ScheduledExecutorService protectedScheduledExecutorService(java.util.concurrent.ScheduledExecutorService target)
ScheduledExecutorService
instance which supports all the features of
ScheduledExecutorService
except for shutting down the executor.
target
- the target executor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |