public final class ModifiableThreadPoolConfig extends java.lang.Object implements ThreadPoolConfig
ThreadPoolConfig.ThreadPoolPolicy, ThreadPoolConfig.ThreadPriority
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROPERTY_BLOCK_POLICY
Configuration property for the block policy.
|
static java.lang.String |
PROPERTY_DAEMON
Configuration property for the daemon flag.
|
static java.lang.String |
PROPERTY_KEEP_ALIVE_TIME
Configuration property for the keep alive time.
|
static java.lang.String |
PROPERTY_MAX_POOL_SIZE
Configuration property for the max pool size.
|
static java.lang.String |
PROPERTY_MAX_THREAD_AGE
Configuration property for the max thread age.
|
static java.lang.String |
PROPERTY_MIN_POOL_SIZE
Configuration property for the min pool size.
|
static java.lang.String |
PROPERTY_NAME
Configuration property for the thread pool name.
|
static java.lang.String |
PROPERTY_PRIORITY
Configuration property for the priority.
|
static java.lang.String |
PROPERTY_QUEUE_SIZE
Configuration property for the queue size.
|
static java.lang.String |
PROPERTY_SHUTDOWN_GRACEFUL
Configuration property for the shutdown graceful flag.
|
static java.lang.String |
PROPERTY_SHUTDOWN_WAIT_TIME
Configuration property for the shutdown wait time.
|
Constructor and Description |
---|
ModifiableThreadPoolConfig()
Create a new default configuration.
|
ModifiableThreadPoolConfig(ThreadPoolConfig copy)
Clone an existing configuration
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
ThreadPoolConfig.ThreadPoolPolicy |
getBlockPolicy()
Return the block policy.
|
java.util.concurrent.ThreadFactory |
getFactory()
Return the thread pool factory.
|
long |
getKeepAliveTime()
Return the keep alive time.
|
int |
getMaxPoolSize()
Return the maximum pool size
|
long |
getMaxThreadAge()
Return the maximum age before a thread is retired.
|
int |
getMinPoolSize()
Return the minimum pool size.
|
ThreadPoolConfig.ThreadPriority |
getPriority()
Return the priority for the threads.
|
int |
getQueueSize()
Return the queue size.
|
int |
getShutdownWaitTimeMs()
Return the shutdown wait time in ms.
|
int |
hashCode() |
boolean |
isDaemon()
Return if daemon threads should be created.
|
boolean |
isShutdownGraceful()
Should this pool shutdown graceful.
|
void |
setBlockPolicy(ThreadPoolConfig.ThreadPoolPolicy blockPolicy)
Set the block policy.
|
void |
setDaemon(boolean isDaemon)
Set the daemon handling.
|
void |
setFactory(java.util.concurrent.ThreadFactory factory)
Set the thread factory.
|
void |
setKeepAliveTime(long keepAliveTime)
Set the keep alive time.
|
void |
setMaxPoolSize(int maxPoolSize)
Set the max pool size.
|
void |
setMaxThreadAge(long maxThreadAge)
Deprecated.
Since version 3.4.0 should no longer be called, as threads are no longer retired
but instead the thread locals are cleaned up (SLING-6261)
|
void |
setMinPoolSize(int minPoolSize)
Set the min pool size.
|
void |
setPriority(ThreadPoolConfig.ThreadPriority priority)
Set the thread priority.
|
void |
setQueueSize(int queueSize)
Set the queue size.
|
void |
setShutdownGraceful(boolean shutdownGraceful)
Set if the pool should be shutdown graceful.
|
void |
setShutdownWaitTimeMs(int shutdownWaitTimeMs)
Set the shutdown wait time.
|
public static final java.lang.String PROPERTY_MIN_POOL_SIZE
public static final java.lang.String PROPERTY_MAX_POOL_SIZE
public static final java.lang.String PROPERTY_QUEUE_SIZE
public static final java.lang.String PROPERTY_MAX_THREAD_AGE
public static final java.lang.String PROPERTY_KEEP_ALIVE_TIME
public static final java.lang.String PROPERTY_BLOCK_POLICY
public static final java.lang.String PROPERTY_SHUTDOWN_GRACEFUL
public static final java.lang.String PROPERTY_SHUTDOWN_WAIT_TIME
public static final java.lang.String PROPERTY_PRIORITY
public static final java.lang.String PROPERTY_DAEMON
public static final java.lang.String PROPERTY_NAME
public ModifiableThreadPoolConfig()
public ModifiableThreadPoolConfig(ThreadPoolConfig copy)
copy
- The config to clonepublic int getMinPoolSize()
ThreadPoolConfig
getMinPoolSize
in interface ThreadPoolConfig
ThreadPoolConfig.getMinPoolSize()
public void setMinPoolSize(int minPoolSize)
minPoolSize
- New min pool size.public int getMaxPoolSize()
ThreadPoolConfig
getMaxPoolSize
in interface ThreadPoolConfig
ThreadPoolConfig.getMaxPoolSize()
public void setMaxPoolSize(int maxPoolSize)
maxPoolSize
- New max pool size.public int getQueueSize()
ThreadPoolConfig
getQueueSize
in interface ThreadPoolConfig
ThreadPoolConfig.getQueueSize()
public void setQueueSize(int queueSize)
queueSize
- New queue size.public long getMaxThreadAge()
ThreadPoolConfig
getMaxThreadAge
in interface ThreadPoolConfig
public void setMaxThreadAge(long maxThreadAge)
maxThreadAge
- New max thread age in milliseconds.public long getKeepAliveTime()
ThreadPoolConfig
getKeepAliveTime
in interface ThreadPoolConfig
ThreadPoolConfig.getKeepAliveTime()
public void setKeepAliveTime(long keepAliveTime)
keepAliveTime
- New keep alive time.public ThreadPoolConfig.ThreadPoolPolicy getBlockPolicy()
ThreadPoolConfig
getBlockPolicy
in interface ThreadPoolConfig
ThreadPoolConfig.getBlockPolicy()
public void setBlockPolicy(ThreadPoolConfig.ThreadPoolPolicy blockPolicy)
blockPolicy
- The new block policy.java.lang.IllegalArgumentException
- If blockPolicy is null.public boolean isShutdownGraceful()
ThreadPoolConfig
isShutdownGraceful
in interface ThreadPoolConfig
true
if the pool should shutdown graceful.ThreadPoolConfig.isShutdownGraceful()
public void setShutdownGraceful(boolean shutdownGraceful)
shutdownGraceful
- The shutdown graceful setting.public int getShutdownWaitTimeMs()
ThreadPoolConfig
getShutdownWaitTimeMs
in interface ThreadPoolConfig
ThreadPoolConfig.getShutdownWaitTimeMs()
public void setShutdownWaitTimeMs(int shutdownWaitTimeMs)
shutdownWaitTimeMs
- The new shutdown wait time.public java.util.concurrent.ThreadFactory getFactory()
ThreadPoolConfig
getFactory
in interface ThreadPoolConfig
null
ThreadPoolConfig.getFactory()
public void setFactory(java.util.concurrent.ThreadFactory factory)
factory
- The thread factory to be used or null
to use
the default thread factory.public ThreadPoolConfig.ThreadPriority getPriority()
ThreadPoolConfig
getPriority
in interface ThreadPoolConfig
ThreadPoolConfig.getPriority()
public void setPriority(ThreadPoolConfig.ThreadPriority priority)
priority
- The thread priority.java.lang.IllegalArgumentException
- If priority is null.public boolean isDaemon()
ThreadPoolConfig
isDaemon
in interface ThreadPoolConfig
true
if daemon threads should be created.ThreadPoolConfig.isDaemon()
public void setDaemon(boolean isDaemon)
isDaemon
- The daemon setting.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"