Package wt.servlet

Interface ServletRequestMonitorMBean

All Superinterfaces:
DeluxeStatsMonitorMBean, RawStatisticsProviderMBean, SelfEmailingMBean
All Known Implementing Classes:
ServletRequestMonitor

public interface ServletRequestMonitorMBean extends DeluxeStatsMonitorMBean, RawStatisticsProviderMBean
Monitors servlet engine requests

Supported API: true

Extendable: true
  • Field Details

  • Method Details

    • getRequestCharacterEncoding

      String getRequestCharacterEncoding()
      Character encoding to apply to all requests to which this filter is applied; only applied when a non-empty encoding is specified and then not to requests which already have a character encoding specified

      Supported API: true
    • setRequestCharacterEncoding

      void setRequestCharacterEncoding(String requestCharacterEncoding)
      Character encoding to apply to all requests to which this filter is applied; only applied when a non-empty encoding is specified and then not to requests which already have a character encoding specified

      Supported API: true
    • getActiveRequests

      int getActiveRequests()
      Number of requests currently being processed

      Supported API: true
    • getMaxAverageActiveRequestsThreshold

      int getMaxAverageActiveRequestsThreshold()
      Maximum average request concurrency before log messages become warnings and notifications are sent when this statistic is maintained for a summary interval

      Supported API: true
    • setMaxAverageActiveRequestsThreshold

      void setMaxAverageActiveRequestsThreshold(int maxAverageActiveRequestThreshold)
      Maximum average request concurrency before log messages become warnings and notifications are sent when this statistic is maintained for a summary interval

      Supported API: true
    • getRequestTimeWarnThreshold

      double getRequestTimeWarnThreshold()
      Maximum request duration (in seconds) before related log messages become warnings

      Supported API: true
    • setRequestTimeWarnThreshold

      void setRequestTimeWarnThreshold(double requestTimeWarnThreshold)
      Maximum request duration (in seconds) before related log messages become warnings

      Supported API: true
    • getRequestLoggerName

      String getRequestLoggerName()
      Name of request logger

      Supported API: true
    • getRequestLoggerLevel

      String getRequestLoggerLevel()
      Request logging level (not persisted with MBean); valid values are ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF (or blank/unspecified)

      Supported API: true
    • setRequestLoggerLevel

      void setRequestLoggerLevel(String level)
      Request logging level (not persisted with MBean); valid values are ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF (or blank/unspecified)

      Supported API: true
    • getRequestLoggerOutputAttributes

      String getRequestLoggerOutputAttributes()
      List of RequestMBean attributes to be output to request log

      Supported API: true
    • setRequestLoggerOutputAttributes

      void setRequestLoggerOutputAttributes(String requestLoggerOutputAttributes)
      List of RequestMBean attributes to be output to request log

      Supported API: true
    • getRequestLoggerOutputAttributesSupported

      String[] getRequestLoggerOutputAttributesSupported()
      List of attributes supported for use in RequestLoggerOutputAttributes

      Supported API: true
    • isRequestLoggerUseShortFormat

      boolean isRequestLoggerUseShortFormat()
      Whether short format (which contains only attribute values, not names) is used for request logging

      Supported API: true
    • setRequestLoggerUseShortFormat

      void setRequestLoggerUseShortFormat(boolean requestLoggerUseShortFormat)
      Whether short format (which contains only attribute values, not names) is used for request logging

      Supported API: true
    • isRequestLoggerMultiLineFormat

      boolean isRequestLoggerMultiLineFormat()
      Whether multi-line format is used for request logging

      Supported API: true
    • setRequestLoggerMultiLineFormat

      void setRequestLoggerMultiLineFormat(boolean requestLoggerMultiLineFormat)
      Whether multi-line format is used for request logging

      Supported API: true
    • getRequestLoggerSeparatorString

      String getRequestLoggerSeparatorString()
      Item separator string used in request log format

      Supported API: true
    • setRequestLoggerSeparatorString

      void setRequestLoggerSeparatorString(String requestLoggerSeparatorString)
      Item separator string used in request log format

      Supported API: true
    • getRequestLoggerFormatString

      String getRequestLoggerFormatString()
      Low-level (java.util.Formatter) request log format string; if specified, overrides RequestLoggerUseShortFormat and RequestLoggerSeparatorString

      Supported API: true
    • setRequestLoggerFormatString

      void setRequestLoggerFormatString(String requestLoggerFormatString)
      Low-level (java.util.Formatter) request log format string; if specified, overrides RequestLoggerUseShortFormat and RequestLoggerSeparatorString

      Supported API: true
    • isRequestRegistrationEnabled

      boolean isRequestRegistrationEnabled()
      Whether requests are automatically registered and deregistered as JMX MBeans as they are received and completed; enabling this can adversely affect performance

      Supported API: true
    • setRequestRegistrationEnabled

      void setRequestRegistrationEnabled(boolean requestRegistrationEnabled)
      Whether requests are automatically registered and deregistered as JMX MBeans as they are received and completed; enabling this can adversely affect performance

      Supported API: true
    • isProcessCpuTimeMonitoringEnabled

      boolean isProcessCpuTimeMonitoringEnabled()
      Whether monitoring of overall process CPU time is enabled for this MBean; if not, then RequestMBean's ElapsedProcessCpuSeconds, ProcessPercentageOfTotalCpuTime, and PercentageOfProcessCpuTime attributes will not have meaningful values.

      Supported API: true
    • setProcessCpuTimeMonitoringEnabled

      void setProcessCpuTimeMonitoringEnabled(boolean processCpuTimeMonitoringEnabled)
      Whether monitoring of overall process CPU time is enabled for this MBean; if not, then RequestMBean's ElapsedProcessCpuSeconds, ProcessPercentageOfTotalCpuTime, and PercentageOfProcessCpuTime attributes will not have meaningful values.

      Supported API: true
    • getRequestXsltStylesheet

      String getRequestXsltStylesheet()
      XSLT stylesheet used by emailActiveRequests() for styling request data; if not specified, the Dumper MBean's DefaultXsltStylesheet will be used

      Supported API: true
    • setRequestXsltStylesheet

      void setRequestXsltStylesheet(String requestXsltStylesheet)
      XSLT stylesheet used by emailActiveRequests() for styling request data; if not specified, the Dumper MBean's DefaultXsltStylesheet will be used

      Supported API: true
    • isHaltJvmOnVirtualMachineError

      boolean isHaltJvmOnVirtualMachineError()
      Whether Java Virtual Machine (JVM) process should be halted upon catching a VirtualMachineError

      Supported API: true
    • setHaltJvmOnVirtualMachineError

      void setHaltJvmOnVirtualMachineError(boolean haltJvmOnVirtualMachineError)
      Whether Java Virtual Machine (JVM) process should be halted upon catching a VirtualMachineError

      Supported API: true
    • getSamplingIntervalSeconds

      int getSamplingIntervalSeconds()
      Interval (in seconds) at which both servlet request data is sampled and logged via logActiveRequests() and logRawStatistics(). Non-positive values disable this sampling.

      Supported API: true
    • setSamplingIntervalSeconds

      void setSamplingIntervalSeconds(int samplingIntervalSeconds)
      Interval (in seconds) at which both servlet request data is sampled and logged via logActiveRequests() and logRawStatistics(). Non-positive values disable this sampling.

      Supported API: true
    • getThrottleMaxConcurrency

      int getThrottleMaxConcurrency()
      Maximum number of concurrent requests allowed prior to requests being throttled; negative values result in throttling being disabled.

      Supported API: true
    • setThrottleMaxConcurrency

      void setThrottleMaxConcurrency(int throttleMaxConcurrency)
      Maximum number of concurrent requests allowed prior to requests being throttled; negative values result in throttling being disabled.

      Supported API: true
    • isThrottleFair

      boolean isThrottleFair()
      Whether throttling guarantees first-in first-out processing under contention.

      Supported API: true
    • setThrottleFair

      void setThrottleFair(boolean throttleFair)
      Whether throttling guarantees first-in first-out processing under contention.

      Supported API: true
    • getThrottledRequests

      int getThrottledRequests()
      Approximate number of requests currently waiting for processing due to throttling

      Supported API: true
    • getThrottleTimeoutSeconds

      long getThrottleTimeoutSeconds()
      Maximum number of seconds a request will be wait for processing due to request throttling prior to timing out (and returning a 503 status); negative values imply an unlimited wait

      Supported API: true
    • setThrottleTimeoutSeconds

      void setThrottleTimeoutSeconds(long throttleTimeoutSeconds)
      Maximum number of seconds a request will be wait for processing due to request throttling prior to timing out (and returning a 503 status); negative values imply an unlimited wait

      Supported API: true
    • getThrottleExcludesPattern

      String getThrottleExcludesPattern()
      Regular expression for context-relative request URIs which should not be throttled via ThrottleMaxConcurrency and related settings.

      Supported API: true
    • setThrottleExcludesPattern

      void setThrottleExcludesPattern(String throttleExcludesPattern)
      Regular expression for context-relative request URIs which should not be throttled via ThrottleMaxConcurrency and related settings.

      Supported API: true
    • getRequestMBeanInfo

      MBeanInfo getRequestMBeanInfo()
      MBeanInfo of wt.servlet.RequestMBeans. These MBeans are used to generate the request logger attributes and thus this MBeanInfo can be used to obtain type information for these attributes.

      Supported API: true
    • isAddRequestIdResponseHeader

      boolean isAddRequestIdResponseHeader()
      Whether the request id is added to all responses via the PTC-Request-Id header

      Supported API: true
      See Also:
    • setAddRequestIdResponseHeader

      void setAddRequestIdResponseHeader(boolean addRequestIdResponseHeader)
      Whether the request id is added to all responses via the PTC-Request-Id header

      Supported API: true
      See Also:
    • isAddXFrameOptionsResponseHeader

      boolean isAddXFrameOptionsResponseHeader()
      Whether an "X-Frame-Options" header should be added to all responses. When added, the value used is "SAMEORIGIN", which will cause MSIE 8 and higher, Firefox 3.6.9 and higher, and various other browsers (including Chrome and Safari) which support this header to prevent clickjacking attacks.

      Supported API: true
    • setAddXFrameOptionsResponseHeader

      void setAddXFrameOptionsResponseHeader(boolean addXFrameOptionsResponseHeader)
      Whether an "X-Frame-Options" header should be added to all responses. When added, the value used is "SAMEORIGIN", which will cause MSIE 8 and higher, Firefox 3.6.9 and higher, and various other browsers (including Chrome and Safari) which support this header to prevent clickjacking attacks.

      Supported API: true
    • getRequestListenerNames

      String[] getRequestListenerNames()
      Names of request listeners

      Supported API: true
    • getRequestListenerData

      TabularData getRequestListenerData() throws OpenDataException
      Names and class of request listeners

      Supported API: true
      Throws:
      OpenDataException
    • addRequestListener

      @MBeanOperationImpact(1) void addRequestListener(String listenerName, String listenerClassname) throws ClassNotFoundException, InstantiationException, IllegalAccessException
      Add a ContextListener instance of the specified class and give it the specified name.

      An attempt is made to find a constructor in the specified class taking a single String argument and call this constructor passing the specified listener name. If this fails, the no-arg constructor (which must be public) is used instead and an attempt is also made to call setName(String) on the instance. An attempt is also made to call setOwnerMBean(BaseObjectNamed) on the instance, passing it this MBean, so that any interested listeners can obtain this information.

      If the listener is a SelfAwareMBean, then the listener is registered as a child MBean of this MBean.

      The listener class should specifically implement ContextListener<RequestMBean> as the ContextListener methods will be passed RequestMBean instances. The listener class should also override equals() to return 'true' for logically equivalent instances if there are no other JavaBeans properties for XMLEncoder to use in such a comparison, else a StackOverflowError may occur when persisting this MBean.

      Supported API: true

      Parameters:
      listenerName - Name to give new listener
      listenerClassname - Classname of new listener; must implement wt.jmx.core.mbeans.ContextListener
      Throws:
      ClassNotFoundException
      InstantiationException
      IllegalAccessException
    • removeRequestListener

      @MBeanOperationImpact(1) void removeRequestListener(String listenerName)
      Removes request listener with the specified name, if such a listener exists.

      Supported API: true
      Parameters:
      listenerName - Name of listener to remove
    • interrupt

      @MBeanOperationImpact(1) void interrupt(String requestId)
      If specified request exists and is not completed, interrupts its thread. WARNING: This is a somewhat drastic operation which may have side-effects.

      Supported API: true
      Parameters:
      requestId - Id of request to interrupt
    • captureActiveRequest

      @MBeanOperationImpact(0) long captureActiveRequest(String requestId)
      Creates a set of MBeans containing only the request with the specified id, if it is active, and returns the set's id if no such request is active, -1 is returned

      Supported API: true
      Parameters:
      requestId - Id of request to capture
    • captureActiveRequests

      @MBeanOperationImpact(0) long captureActiveRequests()
      Creates a set of MBeans representing all requests currently being processed and returns its id

      Supported API: true
    • releaseCapturedRequests

      @MBeanOperationImpact(1) void releaseCapturedRequests()
      Releases all RequestSets and the request MBeans they contain

      Supported API: true
    • releaseCapturedRequestSet

      @MBeanOperationImpact(1) void releaseCapturedRequestSet(long captureSetId)
      Releases a set of MBeans previously captured with captureActiveRequests()

      Supported API: true
      Parameters:
      captureSetId - Id of set of requests to release (as returned by captureActiveRequests())
    • getRequestSetObjectName

      @MBeanOperationImpact(0) ObjectName getRequestSetObjectName(long captureSetId)
      Given the id of a request set as returned by captureActiveRequests(), returns its ObjectName or null if the indicated request set no longer exists

      Supported API: true
      Parameters:
      captureSetId - Id of set of requests to release (as returned by captureActiveRequests())
    • emailActiveRequests

      @MBeanOperationImpact(0) void emailActiveRequests(String addressesOrEmailList, String subject, boolean compress) throws Exception
      E-mail styled data for all requests currently being processed

      Supported API: true
      Parameters:
      addressesOrEmailList - Comma-delimited list of e-mail addresses or name of e-mail list to send e-mail to
      subject - Subject to give e-mail
      compress - Whether e-mail contents should be compressed
      Throws:
      Exception
    • getActiveRequestAttributes

      @MBeanOperationImpact(0) AttributeList[] getActiveRequestAttributes(String[] attributeNames)
      Returns array of AttributeLists containing requested attributes, one for each active request.

      Supported API: true
      Parameters:
      attributeNames - Names of JMX (not servlet API) attributes (of wt.servlet.RequestMBean) to retrieve; null implies all attributes
    • getActiveRequestAttributes

      @MBeanOperationImpact(0) AttributeList[] getActiveRequestAttributes(String[] attributeNames, double elapsedSecondsThreshold)
      Returns array of AttributeLists containing requested attributes, one for each active request that has been active longer than the specified number of seconds.

      Supported API: true
      Parameters:
      attributeNames - Names of JMX (not servlet API) attributes (of wt.servlet.RequestMBean) to retrieve; null implies all attributes
      elapsedSecondsThreshold - Minimum length of request in seconds to include in the results of this operation
    • getActiveRequestAttributes

      @MBeanOperationImpact(0) AttributeList[] getActiveRequestAttributes(String[] attributeNames, RequestMBeanFilter filter)
      Returns array of AttributeLists containing requested attributes, one for each active request that passes the specified filter.

      Supported API: true
      Parameters:
      attributeNames - Names of JMX (not servlet API) attributes (of wt.servlet.RequestMBean) to retrieve; null implies all attributes
      filter - Filter that determines which requests to include data for; if null, data is included for all active requests
    • getActiveRequestAttributes

      @MBeanOperationImpact(0) AttributeList getActiveRequestAttributes(String requestId, String[] attributeNames)
      Returns AttributeList containing requested attributes for specified active request.

      Supported API: true
      Parameters:
      requestId - Id of request to get attributes of
      attributeNames - Names of JMX (not servlet API) attributes (of wt.servlet.RequestMBean) to retrieve; null implies all attributes
    • logActiveRequests

      @MBeanOperationImpact(0) void logActiveRequests()
      Logs all active requests as RequestMBean objects. This is done via the wt.servlet.ServletRequestMonitor.activeRequest logger at INFO level verbosity except for requests whose elapsed time exceeds RequestTimeWarnThreshold seconds, which are logged at WARN level verbosity. This operation will therefore produce no output if the level of this logger is not sufficiently verbose. Also note that the default string rendering of these objects provides little information. Instead, these objects are also DynamicMBeans and are intended to provide rich access for specialized log4j appenders, renderers, and layouts.

      Supported API: true
    • logActiveRequests

      @MBeanOperationImpact(0) void logActiveRequests(double elapsedSecondsThreshold)
      Logs active requests as RequestMBean objects. This is done via the wt.servlet.ServletRequestMonitor.activeRequest logger at INFO level verbosity except for requests whose elapsed time exceeds RequestTimeWarnThreshold seconds, which are logged at WARN level verbosity. This operation will therefore produce no output if the level of this logger is not sufficiently verbose. Also note that the default string rendering of these objects provides little information. Instead, these objects are also DynamicMBeans and are intended to provide rich access for specialized log4j appenders, renderers, and layouts.

      Supported API: true
      Parameters:
      elapsedSecondsThreshold - Minimum length of request in seconds to log
    • logActiveRequests

      @MBeanOperationImpact(0) void logActiveRequests(RequestMBeanFilter filter)
      Logs active requests as RequestMBean objects. This is done via the wt.servlet.ServletRequestMonitor.activeRequest logger at INFO level verbosity except for requests whose elapsed time exceeds RequestTimeWarnThreshold seconds, which are logged at WARN level verbosity. This operation will therefore produce no output if the level of this logger is not sufficiently verbose. Also note that the default string rendering of these objects provides little information. Instead, these objects are also DynamicMBeans and are intended to provide rich access for specialized log4j appenders, renderers, and layouts.

      Supported API: true
      Parameters:
      filter - Filter that determines which requests to log; if null, all active requests are logged