HydraExpress™ C++ API Reference Guide

Product Documentation:
   HydraExpress C++
Documentation Home
List of all members | Public Member Functions | Protected Attributes | Related Functions
rwsf::TransportImp Class Referenceabstract

Abstract base class from which all RWSF transports derive. More...

#include <rwsf/webservice/transport/TransportImp.h>

Inheritance diagram for rwsf::TransportImp:
rwsf::MessageHandlerImp rwsf::HttpTransport rwsf::HttpsTransport

Public Member Functions

 TransportImp ()
 
virtual ~TransportImp ()
 
virtual TransportImpclone () const =0
 
virtual void doConnect ()=0
 
virtual void doDisconnect ()=0
 
virtual void doInit (const rwsf::Config &initParams)
 
virtual void doInvoke (rwsf::CallInfo &callInfo)=0
 
virtual void doSetProperty (const std::string &key, const std::string &value)
 
void invoke (rwsf::CallInfo &callInfo)
 
virtual bool isConnected () const =0
 
void log (const std::string &message, rwsf::CallInfo::LogLevel l=rwsf::CallInfo::Info)
 
void log (rwsf::CallInfo &callInfo, rwsf::CallInfo::LogLevel loglevel=rwsf::CallInfo::Info)
 
- Public Member Functions inherited from rwsf::MessageHandlerImp
 MessageHandlerImp ()
 
virtual ~MessageHandlerImp ()
 
virtual void destroy ()
 
virtual void init (const rwsf::Config &initParams)
 

Protected Attributes

rwsf::Config initParams_
 

Related Functions

(Note that these are not member functions.)

#define RWSF_DEFINE_RWSF_TRANSPORT(NAME)
 

Detailed Description

rwsf::TransportImp is an abstract base class and is the body implementation for the handle represented by rwsf::Transport. All RWSF transports derive from this class, and you can also create your own customized transport by deriving from this class.

For an example on creating a custom transport, see the Transports chapter in the Web Service Development Guide.

Multithread Safety

To support multithread safety, rwsf::TransportImp provides the invoke implementation for all transports. The method invoke() creates a multithread guard and then calls doInvoke(), which is implemented in the derived classes. This design provides thread safety for all derived classes during asynchronous processing, and allows your application to share transports safely.

If you are not using asynchronous processing and want to avoid using the mutex guard, you may want to reimplement invoke() in your derived classes.

Constructor & Destructor Documentation

rwsf::TransportImp::TransportImp ( )

Default constructor. Constructs an empty transport.

virtual rwsf::TransportImp::~TransportImp ( )
virtual

Destructor.

Member Function Documentation

virtual TransportImp* rwsf::TransportImp::clone ( ) const
pure virtual

Derived classes should return a new instance of self. (for example, new rwsf::HttpTransport(*this);).

Implemented in rwsf::HttpsTransport, and rwsf::HttpTransport.

virtual void rwsf::TransportImp::doConnect ( )
pure virtual

Derived classes must implement this method to verify that there is a connection. If there is no connection, this method creates one.

Implemented in rwsf::HttpTransport, and rwsf::HttpsTransport.

virtual void rwsf::TransportImp::doDisconnect ( )
pure virtual

Derived classes must implement this method to disconnect a server connection.

Implemented in rwsf::HttpTransport.

virtual void rwsf::TransportImp::doInit ( const rwsf::Config initParams)
virtual

Derived classes can implement this method to be notified when the initialization parameters, initParams, are set for this TransportImp.

Note
If the transport cannot be initialized, an rwsf::Exception should be thrown. On the client side, exceptions are propagated out to your application code; on the server side, they are logged.

Reimplemented in rwsf::HttpTransport.

virtual void rwsf::TransportImp::doInvoke ( rwsf::CallInfo callInfo)
pure virtual

Derived classes must implement this method to define the transport handler's behavior.

Implemented in rwsf::HttpTransport.

virtual void rwsf::TransportImp::doSetProperty ( const std::string &  key,
const std::string &  value 
)
virtual

Derived classes can implement this method to be notified when properties are set on this TransportImp object. The key and value are the most recent property values set.

Reimplemented in rwsf::HttpTransport.

void rwsf::TransportImp::invoke ( rwsf::CallInfo callInfo)
virtual

This method implements the main functionality of a service and is called by any service or client invoking the service.

Reimplemented from rwsf::MessageHandlerImp.

virtual bool rwsf::TransportImp::isConnected ( ) const
pure virtual

Derived classes must implement this method to indicate whether the transport is connected or not. Returns true if connected, false otherwise.

Implemented in rwsf::HttpsTransport, and rwsf::HttpTransport.

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

Invokes the logger with the error message in message and log level in l. See rwsf::Logger for a description of log levels.

void rwsf::TransportImp::log ( rwsf::CallInfo callInfo,
rwsf::CallInfo::LogLevel  loglevel = rwsf::CallInfo::Info 
)

Invokes the logger with the error message in callInfo and log level in loglevel. See rwsf::Logger for a description of log levels.

Friends And Related Function Documentation

#define RWSF_DEFINE_RWSF_TRANSPORT (   NAME)
related

Member Data Documentation

rwsf::Config rwsf::TransportImp::initParams_
protected

Holds the initialization properties.

Copyright © 2019 Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is registered trademark of Rogue Wave Software, Inc. in the United States and other countries, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.