FileDocCategorySizeDatePackage
Valve.javaAPI DocGlassfish v2 API7745Fri May 04 22:31:52 BST 2007org.apache.catalina

Valve

public interface Valve

A Valve is a request processing component associated with a particular Container. A series of Valves are generally associated with each other into a Pipeline. The detailed contract for a Valve is included in the description of the invoke() method below.

HISTORICAL NOTE: The "Valve" name was assigned to this concept because a valve is what you use in a real world pipeline to control and/or modify flows through it.
author
Craig R. McClanahan
author
Gunnar Rjnning
author
Peter Donald
version
$Revision: 1.3 $ $Date: 2007/05/05 05:31:52 $

Fields Summary
public static final int
INVOKE_NEXT
A valve returns this value to indicate (to the pipeline) that the next valve in the pipeline can be invoked.
public static final int
END_PIPELINE
A valve returns this value to indicate that no further processing of the request should take place (along the rest of the pipeline). All valves that are function as 'basic' valves return this value as they are the 'last' valve in the pipeline. A valve (such as an authenticator) may return this value to stop a request from being processed further because the user/password could not be verified.
Constructors Summary
Methods Summary
public java.lang.StringgetInfo()
Return descriptive information about this Valve implementation.

public intinvoke(Request request, Response response)
  • In order to reduce the stack depth, a ValveContext is no longer passed into the invoke() method. Instead, the method returns either INVOKE_NEXT or END_PIPELINE to the caller (Pipeline.invoke()). This return code is used to determine whether the next valve in the pipeline should be invoked.

    return
    INVOKE_NEXT or END_PIPELINE

  • public voidpostInvoke(Request request, Response response)

    Perform post-request processing as required by this Valve.

    param
    request The servlet request to be processed
    param
    response The servlet response to be created
    exception
    IOException if an input/output error occurs
    exception
    ServletException if a servlet error occurs