An abstract message handler class. More...
#include <MessageServer.h>
Inherited by ExitHandler, ExitHandler, and TimerUpdateHandler.
Public Member Functions | |
virtual ClientContextPtr | newClient (CommonClientContext &context) |
Called when a new client has connected to the MessageServer. | |
virtual void | clientDisconnected (MessageServer::CommonClientContext &context, MessageServer::ClientContextPtr &handlerSpecificContext) |
Called when a client has disconnected from the MessageServer. | |
virtual bool | processMessage (CommonClientContext &commonContext, ClientContextPtr &handlerSpecificContext, const vector< string > &args)=0 |
Called then a client has sent a request message. |
An abstract message handler class.
The methods defined in this class are allowed to throw arbitrary exceptions. Such exceptions are caught and logged, after which the connection to the client is closed.
virtual void Passenger::MessageServer::Handler::clientDisconnected | ( | MessageServer::CommonClientContext & | context, | |
MessageServer::ClientContextPtr & | handlerSpecificContext | |||
) | [inline, virtual] |
Called when a client has disconnected from the MessageServer.
The default implementation does nothing.
This method is called even if processMessage() throws an exception. It is however not called if newClient() throws an exception.
commonContext | Contains common client-specific information. | |
handlerSpecificContext | The client context object as was returned earlier by newClient(). |
virtual ClientContextPtr Passenger::MessageServer::Handler::newClient | ( | CommonClientContext & | context | ) | [inline, virtual] |
Called when a new client has connected to the MessageServer.
This method is called after the client has authenticated itself.
context | Contains common client-specific information. |
virtual bool Passenger::MessageServer::Handler::processMessage | ( | CommonClientContext & | commonContext, | |
ClientContextPtr & | handlerSpecificContext, | |||
const vector< string > & | args | |||
) | [pure virtual] |
Called then a client has sent a request message.
This method is called after newClient() is called.
commonContext | Contains common client-specific information. | |
handlerSpecificContext | The client context object as was returned earlier by newClient(). | |
args | The request message's contents. |