30#include "DapRequestHandler.h"
32#include <BESRequestHandlerList.h>
35#include <BESDapService.h>
36#include <BESResponseNames.h>
37#include <BESContainerStorageList.h>
38#include <BESFileContainerStorage.h>
39#include <BESCatalogDirectory.h>
40#include <BESCatalogList.h>
42#include "BESInternalError.h"
44void DapModule::initialize(
const string &modname)
46 BESDEBUG(modname,
"Initializing Dap Reader Module " << modname << endl);
48 BESRequestHandlerList::TheList()->add_handler(modname,
new DapRequestHandler(modname));
53 if (!BESCatalogList::TheCatalogList()->ref_catalog(default_catalog_name)) {
54 throw BESInternalError(
"Should never have to add the default catalog.", __FILE__, __LINE__);
58 if (!BESContainerStorageList::TheList()->ref_persistence(default_catalog_name)) {
59 BESFileContainerStorage *csc =
new BESFileContainerStorage(default_catalog_name);
60 BESContainerStorageList::TheList()->add_persistence(csc);
65 BESDEBUG(modname,
"Done Initializing Dap Reader Module " << modname << endl);
68void DapModule::terminate(
const string &modname)
70 BESDEBUG(modname,
"Cleaning Dap Reader Module " << modname << endl);
72 delete BESRequestHandlerList::TheList()->remove_handler(modname);
75 BESContainerStorageList::TheList()->deref_persistence(default_catalog_name);
77 BESCatalogList::TheCatalogList()->deref_catalog(default_catalog_name);
79 BESDEBUG(modname,
"Done Cleaning Dap Reader Module " << modname << endl);
91 strm << BESIndent::LMarg <<
"DapModule::dump - (" << (
void *)
this <<
")" << endl;
virtual std::string default_catalog_name() const
The name of the default catalog.
static void handle_dap_service(const std::string &handler)
static function to register a handler to handle the dap services
static void Register(const std::string &flagName)
register the specified debug flag
virtual void dump(std::ostream &strm) const
dump the contents of this object to the specified ostream