Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory, and Callable classes defined in this
package.
publicstatic Callable<Object>
callable
(PrivilegedAction<Object> action)
Returns a Callable object that, when
called, runs the given privileged action and returns its result.
publicstatic Callable<Object>
callable
(PrivilegedExceptionAction<Object> action)
Returns a Callable object that, when
called, runs the given privileged exception action and returns
its result.
publicstatic Callable<Object>
callable
(Runnable task)
Returns a Callable object that, when
called, runs the given task and returns null.
publicstatic Callable< T>
callable
(Runnable task, T result)
Returns a Callable object that, when
called, runs the given task and returns the given result.
publicstatic ScheduledExecutorService
newScheduledThreadPool
(int corePoolSize, ThreadFactory threadFactory)
publicstatic ScheduledExecutorService
newSingleThreadScheduledExecutor
(ThreadFactory threadFactory)
publicstatic Callable< T>
privilegedCallable
(Callable< T> callable)
Returns a Callable object that will, when
called, execute the given callable under the current
access control context.
publicstatic Callable< T>
privilegedCallableUsingCurrentClassLoader
(Callable< T> callable)
Returns a Callable object that will, when
called, execute the given callable under the current
access control context, with the current context class loader
as the context class loader.
publicstatic ExecutorService
unconfigurableExecutorService
(ExecutorService executor)
Returns an object that delegates all defined ExecutorService methods to the given executor, but not any
other methods that might otherwise be accessible using
casts.
publicstatic ScheduledExecutorService
unconfigurableScheduledExecutorService
(ScheduledExecutorService executor)
Returns an object that delegates all defined ScheduledExecutorService methods to the given executor, but
not any other methods that might otherwise be accessible using
casts.