diff --git a/include/MarketPlaceManager.h b/include/MarketPlaceManager.h index 4d90c6aac7..f80682dfa7 100644 --- a/include/MarketPlaceManager.h +++ b/include/MarketPlaceManager.h @@ -30,27 +30,16 @@ class MarketPlaceManager : public MadManager, public ActionListener { public: - MarketPlaceManager( - time_t _timer_period, - time_t _monitor_period, - std::vector& _mads): - MadManager(_mads), - timer_period(_timer_period), - monitor_period(_monitor_period), - mppool(0), - apppool(0) - { - am.addListener(this); - }; + /** + * Inititalizes the Marketplace manager: + * @param t, timer_period to wake up the manger to perform actions + * @param m, monitor_period to monitor marketplaces + * @param mad, list of drivers for the manager + */ + MarketPlaceManager( time_t t, time_t m, std::vector& mad); ~MarketPlaceManager(){}; - /** - * Initializes internal pointers to other managers. Must be called when - * all the other managers exist in Nebula::instance - */ - void init_managers(); - /** * This functions starts the associated listener thread, and creates a * new thread for the MarketPlace Manager. This thread will wait in diff --git a/src/market/MarketPlaceManager.cc b/src/market/MarketPlaceManager.cc index e31ad9c855..55625be7a0 100644 --- a/src/market/MarketPlaceManager.cc +++ b/src/market/MarketPlaceManager.cc @@ -46,6 +46,24 @@ extern "C" void * marketplace_action_loop(void *arg) return 0; } +/* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ + +MarketPlaceManager::MarketPlaceManager( + time_t _timer_period, + time_t _monitor_period, + std::vector& _mads): + MadManager(_mads), + timer_period(_timer_period), + monitor_period(_monitor_period) +{ + Nebula& nd = Nebula::instance(); + + mppool = nd.get_marketpool(); + apppool = nd.get_apppool(); + + am.addListener(this); +}; /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ @@ -144,17 +162,6 @@ void MarketPlaceManager::do_action(const string &action, void * arg) /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ -void MarketPlaceManager::init_managers() -{ - Nebula& nd = Nebula::instance(); - - mppool = nd.get_marketpool(); - apppool = nd.get_apppool(); -} - -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ - string * MarketPlaceManager::format_message( const string& app_data, const string& market_data, diff --git a/src/nebula/Nebula.cc b/src/nebula/Nebula.cc index 9a81b82c1a..1a0fd1fdbd 100644 --- a/src/nebula/Nebula.cc +++ b/src/nebula/Nebula.cc @@ -936,8 +936,6 @@ void Nebula::start(bool bootstrap_only) lcm->init_managers(); - marketm->init_managers(); - // ---- Start the Request Manager ---- rc = rm->start();