addHandler() clearHandlers() |
containsHandler() findHandler() |
getHandlerNames() invokeLogger() |
loadConfiguration() setLogger() |
#include <rw/rwsf/soapworx/HandlerManager.h>
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 Chapter 15, "SOAP Message Handler SDK," in the HydraExpress 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 that file name instead of "client-handlers.xml".
static void addHandler(const std::string& name, const rwsf::MessageHandler& handler);
Adds a handler to a service. Although this function may be used directly, it is more typically called by loadConfiguration().
static void clearHandlers();
Removes all handlers added directly with addHandler() or indirectly with loadConfiguration().
static bool containsHandler(const std::string& name);
Returns true if a handler with the given name is found.
static rwsf::MessageHandler findHandler(const std::string& name);
Returns the handler identified by name. Throws a rwsf::Exception if the handler cannot be found.
static rwsf::Enumeration<std::string> getHandlerNames();
Returns an enumeration of all handlers in this service.
static void loadConfiguration(const std::string& fileName);
Reads and parses an xml configuration file fileName. Used to load handlers specified in a configuration file indicated by filename.
static void setLogger(const rwsf::MessageHandler& handler);
Adds a logger handler.
static void invokeLogger(rwsf::CallInfo& callInfo);
Initializes the logger. Throws an exception of type rwsf::ExternalException if the logger cannot be found.
static void invokeLogger(const std::string& message, rwsf::CallInfo::LogLevel logLevel =
rwsf::CallInfo::Info);
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);
See also rwsf::MessageHandler.
©2004-2007 Copyright Quovadx, Inc. All Rights Reserved.
Quovadx and Rogue Wave are registered trademarks of Quovadx, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.