NAME

Wombat::Valve - internal valve interface


SYNOPSIS


DESCRIPTION

This interface specifies a component that assists in processing requests for a particular Container. A series of Valves is generally associated with each other via a Pipeline.

A Valve MAY perform the following actions, in the specified order:

  1. Examine and/or modify the properties of the specified Request and Response.

  2. Examine the properties of the specified Request, completely generate the corresponding Response, and return control to the caller.

  3. Examine the properties of the specified Request and Response, wrap either or both of these objects to supplement their functionality, and pass them on.

  4. If the corresponding Response was not generated (and control was not returned), call the next Valve in the Pipeline by calling invokeNext() on the Valve's Container.

  5. Examine, but not modify, the properties of the resulting Response (which was created by a subsequently invoked Valve or Container).

A Valve MUST NOT do any of the following things:

  1. Change request properties that have already been used to direct the flow of processing control for this request.

  2. Create a completed Response AND pass this Request and Response on to the next Valve in the Pipeline.

  3. Consume bytes from the input handle associated with the Request, unless it is completely generating the Response or wrapping the Request before passing it on.

  4. Modify the HTTP headers included with the Response after invokeNext() has returned.

  5. Perform any actions on the output handle associated with the specified Response after invokeNext() has returned.


PUBLIC METHODS

invoke ($request, $response, $context)
Perform request processing as required by this Valve.

Parameters

$request
the Wombat::Request to be processed

$response
the Wombat::Response to be created

$context
the Wombat::ValveContext allowing access to the next Valve in the Pipeline being processed

Throws:

Servlet::ServletException
if a servlet error occurs or is thrown by a subsequently invoked Valve, Filter or Servlet

Servlet::Util::IOException
if an input or output error occurs


SEE ALSO

the Servlet::Util::Exception manpage, the Wombat::Container manpage, the Wombat::Exception manpage, the Wombat::Pipeline manpage, the Wombat::Request manpage, the Wombat::Response manpage, the Wombat::ValveContext manpage


AUTHOR

Brian Moseley, bcm@maz.org