OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
GatewayModule.cc
Go to the documentation of this file.
1 // GatewayModule.cc
2 
3 #include <iostream>
4 #include <vector>
5 #include <string>
6 
7 using std::endl;
8 using std::vector;
9 using std::string;
10 
11 #include "GatewayModule.h"
12 
13 #include <BESRequestHandlerList.h>
14 #include <BESDebug.h>
15 #include <BESResponseHandlerList.h>
16 #include <BESResponseNames.h>
18 #include <TheBESKeys.h>
19 #include <BESSyntaxUserError.h>
20 
21 #include "GatewayRequestHandler.h"
22 #include "GatewayResponseNames.h"
24 #include "GatewayUtils.h"
25 
26 void GatewayModule::initialize(const string &modname)
27 {
28  BESDEBUG(modname, "Initializing Gateway Module " << modname << endl);
29 
30  BESDEBUG(modname, " adding " << modname << " request handler" << endl);
32 
33  BESDEBUG(modname, " adding " << modname << " container storage" << endl);
35 
36  BESDEBUG(modname, " initialize the gateway utilities and params" << endl);
38 
39  BESDEBUG(modname, " adding Gateway debug context" << endl);
40  BESDebug::Register(modname);
41 
42  BESDEBUG(modname, "Done Initializing Gateway Module " << modname << endl);
43 }
44 
45 void GatewayModule::terminate(const string &modname)
46 {
47  BESDEBUG(modname, "Cleaning Gateway module " << modname << endl);
48 
49  BESDEBUG(modname, " removing " << modname << " request handler" << endl);
51  if (rh)
52  delete rh;
53 
55 
56  // TERM_END
57  BESDEBUG(modname, "Done Cleaning Gateway module " << modname << endl);
58 }
59 
60 extern "C" {
62 {
63  return new GatewayModule;
64 }
65 }
66 
67 void GatewayModule::dump(ostream &strm) const
68 {
69  strm << BESIndent::LMarg << "GatewayModule::dump - (" << (void *) this << ")" << endl;
70 }
71 
virtual bool add_handler(const string &handler_name, BESRequestHandler *handler)
add a request handler to the list of registered handlers for this server
virtual void initialize(const string &modname)
virtual bool add_persistence(BESContainerStorage *p)
Add a persistent store to the list.
virtual void dump(ostream &strm) const
dump the contents of this object to the specified ostream
BESAbstractModule * maker()
static ostream & LMarg(ostream &strm)
Definition: BESIndent.cc:73
virtual bool deref_persistence(const string &persist_name)
dereference a persistent store in the list.
virtual void terminate(const string &modname)
Represents a specific data type request handler.
static BESRequestHandlerList * TheList()
static BESContainerStorageList * TheList()
static void Initialize()
Definition: GatewayUtils.cc:74
implementation of BESContainerStorageVolatile that represents a list of remote requests ...
#define BESDEBUG(x, y)
macro used to send debug information to the debug stream
Definition: BESDebug.h:64
static void Register(const string &flagName)
register the specified debug flag
Definition: BESDebug.h:138
virtual BESRequestHandler * remove_handler(const string &handler_name)
remove and return the specified request handler