HydraExpress™ C++ API Reference Guide

Product Documentation:
   HydraExpress C++
Documentation Home
List of all members | Public Member Functions
rwsf::Filter Class Referenceabstract

Base class for filters. More...

#include <rwsf/servlet/Filter.h>

Public Member Functions

virtual void destroy ()
 
virtual void doFilter (rwsf::ServletRequest &request, rwsf::ServletResponse &response, rwsf::FilterChain *chain)=0
 
rwsf::FilterConfig getFilterConfig () const
 
virtual void init (const rwsf::FilterConfig &filterConfig)
 

Detailed Description

rwsf::Filter is the base class for filters. A filter processes the requests and responses for a resource. For example, a filter might compress or encode the response from a Web Service, transform an XML response into HTML, or adapt an incoming request.

The Agent loads filters during initialization. Each rwsf::Filter contains an rwsf::FilterConfig that holds the initialization parameters for the filter. The rwsf::FilterConfig object also provides access to the rwsf::ServletContext object that represents the context within which the filter is deployed.

Member Function Documentation

virtual void rwsf::Filter::destroy ( )
virtual

The Agent calls this function when the filter is removed from service. All cleanup for a filter should be done in this method rather than in the filter destructor.

virtual void rwsf::Filter::doFilter ( rwsf::ServletRequest request,
rwsf::ServletResponse response,
rwsf::FilterChain chain 
)
pure virtual

Pure virtual function. Processes a request. In derived classes, the Agent calls this function for each request received from a client. A derived class uses the doFilter() function of the chain to invoke the next filter in the filter chain.

rwsf::FilterConfig rwsf::Filter::getFilterConfig ( ) const

Returns the rwsf::FilterConfig object that was used to initialize this filter.

virtual void rwsf::Filter::init ( const rwsf::FilterConfig filterConfig)
virtual

This method is called by the Agent when this filter is first initialized. Override this method in a derived class to add initialization code. All resource allocation for a filter should be done in this method rather than in the filter constructor.

Copyright © 2019 Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is registered trademark of Rogue Wave Software, Inc. in the United States and other countries, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.