HydraExpress 4.6 |
HydraExpress C++ API Reference Guide |
|
Manages handlers for a service, and is used to set a logger in generated clients. More...
#include <rwsf/webservice/HandlerManager.h>
Static Public Member Functions | |
static void | loadConfiguration (const std::string &fileName) |
static rwsf::MessageHandler | findHandler (const std::string &name) |
static bool | containsHandler (const std::string &name) |
static void | addHandler (const std::string &name, const rwsf::MessageHandler &handler) |
static void | setLogger (const rwsf::MessageHandler &handler) |
static void | invokeLogger (rwsf::CallInfo &callInfo) |
static void | invokeLogger (const std::string &message, rwsf::CallInfo::LogLevel logLevel=rwsf::CallInfo::Info) |
static void | clearHandlers () |
static rwsf::Enumeration < std::string > | getHandlerNames () |
rwsf::HandlerManager loads, stores, and locates handlers for a service. In generated clients, it is used to set a logger. In addition, clients accessing a service through a notification-type method -- which requires setting up a listener on the client -- also use this class to initialize the client-handlers.xml
configuration file.
For a discussion on handlers and how to use or create them, see the Web Service Development Guide.
When deploying services, the static method loadConfiguration() is called automatically.
To initialize handlers in a client executable, however, you must call loadConfiguration("client-handlers.xml") directly. To use a custom handler configuration file, specify the custom file name instead of "client-handlers.xml"
.
static void rwsf::HandlerManager::addHandler | ( | const std::string & | name, | |
const rwsf::MessageHandler & | handler | |||
) | [static] |
Adds a handler to a service. Although you may use this function directly, it is more typically called by loadConfiguration().
static void rwsf::HandlerManager::clearHandlers | ( | ) | [static] |
Removes all handlers added directly with addHandler() or indirectly with loadConfiguration().
static bool rwsf::HandlerManager::containsHandler | ( | const std::string & | name | ) | [static] |
Returns true
if a handler with the given name is found, otherwise false
.
static rwsf::MessageHandler rwsf::HandlerManager::findHandler | ( | const std::string & | name | ) | [static] |
Returns the handler identified by name. Throws an rwsf::Exception if the handler cannot be found.
static rwsf::Enumeration<std::string> rwsf::HandlerManager::getHandlerNames | ( | ) | [static] |
Returns an enumeration of all registered handlers.
static void rwsf::HandlerManager::invokeLogger | ( | const std::string & | message, | |
rwsf::CallInfo::LogLevel | logLevel = rwsf::CallInfo::Info | |||
) | [static] |
Logs the given message to the default logger. By default, the message will have a log level of "Info"
. Use the optional second parameter to change the log level. Example:
HandlerManager::invokeLogger("My warning message", CallInfo::Warning);
For more information on logging, see the Logging chapter in the Web Services Development Guide.
static void rwsf::HandlerManager::invokeLogger | ( | rwsf::CallInfo & | callInfo | ) | [static] |
Initializes the logger. Throws an exception of type rwsf::ExternalException if the logger cannot be found. For more information on logging, see the Logging chapter in the Web Services Development Guide.
static void rwsf::HandlerManager::loadConfiguration | ( | const std::string & | fileName | ) | [static] |
Reads and parses an xml configuration file fileName. Used to load handlers specified in a configuration file indicated by filename.
static void rwsf::HandlerManager::setLogger | ( | const rwsf::MessageHandler & | handler | ) | [static] |
Adds a logger handler. For more information on logging, see the Logging chapter in the Web Services Development Guide.
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.