Apache Tomcat 6.0.53

org.apache.catalina.valves
Class StuckThreadDetectionValve

java.lang.Object
  extended by org.apache.catalina.valves.ValveBase
      extended by org.apache.catalina.valves.StuckThreadDetectionValve
All Implemented Interfaces:
javax.management.MBeanRegistration, Contained, Valve

public class StuckThreadDetectionValve
extends ValveBase

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.


Field Summary
 
Fields inherited from class org.apache.catalina.valves.ValveBase
container, containerLog, controller, domain, info, mserver, next, oname
 
Constructor Summary
StuckThreadDetectionValve()
           
 
Method Summary
 void backgroundProcess()
          Execute a periodic task, such as reloading, etc.
 long[] getStuckThreadIds()
           
 java.lang.String[] getStuckThreadNames()
           
 int getThreshold()
           
 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
createObjectName, event, getContainer, getContainerName, getController, getDomain, getInfo, getNext, getObjectName, getParentName, postDeregister, postRegister, preDeregister, preRegister, setContainer, setController, setNext, setObjectName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StuckThreadDetectionValve

public StuckThreadDetectionValve()
Method Detail

setThreshold

public void setThreshold(int threshold)
Specify the threshold (in seconds) used when checking for stuck threads. If <=0, the detection is disabled. The default is 600 seconds.

Parameters:
threshold - The new threshold in seconds

getThreshold

public int getThreshold()
Returns:
The current threshold in seconds
See Also:
setThreshold(int)

invoke

public void invoke(Request request,
                   Response response)
            throws java.io.IOException,
                   javax.servlet.ServletException
The implementation-specific logic represented by this Valve. See the Valve description for the normal design patterns for this method.

This method MUST be provided by a subclass.

Specified by:
invoke in interface Valve
Specified by:
invoke in class ValveBase
Parameters:
request - The servlet request to be processed
response - The servlet response to be created
Throws:
java.io.IOException - if an input/output error occurs
javax.servlet.ServletException - if a servlet error occurs

backgroundProcess

public void backgroundProcess()
Description copied from class: ValveBase
Execute a periodic task, such as reloading, etc. This method will be invoked inside the classloading context of this container. Unexpected throwables will be caught and logged.

Specified by:
backgroundProcess in interface Valve
Overrides:
backgroundProcess in class ValveBase

getStuckThreadIds

public long[] getStuckThreadIds()

getStuckThreadNames

public java.lang.String[] getStuckThreadNames()

Apache Tomcat 6.0.53

Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.