HydraExpress™ C++ API Reference Guide

 
Loading...
Searching...
No Matches
rwsf::MessageInfoHandlerChain Class Reference

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

#include <rwsf/handlers/MessageInfoHandlerChain.h>

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

Public Member Functions

 MessageInfoHandlerChain ()
void addHandlerChain (const rwsf::MessageInfoHandlerChain &chain, int typeFilter=-1)
std::string getName () const
void init (const rwsf::Config &config)
void invoke (rwsf::MessageInfo &message)
Public Member Functions inherited from rwsf::HandleBase
bool isValid (void) const
bool operator!= (const HandleBase &second) const
bool operator== (const HandleBase &second) const

Additional Inherited Members

Protected Member Functions inherited from rwsf::HandleBase
 HandleBase (BodyBase *body)
 HandleBase (const HandleBase &second)
 HandleBase (StaticCtor)
 HandleBase (void)
virtual ~HandleBase (void)
BodyBase & body (void) const
HandleBaseoperator= (const HandleBase &second)

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

◆ MessageInfoHandlerChain()

rwsf::MessageInfoHandlerChain::MessageInfoHandlerChain ( )

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

Member Function Documentation

◆ addHandlerChain()

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

◆ getName()

std::string rwsf::MessageInfoHandlerChain::getName ( ) const

Returns the name associated with this handler chain.

◆ init()

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.

◆ invoke()

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 © 2026 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.