37 #include "SampleModule.h" 38 #include "BESRequestHandlerList.h" 39 #include "SampleRequestHandler.h" 41 #include "BESResponseHandlerList.h" 42 #include "BESResponseNames.h" 43 #include "BESXMLCommand.h" 44 #include "SampleResponseNames.h" 45 #include "SampleSayResponseHandler.h" 46 #include "SampleSayXMLCommand.h" 47 #include "BESReporterList.h" 48 #include "SayReporter.h" 51 SampleModule::initialize(
const string &modname )
53 BESDEBUG( modname,
"Initializing Sample Module " << modname << endl ) ;
55 BESDEBUG( modname,
" adding " << modname <<
" request handler" << endl );
62 BESDEBUG( modname,
" adding " << SAY_RESPONSE
63 <<
" response handler" << endl ) ;
64 BESResponseHandlerList::TheList()->
add_handler( SAY_RESPONSE, SampleSayResponseHandler::SampleSayResponseBuilder ) ;
66 cmd_name = SAY_RESPONSE ;
67 BESDEBUG( modname,
" adding " << cmd_name <<
" command" << endl ) ;
70 BESDEBUG(
"say",
" adding Say reporter" << endl ) ;
71 BESReporterList::TheList()->add_reporter( modname,
new SayReporter ) ;
75 BESDEBUG( modname,
" adding Sample debug context" << endl ) ;
78 BESDEBUG( modname,
"Done Initializing Sample Module " << modname << endl ) ;
82 SampleModule::terminate(
const string &modname )
84 BESDEBUG( modname,
"Cleaning Sample module " << modname << endl ) ;
86 BESDEBUG( modname,
" removing " << modname
87 <<
" request handler" << endl ) ;
95 BESDEBUG( modname,
" removing " << SAY_RESPONSE
96 <<
" response handler" << endl ) ;
97 BESResponseHandlerList::TheList()->
remove_handler( SAY_RESPONSE ) ;
99 cmd_name = SAY_RESPONSE ;
100 BESDEBUG( modname,
" removing " << cmd_name <<
" command" << endl ) ;
104 BESDEBUG( modname,
"Done Cleaning Sample module " << modname << endl ) ;
118 strm << BESIndent::LMarg <<
"SampleModule::dump - (" 119 << (
void *)
this <<
")" << endl ;
static bool del_command(const string &cmd_str)
Deletes the command called cmd_str from the list of possible commands.
static void add_command(const string &cmd_str, p_xmlcmd_builder cmd)
Add a command to the possible commands allowed by this BES.
virtual bool add_handler(const string &handler_name, BESRequestHandler *handler)
add a request handler to the list of registered handlers for this server
virtual bool add_handler(const string &handler, p_response_handler handler_method)
add a response handler to the list
Represents a specific data type request handler.
virtual bool remove_handler(const string &handler)
removes a response handler from the list
static void Register(const string &flagName)
register the specified debug flag
virtual BESRequestHandler * remove_handler(const string &handler_name)
remove and return the specified request handler
virtual void dump(ostream &strm) const
dump the contents of this object to the specified ostream