rwsf::MessageInfoHandlerrwsf::HandleBase
#include rwsf/handlers/MessageInfoHandler.h
Class MessageInfoHandler provides an interface for invoking processing code on an MessageInfo instance. MessageInfoHandler is a handle to a MessageInfoHandlerImp, which serves as an abstract base class for implementing handlers.
HandlerType { HANDLER_UNKNOWN, HANDLER_REQUEST, HANDLER_RESPONSE }
Value descriptions
HANDLER_UNKNOWN |
Unknown type. |
HANDLER_REQUEST |
Request type. |
HANDLER_RESPONSE |
Response type. |
Enumeration for specifying the handler type.
MessageInfoHandler();
Default constructor.
MessageInfoHandler(MessageInfoHandlerImp * imp);
Creates an instance from the given MessageInfoHandlerImp. This handle will form a handle-body relationship with the specified imp.
const rwsf::MessageInfoHandlerImp & 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::MessageInfoHandlerImp & 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.
std::string getName() const;
Returns the name of the handler, if one was provided. The name can be set only on initialization.
int getType() const;
Returns the type (in, out, fault) of this handler if one was provided; 0 otherwise. The type can only be set on initialization.
void init(const rwsf::Config & config, const rwsf::AgentContext & manager);
Initializes the handler with the specified configuration options. This method must be called from within the subclass's init() methods, or the handler will not function properly.
bool invoke(rwsf::MessageInfo & message);
Invokes this handler on the specified message. Returns true if the handler is successful; otherwise, false.
bool isHandlerInitialized() const;
Returns true if the base class init() method was called. It's important that the subclass calls the superclass's init() method, so this function allows us to check that the init method was indeed called.
© 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.