rwlogo
HydraExpress 4.6

HydraExpress C++ API Reference Guide


   


Rogue Wave web site:  Home Page  |  Main Documentation Page

rwsf::MessageInfoHandlerChain Class Reference
[Message Handling]

Represents a functor for invoking a series of handlers. More...

#include <rwsf/handlers/MessageInfoHandlerChain.h>

Inheritance diagram for rwsf::MessageInfoHandlerChain:
rwsf::HandleBase

List of all members.

Public Member Functions

 MessageInfoHandlerChain ()
void init (const rwsf::Config &config)
void invoke (rwsf::MessageInfo &message)
void addHandlerChain (const rwsf::MessageInfoHandlerChain &chain, int typeFilter=-1)
std::string getName () const

Detailed Description

Class MessageInfoHandlerChain represents a functor for invoking a series of handlers.

Each handler is registered along with a type, indicating when the handler should be executed (on input, output, or fault). When the chain is executed, each input handler is invoked and each output or fault handler is placed on a stack to be executed. After all of the handlers have been processed, the stack is executed in reverse, invoking each out handler. If a fault is indicated (by invoke from one of the handlers returning false), the chain is interrupted, and each out and fault handler in the stack is executed.


Constructor & Destructor Documentation

rwsf::MessageInfoHandlerChain::MessageInfoHandlerChain (  ) 

Creates a new handler chain. This constructor provides the DefaultConstructible concept for templates that require this concept.


Member Function Documentation

void rwsf::MessageInfoHandlerChain::addHandlerChain ( const rwsf::MessageInfoHandlerChain chain,
int  typeFilter = -1 
)

Appends handlers from chain to this instance of rwsf::MessageInfoHandlerChain. By default, all handlers from chain are appended. The parameter typeFilter allows you to specify a subset of handlers to add. typeFilter is a bit-mask of any of the following values:

  • rwsf::MessageInfoHandler::HANDLER_REQUEST
  • rwsf::MessageInfoHandler::HANDLER_RESPONSE
std::string rwsf::MessageInfoHandlerChain::getName (  )  const

Returns the name associated with this handler chain.

void rwsf::MessageInfoHandlerChain::init ( const rwsf::Config config  ) 

Initializes the handler chain based on the configuration options in config. Please see the section on Agent connectors in the User's Guide for more information on how to configure handler chains.

void rwsf::MessageInfoHandlerChain::invoke ( rwsf::MessageInfo message  ) 

Invokes this handler chain on message. This executes all request handlers until false is returned from the individual handler, or an exception is thrown. In the former case, the response handlers are then run until false is returned from the individual handler, or an exception is thrown. If an exception is thrown from any handler, that exception is propagated out, thus terminating this invoke() function call with the thrown exception.


Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo are registered trademarks of Rogue Wave Software, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.