Package org.apache.sling.commons.threads
Interface ThreadPoolConfig
-
- All Known Implementing Classes:
ModifiableThreadPoolConfig
@ProviderType public interface ThreadPoolConfigThe thread pool configuration.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classThreadPoolConfig.ThreadPoolPolicyThe thread pool policies.static classThreadPoolConfig.ThreadPriority
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description ThreadPoolConfig.ThreadPoolPolicygetBlockPolicy()Return the block policy.java.util.concurrent.ThreadFactorygetFactory()Return the thread pool factory.longgetKeepAliveTime()Return the keep alive time.intgetMaxPoolSize()Return the maximum pool sizelonggetMaxThreadAge()Deprecated.Since version 3.4.0 always returns -1 as threads are no longer retired but instead the thread locals are cleaned up (SLING-6261)intgetMinPoolSize()Return the minimum pool size.ThreadPoolConfig.ThreadPrioritygetPriority()Return the priority for the threads.intgetQueueSize()Return the queue size.intgetShutdownWaitTimeMs()Return the shutdown wait time in ms.booleanisDaemon()Return if daemon threads should be created.booleanisShutdownGraceful()Should this pool shutdown graceful.
-
-
-
Method Detail
-
getMinPoolSize
int getMinPoolSize()
Return the minimum pool size.- Returns:
- The minimum pool size.
-
getMaxPoolSize
int getMaxPoolSize()
Return the maximum pool size- Returns:
- The maximum pool size.
-
getQueueSize
int getQueueSize()
Return the queue size.- Returns:
- The queue size.
-
getMaxThreadAge
@Deprecated long getMaxThreadAge()
Deprecated.Since version 3.4.0 always returns -1 as threads are no longer retired but instead the thread locals are cleaned up (SLING-6261)Return the maximum age before a thread is retired.- Returns:
- The maximum age of a thread in milliseconds.
-
getKeepAliveTime
long getKeepAliveTime()
Return the keep alive time.- Returns:
- The keep alive time.
-
getBlockPolicy
ThreadPoolConfig.ThreadPoolPolicy getBlockPolicy()
Return the block policy.- Returns:
- The block policy.
-
isShutdownGraceful
boolean isShutdownGraceful()
Should this pool shutdown graceful.- Returns:
trueif the pool should shutdown graceful.
-
getShutdownWaitTimeMs
int getShutdownWaitTimeMs()
Return the shutdown wait time in ms. A value below 1 means no waiting at shutdown.- Returns:
- The shutdown wait time in ms.
-
getFactory
java.util.concurrent.ThreadFactory getFactory()
Return the thread pool factory. A value of null means the default jvm thread pool factory is used.- Returns:
- The thread pool factory or
null
-
getPriority
ThreadPoolConfig.ThreadPriority getPriority()
Return the priority for the threads.- Returns:
- The priority for the threads.
-
isDaemon
boolean isDaemon()
Return if daemon threads should be created.- Returns:
trueif daemon threads should be created.
-
-