rwlogo
HydraExpress 4.6

HydraExpress C++ API Reference Guide


   


Rogue Wave web site:  Home Page  |  Main Documentation Page

rwsf::MessageListenerImp Class Reference
[Transports]

Abstract base class for all listener implementations. More...

#include <rwsf/webservice/listener/MessageListenerImp.h>

Inheritance diagram for rwsf::MessageListenerImp:
rwsf::MessageHandlerImp rwsf::HttpMessageListener rwsf::HttpsMessageListener

List of all members.

Public Member Functions

 MessageListenerImp ()
virtual ~MessageListenerImp ()
virtual void invoke (rwsf::CallInfo &callInfo)
bool isStopped ()
virtual void setProperty (const std::string &key, const std::string &value)
virtual std::string getProperty (const std::string &key)
void log (const std::string &message, rwsf::CallInfo::LogLevel l=rwsf::CallInfo::Error)
void log (rwsf::CallInfo &callInfo, rwsf::CallInfo::LogLevel l=rwsf::CallInfo::Error)

Protected Member Functions

virtual void doInit (const rwsf::Config &initParams)=0
virtual void initServer ()=0
virtual void doStart ()=0
virtual void doStop ()=0
virtual void doReset ()=0

Detailed Description

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:

  1. Implement the member functions initServer(), doStart(), and doStop().
  2. Define the macro RWSF_DEFINE_MESSAGE_HANDLER(NAME).
  3. 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.


Constructor & Destructor Documentation

rwsf::MessageListenerImp::MessageListenerImp (  ) 

Default constructor.

virtual rwsf::MessageListenerImp::~MessageListenerImp (  )  [virtual]

Virtual destructor.


Member Function Documentation

virtual void rwsf::MessageListenerImp::doInit ( const rwsf::Config initParams  )  [protected, pure virtual]

Pure virtual function. In derived classes, init() calls this method to handle any initialization specific to the implementation.

virtual void rwsf::MessageListenerImp::doReset (  )  [protected, pure 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 (  )  [protected, pure 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 (  )  [protected, pure 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 (  )  [protected, pure 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.

void rwsf::MessageListenerImp::log ( rwsf::CallInfo callInfo,
rwsf::CallInfo::LogLevel  l = rwsf::CallInfo::Error 
)

Invokes the logger and forwards to the service implementation. Sets the log level to Error.

void rwsf::MessageListenerImp::log ( const std::string &  message,
rwsf::CallInfo::LogLevel  l = rwsf::CallInfo::Error 
)

Invokes the logger and adds a message to it, forwarding 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.