View on
Brian Moseley > Wombat > Wombat::Valve



Annotate this POD

View/Report Bugs


Wombat::Valve - internal valve interface



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.


invoke ($request, $response, $context)

Perform request processing as required by this Valve.



the Wombat::Request to be processed


the Wombat::Response to be created


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



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


if an input or output error occurs


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


Brian Moseley,

syntax highlighting: