|
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.valves.ValveBase org.apache.catalina.valves.StuckThreadDetectionValve
public class StuckThreadDetectionValve
This valve allows to detect requests that take a long time to process, which might indicate that the thread that is processing it is stuck. Based on code proposed by TomLu in Bugzilla entry #50306
Field Summary |
---|
Fields inherited from class org.apache.catalina.valves.ValveBase |
---|
asyncSupported, container, containerLog, next |
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 | |
---|---|
StuckThreadDetectionValve()
Required to enable async support. |
Method Summary | |
---|---|
void |
backgroundProcess()
Execute a periodic task, such as reloading, etc. |
String |
getInfo()
Return descriptive information about this Valve implementation. |
long[] |
getStuckThreadIds()
|
int |
getThreshold()
|
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. |
void |
invoke(Request request,
Response response)
The implementation-specific logic represented by this Valve. |
void |
setThreshold(int threshold)
Specify the threshold (in seconds) used when checking for stuck threads. |
Methods inherited from class org.apache.catalina.valves.ValveBase |
---|
event, getContainer, getDomainInternal, getNext, getObjectNameKeyProperties, isAsyncSupported, setAsyncSupported, setContainer, setNext, startInternal, stopInternal, toString |
Methods inherited from class org.apache.catalina.util.LifecycleMBeanBase |
---|
destroyInternal, 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, wait, wait, wait |
Constructor Detail |
---|
public StuckThreadDetectionValve()
Method Detail |
---|
public void setThreshold(int threshold)
threshold
- The new threshold in secondspublic int getThreshold()
setThreshold(int)
protected void initInternal() throws LifecycleException
LifecycleMBeanBase
initInternal
in class ValveBase
LifecycleException
public String getInfo()
getInfo
in interface Valve
getInfo
in class ValveBase
public void invoke(Request request, Response response) throws IOException, ServletException
This method MUST be provided by a subclass.
invoke
in interface Valve
invoke
in class ValveBase
request
- The servlet request to be processedresponse
- The servlet response to be created
IOException
- if an input/output error occurs
ServletException
- if a servlet error occurspublic void backgroundProcess()
ValveBase
backgroundProcess
in interface Valve
backgroundProcess
in class ValveBase
public long[] getStuckThreadIds()
|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |