rwsf::MessageInfoHandlerChainrwsf::HandleBase
#include rwsf/handlers/MessageInfoHandlerChain.h
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 will be interrupted, and each out and fault handler in the stack will be executed.
MessageInfoHandlerChain();
Creates a new handler chain. This constructor provides the DefaultConstructible concept for templates that require this concept.
void addHandler(const rwsf::MessageInfoHandler & handler);
Adds a handler to the chain.
void addHandlerChain(const rwsf::MessageInfoHandlerChain & chain, int typeFilter = -1);
Adds a handler chain to the chain. Appends all of the handlers specified in chain to the current chain. The typeFilter parameter is a bit-mask of types to allow. For example, if REQUEST is OR'd in, then only request handlers will be added from the given chain.
std::string getName() const;
Returns the name associated with this handler chain.
void init(const rwsf::Config & config);
Initializes the handler chain.
Parameter descriptions
config |
Configuration options for the Agent. |
bool invoke(rwsf::MessageInfo & message);
Invokes this handler chain on the message. This executes all request handlers until a false is returned or an exception is thrown. In the former case, the response handlers are run until a false is returned or an exception is thrown. If an exception is ever thrown from a handler, that exception is NOT caught by the chain, and will be propagated out, thus terminating the handler chain invoke in an abnormal way. The return from this invoke method is always true; if an failure condition is encountered in a handler, an exception is thrown.
const rwsf::MessageInfoHandlerChainImp & body() const;
Reimplements method in rwsf::HandleBase
Base class documentation:
Gets a reference for the body instance, if any; otherwise, throws an rwsf::Exception exception.
Implementation documentation:
Returns the underlying body implementation.
rwsf::MessageInfoHandlerChainImp & body();
Reimplements method in rwsf::HandleBase
Base class documentation:
Gets a reference for the body instance, if any; otherwise, throws an rwsf::Exception exception.
Implementation documentation:
Returns the underlying body implementation.
© Copyright Rogue Wave Software, Inc. All Rights Reserved. All Rights Reserved. Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. HydraExpress is a trademark of Rogue Wave Software, Inc. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.