34#include <BESRequestHandlerList.h>
35#include <BESDapService.h>
36#include <BESContainerStorageList.h>
37#include <BESFileContainerStorage.h>
38#include <BESCatalogDirectory.h>
39#include <BESCatalogList.h>
43#include "NCRequestHandler.h"
49#define NC_CATALOG "catalog"
51void NCModule::initialize(
const string & modname)
53 BESDEBUG(
"nc",
"Initializing NC module " << modname << endl);
55 BESRequestHandler *handler =
new NCRequestHandler(modname);
56 BESRequestHandlerList::TheList()->add_handler(modname, handler);
60 if (!BESCatalogList::TheCatalogList()->ref_catalog( NC_CATALOG)) {
61 BESCatalogList::TheCatalogList()->add_catalog(
new BESCatalogDirectory( NC_CATALOG));
64 BESDEBUG(
"nc",
" catalog already exists, skipping" << endl);
67 if (!BESContainerStorageList::TheList()->ref_persistence( NC_CATALOG)) {
68 BESContainerStorageList::TheList()->add_persistence(
new BESFileContainerStorage( NC_CATALOG));
71 BESDEBUG(
"nc",
" storage already exists, skipping" << endl);
76 BESDEBUG(
"nc",
"Done Initializing NC module " << modname << endl);
79void NCModule::terminate(
const string & modname)
81 BESDEBUG(
"nc",
"Cleaning NC module " << modname << endl);
83 BESRequestHandler *rh = BESRequestHandlerList::TheList()->remove_handler(modname);
86 BESContainerStorageList::TheList()->deref_persistence( NC_CATALOG);
88 BESCatalogList::TheCatalogList()->deref_catalog( NC_CATALOG);
90 BESDEBUG(
"nc",
"Done Cleaning NC module " << modname << endl);
101 strm << BESIndent::LMarg <<
"NCModule::dump - (" << (
void *)
this <<
")" << endl;
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
dumps information about this object