![]() |
Vault
4.1
|
VBentoMessageInputThread is a VMessageInputThread that can automatically handle no-such-handler or uncaught message dispatch exceptions, and in response send a Bento-based error reply back to the sender. More...
#include <vmessageinputthread.h>
Public Member Functions | |
VBentoMessageInputThread (const VString &threadBaseName, VSocket *socket, VListenerThread *ownerThread, VServer *server, const VMessageFactory *messageFactory) | |
Protected Member Functions | |
virtual void | _handleNoMessageHandler (VMessagePtr message) |
This method is called by _dispatchMessage if it cannot find the handler for the message being handled. | |
virtual void | _callProcessMessage (VMessageHandler *handler) |
This method is where we actually call the message handler to process the message it was constructed with. |
VBentoMessageInputThread is a VMessageInputThread that can automatically handle no-such-handler or uncaught message dispatch exceptions, and in response send a Bento-based error reply back to the sender.
Definition at line 134 of file vmessageinputthread.h.
void VBentoMessageInputThread::_handleNoMessageHandler | ( | VMessagePtr | ) | [protected, virtual] |
This method is called by _dispatchMessage if it cannot find the handler for the message being handled.
How to handle this is protocol-specific, but a subclass could send an error response back to the sender if the protocol allows that. The implementation must NOT release the message, and the message WILL be released by _dispatchMessage() upon return.
Reimplemented from VMessageInputThread.
Definition at line 176 of file vmessageinputthread.cpp.
References VBentoNode::addInt(), VBentoNode::addString(), VString::chars(), VMessageFactory::instantiateNewMessage(), VThread::mLoggerName, VMessageInputThread::mMessageFactory, VThread::mName, VMessageInputThread::mSocketStream, VBentoNode::writeToBentoTextString(), and VBentoNode::writeToStream().
void VBentoMessageInputThread::_callProcessMessage | ( | VMessageHandler * | handler | ) | [protected, virtual] |
This method is where we actually call the message handler to process the message it was constructed with.
A subclass might override this to wrap the call to super in a try/catch block if it wants to take action other than logging in response to an exception.
Reimplemented from VMessageInputThread.
Definition at line 191 of file vmessageinputthread.cpp.
References VBentoNode::addInt(), VBentoNode::addString(), VString::chars(), VMessageFactory::instantiateNewMessage(), VThread::mLoggerName, VMessageInputThread::mMessageFactory, VThread::mName, VMessageInputThread::mSocketStream, VBentoNode::writeToBentoTextString(), and VBentoNode::writeToStream().