Abstract base class for all listener implementations.
More...
#include <rwsf/webservice/listener/MessageListenerImp.h>
rwsf::MessageListenerImp is the abstract base class from which all listener body classes derive. Since listeners are handlers in RWSF, rwsf::MessageListenerImp derives from rwsf::MessageHandlerImp.
rwsf::MessageListenerImp implements the handle/body pattern in which rwsf::MessageListener is the handle, and rwsf::MessageListenerImp is the body.
For properties that can be set on a listener, and other details, see the handle class rwsf::MessageListener.
To create a new listener:
- Implement the member functions
initServer()
, doStart()
, and doStop()
.
- Define the macro
RWSF_DEFINE_MESSAGE_HANDLER(NAME)
.
- Configure the listener in the configuration file
client-transports.xml
, or use this class to set properties.
For more information on creating and using listeners, see the Web Service Development Guide.
rwsf::MessageListenerImp::MessageListenerImp |
( |
| ) |
|
virtual rwsf::MessageListenerImp::~MessageListenerImp |
( |
| ) |
|
|
virtual |
virtual void rwsf::MessageListenerImp::doInit |
( |
const rwsf::Config & |
initParams | ) |
|
|
protectedpure virtual |
Pure virtual function. In derived classes, init()
calls this method to handle any initialization specific to the implementation.
virtual void rwsf::MessageListenerImp::doReset |
( |
| ) |
|
|
protectedpure virtual |
Pure virtual function. In the derived classes, this method is called by reset()
to handle resetting the listener.
- Note
- This method does not restart the listener.
virtual void rwsf::MessageListenerImp::doStart |
( |
| ) |
|
|
protectedpure virtual |
Pure virtual function. In derived classes, this method is the entry point for the listening thread, which is spawned in start()
after calling initServer()
.
virtual void rwsf::MessageListenerImp::doStop |
( |
| ) |
|
|
protectedpure virtual |
Pure virtual function. In the derived classes, this method is called by stop()
to handle any listener thread shutdown specific to the implementation.
virtual std::string rwsf::MessageListenerImp::getProperty |
( |
const std::string & |
key | ) |
|
|
virtual |
Given a property key, returns its value.
virtual void rwsf::MessageListenerImp::initServer |
( |
| ) |
|
|
protectedpure virtual |
Pure virtual function. In derived classes, start()
calls this method, which is expected to handle any setup needed by the listening thread specific to the implementation.
virtual void rwsf::MessageListenerImp::invoke |
( |
rwsf::CallInfo & |
callInfo | ) |
|
|
virtual |
Handles an incoming message, forwarding it to the service implementation. The callInfo object holds metadata extracted from the message header.
Reimplemented from rwsf::MessageHandlerImp.
bool rwsf::MessageListenerImp::isStopped |
( |
| ) |
|
Returns true
if this listener is stopped, else false
.
Invokes the logger and adds a message to it, forwarding to the service implementation. Sets the log level to Error
.
Invokes the logger and forwards to the service implementation. Sets the log level to Error
.
virtual void rwsf::MessageListenerImp::setProperty |
( |
const std::string & |
key, |
|
|
const std::string & |
value |
|
) |
| |
|
virtual |
Sets a key/value property on the listener.
Copyright © Rogue Wave Software, Inc. All Rights Reserved.
The Rogue Wave name and logo are registered trademarks of Rogue Wave Software, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.