HydraExpress™ C++ 2019 |
HydraExpress™ C++ API Reference Guide |
Product Documentation: HydraExpress C++ Documentation Home |
Manages transports and listeners for a message. More...
#include <rwsf/webservice/transport/TransportManager.h>
Static Public Member Functions | |
static void | clearListeners () |
static void | clearTransports () |
static rwsf::MessageListener | findListener (const std::string &id) |
static rwsf::MessageListener | findListenerByUrl (const std::string &url) |
static rwsf::Transport | findTransport (const std::string &id) |
static rwsf::Transport | findTransportByUrl (const std::string &url) |
static rwsf::Enumeration< std::string > | getListenerNames () |
static rwsf::Enumeration< std::string > | getTransportNames () |
static void | initialize (const std::string &transportXmlFile, const std::string &libSuffix=std::string()) |
The class rwsf::TransportManager manages the use of transports and listeners for a message. It is used by generated client proxies to initialize the appropriate transport or listener for that proxy.
If you customize or write your own client proxy, always use this class to locate and instantiate a transport or listener. For example, in the following code, the proxy make()
function gets an HTTP transport through the Transport Manager.
If you are specifying the type of transport directly instead of relying on the scheme indicated by a location
url, use the method findTransport().
transports.xml
for a service and client-transports.xml
for a client, although you may create your own or modify the name. For more information, see the transports chapter in the Web Service Development Guide.
|
static |
Removes all listeners.
|
static |
Removes all transports.
|
static |
Returns a new listener instance of the same type as the listener identified by the parameter id. If a matching listener is not found, then an empty, un-initialized rwsf::MessageListener handle is returned.
|
static |
Returns a new listener
instance based on the scheme
field of the parameter url. Uses the scheme
and default
attributes in the transports configuration file or client transports configuration file to locate the appropriate listener.
For example, consider the listener definition below from the default transports configuration file, transports.xml:
Given the above listener configuration, this method will return a MyListener
instance by default for all urls with an "http" scheme
, i.e. http://somehost:someport/somepath
. If the attribute default
is set to false
instead of true
, then this listener will never be returned by this method. If more than one listener with the same scheme and default set to true
exists, then the method will use the one that occurs first in the file.
|
static |
Used by the client proxy to locate a transport. Returns a new transport instance of the same type as the transport identified by the parameter id. If a matching transport is not found, then an empty un-initialized rwsf::Transport handle is returned.
location
url.
|
static |
Returns a new transport
instance based on the scheme
field of the parameter url. Uses the scheme
and default
attributes in the transports configuration file or client transports configuration file to locate the appropriate transport.
For example, consider the the transport definition below from the default configuration file, transports.xml:
For the configuration above, this method returns a MyTransport
instance by default for all urls with an "http" scheme
, i.e. http://somehost:someport/somepath
. If the attribute default
is set to false
instead of true
, then this transport will never be returned by this method. If more than one transport with the same scheme and default set to true
exists, then the method will use the one that occurs first in the file.
|
static |
Returns an enumeration of all available listeners. The enumeration will contain all listeners specified in the transports configuration file.
|
static |
Returns an enumeration of all available transports. The enumeration will contain all transports specified in the transports configuration file.
|
static |
Parses the transports configuration file defined by transportXmlFile, and initializes the transport from its contents. The libSuffix is a string used to add a suffix to the library names specified in the config file. For example libSuffix could be set to version 190
, causing the library rwsf_webservice to be loaded as rwsf_webservice190
.
Copyright © 2019 Rogue Wave Software, Inc. All Rights Reserved. |