32#include <BESRequestHandlerList.h>
34#include <BESResponseHandlerList.h>
35#include <BESContainerStorageList.h>
37#include "GatewayModule.h"
38#include "GatewayRequestHandler.h"
39#include "GatewayContainerStorage.h"
40#include "GatewayPathInfoResponseHandler.h"
41#include "GatewayPathInfoCommand.h"
44using namespace gateway;
46void GatewayModule::initialize(
const string &modname)
48 BESDEBUG(modname,
"Initializing Gateway Module " << modname << endl);
50 BESDEBUG(modname,
" adding " << modname <<
" request handler" << endl);
51 BESRequestHandlerList::TheList()->add_handler(modname,
new GatewayRequestHandler(modname));
53 BESDEBUG(modname,
" adding " << modname <<
" container storage" << endl);
54 BESContainerStorageList::TheList()->add_persistence(
new GatewayContainerStorage(modname));
60 BESDEBUG(modname,
" adding Gateway debug context" << endl);
63 BESDEBUG( modname,
" adding " << SHOW_GATEWAY_PATH_INFO_RESPONSE_STR <<
" command" << endl ) ;
66 BESDEBUG(modname,
" adding " << SHOW_GATEWAY_PATH_INFO_RESPONSE <<
" response handler" << endl ) ;
67 BESResponseHandlerList::TheList()->add_handler( SHOW_GATEWAY_PATH_INFO_RESPONSE, GatewayPathInfoResponseHandler::GatewayPathInfoResponseBuilder ) ;
69 BESDEBUG(modname,
"Done Initializing Gateway Module " << modname << endl);
72void GatewayModule::terminate(
const string &modname)
74 BESDEBUG(modname,
"Cleaning Gateway module " << modname << endl);
76 BESResponseHandlerList::TheList()->remove_handler( SHOW_GATEWAY_PATH_INFO_RESPONSE) ;
80 BESDEBUG(modname,
" removing " << modname <<
" request handler" << endl);
81 BESRequestHandler *rh = BESRequestHandlerList::TheList()->remove_handler(modname);
85 BESContainerStorageList::TheList()->deref_persistence(modname);
88 BESDEBUG(modname,
"Done Cleaning Gateway module " << modname << endl);
93 strm << BESIndent::LMarg <<
"GatewayModule::dump - (" << (
void *)
this <<
")" << endl;
static void Register(const std::string &flagName)
register the specified debug flag
static void del_command(const std::string &cmd_str)
Deletes the command called cmd_str from the list of possible commands.
static void add_command(const std::string &cmd_str, p_xmlcmd_builder cmd)
Add a command to the possible commands allowed by this BES.
virtual void dump(std::ostream &strm) const
dump the contents of this object to the specified ostream