|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.catalina.util.LifecycleBase org.apache.catalina.util.LifecycleMBeanBase org.apache.catalina.core.StandardThreadExecutor
public class StandardThreadExecutor
Field Summary | |
---|---|
protected boolean |
daemon
Run threads in daemon or non-daemon state |
protected ThreadPoolExecutor |
executor
The executor we use for this component |
protected int |
maxIdleTime
idle time in milliseconds |
protected int |
maxQueueSize
The maximum number of elements that can queue up before we reject them |
protected int |
maxThreads
max number of threads |
protected int |
minSpareThreads
min number of threads |
protected String |
name
the name of this thread pool |
protected String |
namePrefix
Default name prefix for the thread name |
protected boolean |
prestartminSpareThreads
prestart threads? |
protected int |
threadPriority
Default thread priority |
protected long |
threadRenewalDelay
After a context is stopped, threads in the pool are renewed. |
Fields inherited from class org.apache.catalina.util.LifecycleMBeanBase |
---|
mserver |
Fields inherited from interface org.apache.catalina.Lifecycle |
---|
AFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT |
Constructor Summary | |
---|---|
StandardThreadExecutor()
|
Method Summary | |
---|---|
void |
contextStopping()
|
protected void |
destroyInternal()
Sub-classes wishing to perform additional clean-up should override this method, ensuring that super.destroyInternal() is the last call in the overriding method. |
void |
execute(Runnable command)
|
void |
execute(Runnable command,
long timeout,
TimeUnit unit)
Executes the given command at some time in the future. |
int |
getActiveCount()
Returns the approximate number of threads that are actively executing tasks. |
long |
getCompletedTaskCount()
|
int |
getCorePoolSize()
|
protected String |
getDomainInternal()
Method implemented by sub-classes to identify the domain in which MBeans should be registered. |
int |
getLargestPoolSize()
|
int |
getMaxIdleTime()
|
int |
getMaxQueueSize()
|
int |
getMaxThreads()
|
int |
getMinSpareThreads()
|
String |
getName()
|
String |
getNamePrefix()
|
protected String |
getObjectNameKeyProperties()
Allow sub-classes to specify the key properties component of the ObjectName that will be used to register this component. |
int |
getPoolSize()
Returns the current number of threads in the pool. |
int |
getQueueSize()
|
int |
getThreadPriority()
|
long |
getThreadRenewalDelay()
|
protected void |
initInternal()
Sub-classes wishing to perform additional initialization should override this method, ensuring that super.initInternal() is the first call in the overriding method. |
boolean |
isDaemon()
|
boolean |
isPrestartminSpareThreads()
|
boolean |
resizePool(int corePoolSize,
int maximumPoolSize)
|
boolean |
resizeQueue(int capacity)
|
void |
setDaemon(boolean daemon)
|
void |
setMaxIdleTime(int maxIdleTime)
|
void |
setMaxQueueSize(int size)
|
void |
setMaxThreads(int maxThreads)
|
void |
setMinSpareThreads(int minSpareThreads)
|
void |
setName(String name)
|
void |
setNamePrefix(String namePrefix)
|
void |
setPrestartminSpareThreads(boolean prestartminSpareThreads)
|
void |
setThreadPriority(int threadPriority)
|
void |
setThreadRenewalDelay(long threadRenewalDelay)
|
protected void |
startInternal()
Start the component and implement the requirements of LifecycleBase.startInternal() . |
protected void |
stopInternal()
Stop the component and implement the requirements of LifecycleBase.stopInternal() . |
Methods inherited from class org.apache.catalina.util.LifecycleMBeanBase |
---|
getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister |
Methods inherited from class org.apache.catalina.util.LifecycleBase |
---|
addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, init, removeLifecycleListener, setState, setState, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.catalina.Lifecycle |
---|
addLifecycleListener, destroy, findLifecycleListeners, getState, getStateName, init, removeLifecycleListener, start, stop |
Field Detail |
---|
protected int threadPriority
protected boolean daemon
protected String namePrefix
protected int maxThreads
protected int minSpareThreads
protected int maxIdleTime
protected ThreadPoolExecutor executor
protected String name
protected boolean prestartminSpareThreads
protected int maxQueueSize
protected long threadRenewalDelay
Constructor Detail |
---|
public StandardThreadExecutor()
Method Detail |
---|
protected void initInternal() throws LifecycleException
LifecycleMBeanBase
initInternal
in class LifecycleMBeanBase
LifecycleException
protected void startInternal() throws LifecycleException
LifecycleBase.startInternal()
.
startInternal
in class LifecycleBase
LifecycleException
- if this component detects a fatal error
that prevents this component from being usedprotected void stopInternal() throws LifecycleException
LifecycleBase.stopInternal()
.
stopInternal
in class LifecycleBase
LifecycleException
- if this component detects a fatal error
that needs to be reportedprotected void destroyInternal() throws LifecycleException
LifecycleMBeanBase
destroyInternal
in class LifecycleMBeanBase
LifecycleException
public void execute(Runnable command, long timeout, TimeUnit unit)
Executor
command
- the runnable taskpublic void execute(Runnable command)
execute
in interface Executor
public void contextStopping()
public int getThreadPriority()
public boolean isDaemon()
public String getNamePrefix()
public int getMaxIdleTime()
public int getMaxThreads()
getMaxThreads
in interface ResizableExecutor
public int getMinSpareThreads()
public String getName()
public boolean isPrestartminSpareThreads()
public void setThreadPriority(int threadPriority)
public void setDaemon(boolean daemon)
public void setNamePrefix(String namePrefix)
public void setMaxIdleTime(int maxIdleTime)
public void setMaxThreads(int maxThreads)
public void setMinSpareThreads(int minSpareThreads)
public void setPrestartminSpareThreads(boolean prestartminSpareThreads)
public void setName(String name)
public void setMaxQueueSize(int size)
public int getMaxQueueSize()
public long getThreadRenewalDelay()
public void setThreadRenewalDelay(long threadRenewalDelay)
public int getActiveCount()
ResizableExecutor
getActiveCount
in interface ResizableExecutor
public long getCompletedTaskCount()
public int getCorePoolSize()
public int getLargestPoolSize()
public int getPoolSize()
ResizableExecutor
getPoolSize
in interface ResizableExecutor
public int getQueueSize()
public boolean resizePool(int corePoolSize, int maximumPoolSize)
resizePool
in interface ResizableExecutor
public boolean resizeQueue(int capacity)
resizeQueue
in interface ResizableExecutor
protected String getDomainInternal()
LifecycleMBeanBase
getDomainInternal
in class LifecycleMBeanBase
protected String getObjectNameKeyProperties()
LifecycleMBeanBase
ObjectName
that will be used to register this component.
getObjectNameKeyProperties
in class LifecycleMBeanBase
ObjectName
|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |