Class ThrottleFilter

  • All Implemented Interfaces:
    java.io.Serializable, javax.servlet.Filter, javax.servlet.FilterConfig

    @Deprecated
    public class ThrottleFilter
    extends GenericFilter
    Deprecated.
    ThrottleFilter, a filter for easing server during heavy load.

    Intercepts requests, and returns HTTP response code 503 (Service Unavailable), if there are more than a given number of concurrent requests, to avoid large backlogs. The number of concurrent requests and the response messages sent to the user agent, is configurable from the web descriptor.

    Version:
    $Id: ThrottleFilter.java#1 $
    Author:
    Harald Kuhr, last modified by $Author: haku $
    See Also:
    setMaxConcurrentThreadCount(java.lang.String), setResponseMessages(java.lang.String), Serialized Form
    • Field Detail

      • maxConcurrentThreadCount

        protected int maxConcurrentThreadCount
        Deprecated.
        Minimum free thread count, defaults to 10
      • DEFUALT_RESPONSE_MESSAGE

        protected static final java.lang.String DEFUALT_RESPONSE_MESSAGE
        Deprecated.
        Default response message sent to user agents, if the request is rejected
        See Also:
        Constant Field Values
      • DEFAULT_TYPE

        protected static final java.lang.String DEFAULT_TYPE
        Deprecated.
        Default response content type
        See Also:
        Constant Field Values
    • Constructor Detail

      • ThrottleFilter

        public ThrottleFilter()
        Deprecated.
    • Method Detail

      • setMaxConcurrentThreadCount

        public void setMaxConcurrentThreadCount​(java.lang.String pMaxConcurrentThreadCount)
        Deprecated.
        Sets the minimum free thread count.
        Parameters:
        pMaxConcurrentThreadCount -
      • setResponseMessages

        public void setResponseMessages​(java.lang.String pResponseMessages)
        Deprecated.
        Sets the response message sent to the user agent, if the request is rejected.
        The format is <mime-type>=<filename>, <mime-type>=<filename>.
        Example: <text/vnd.wap.wmlgt;=</errors/503.wml>, <text/html>=</errors/503.html>
        Parameters:
        pResponseMessages -
      • doFilterImpl

        protected void doFilterImpl​(javax.servlet.ServletRequest pRequest,
                                    javax.servlet.ServletResponse pResponse,
                                    javax.servlet.FilterChain pChain)
                             throws java.io.IOException,
                                    javax.servlet.ServletException
        Deprecated.
        Description copied from class: GenericFilter
        Invoked once, or each time a request/response pair is passed through the chain, depending on the GenericFilter.oncePerRequest member variable.
        Specified by:
        doFilterImpl in class GenericFilter
        Parameters:
        pRequest -
        pResponse -
        pChain -
        Throws:
        java.io.IOException
        javax.servlet.ServletException
        See Also:
        GenericFilter.oncePerRequest, doFilter, Filter.doFilter