Package org.apache.sling.commons.threads
Interface ThreadPool
-
- All Superinterfaces:
java.util.concurrent.Executor
@ProviderType public interface ThreadPool extends java.util.concurrent.Executor
The thread pool interface allows to start runnables by getting threads from a managed pool.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ThreadPoolConfig
getConfiguration()
The thread pool configuration.java.lang.String
getName()
The name of the thread pool.java.util.concurrent.Future<?>
submit(java.lang.Runnable runnable)
Submits a runnable for execution<T> java.util.concurrent.Future<T>
submit(java.util.concurrent.Callable<T> callable)
Submits a callable for execution
-
-
-
Method Detail
-
submit
<T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T> callable)
Submits a callable for execution- Type Parameters:
T
- The generic type for the callable.- Parameters:
callable
- TheCallable
to submit- Returns:
- A
Future
representing pending completion of theCallable
- Since:
- 3.2
-
submit
java.util.concurrent.Future<?> submit(java.lang.Runnable runnable)
Submits a runnable for execution- Parameters:
runnable
- TheRunnable
to submit- Returns:
- A
Future
representing pending completion of theRunnable
- Since:
- 3.2
-
getName
java.lang.String getName()
The name of the thread pool.- Returns:
- The thread pool name.
-
getConfiguration
ThreadPoolConfig getConfiguration()
The thread pool configuration.- Returns:
- The thread pool configuration
-
-