Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » catalina » valves » [javadoc | source]
org.apache.catalina.valves
public class: SemaphoreValve [javadoc | source]
java.lang.Object
   org.apache.catalina.valves.ValveBase
      org.apache.catalina.valves.SemaphoreValve

All Implemented Interfaces:
    Lifecycle, Valve, MBeanRegistration, Contained

Implementation of a Valve that limits concurrency.

This Valve may be attached to any Container, depending on the granularity of the concurrency control you wish to perform.

Field Summary
protected  Semaphore semaphore    Semaphore. 
protected  LifecycleSupport lifecycle    The lifecycle event support for this component. 
protected  int concurrency    Concurrency level of the semaphore. 
protected  boolean fairness    Fairness of the semaphore. 
protected  boolean block    Block until a permit is available. 
protected  boolean interruptible    Block interruptibly until a permit is available. 
Fields inherited from org.apache.catalina.valves.ValveBase:
container,  containerLog,  info,  next,  sm,  domain,  oname,  mserver,  controller
Method from org.apache.catalina.valves.SemaphoreValve Summary:
addLifecycleListener,   controlConcurrency,   findLifecycleListeners,   getBlock,   getConcurrency,   getFairness,   getInfo,   getInterruptible,   invoke,   permitDenied,   removeLifecycleListener,   setBlock,   setConcurrency,   setFairness,   setInterruptible,   start,   stop
Methods from org.apache.catalina.valves.ValveBase:
backgroundProcess,   createObjectName,   event,   getContainer,   getContainerName,   getController,   getDomain,   getInfo,   getNext,   getObjectName,   getParentName,   invoke,   postDeregister,   postRegister,   preDeregister,   preRegister,   setContainer,   setController,   setNext,   setObjectName,   toString
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.catalina.valves.SemaphoreValve Detail:
 public  void addLifecycleListener(LifecycleListener listener) 
    Add a lifecycle event listener to this component.
 public boolean controlConcurrency(Request request,
    Response response) 
    Subclass friendly method to add conditions.
 public LifecycleListener[] findLifecycleListeners() 
    Get the lifecycle listeners associated with this lifecycle. If this Lifecycle has no listeners registered, a zero-length array is returned.
 public boolean getBlock() 
 public int getConcurrency() 
 public boolean getFairness() 
 public String getInfo() 
    Return descriptive information about this Valve implementation.
 public boolean getInterruptible() 
 public  void invoke(Request request,
    Response response) throws IOException, ServletException 
    Do concurrency control on the request using the semaphore.
 public  void permitDenied(Request request,
    Response response) throws IOException, ServletException 
    Subclass friendly method to add error handling when a permit isn't granted.
 public  void removeLifecycleListener(LifecycleListener listener) 
    Remove a lifecycle event listener from this component.
 public  void setBlock(boolean block) 
 public  void setConcurrency(int concurrency) 
 public  void setFairness(boolean fairness) 
 public  void setInterruptible(boolean interruptible) 
 public  void start() throws LifecycleException 
    Prepare for the beginning of active use of the public methods of this component. This method should be called after configure(), and before any of the public methods of the component are utilized.
 public  void stop() throws LifecycleException 
    Gracefully terminate the active use of the public methods of this component. This method should be the last one called on a given instance of this component.