mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
synced 2025-11-02 03:37:51 +00:00
Signed-off-by: stephb9959 <stephane.bourque@gmail.com>
This commit is contained in:
@@ -9,8 +9,6 @@
|
|||||||
|
|
||||||
namespace OpenWifi {
|
namespace OpenWifi {
|
||||||
|
|
||||||
EventBusManager::EventBusManager(Poco::Logger &L) : Logger_(L) {}
|
|
||||||
|
|
||||||
void EventBusManager::run() {
|
void EventBusManager::run() {
|
||||||
Running_ = true;
|
Running_ = true;
|
||||||
Utils::SetThreadName("fmwk:EventMgr");
|
Utils::SetThreadName("fmwk:EventMgr");
|
||||||
|
|||||||
@@ -12,6 +12,16 @@ namespace OpenWifi {
|
|||||||
|
|
||||||
class EventBusManager : public Poco::Runnable {
|
class EventBusManager : public Poco::Runnable {
|
||||||
public:
|
public:
|
||||||
|
EventBusManager() :
|
||||||
|
Logger_(Poco::Logger::create(
|
||||||
|
"EventBusManager", Poco::Logger::root().getChannel(), Poco::Logger::root().getLevel())) {
|
||||||
|
}
|
||||||
|
|
||||||
|
static auto instance() {
|
||||||
|
static auto instance_ = new EventBusManager;
|
||||||
|
return instance_;
|
||||||
|
}
|
||||||
|
|
||||||
explicit EventBusManager(Poco::Logger &L);
|
explicit EventBusManager(Poco::Logger &L);
|
||||||
void run() final;
|
void run() final;
|
||||||
void Start();
|
void Start();
|
||||||
@@ -24,4 +34,6 @@ namespace OpenWifi {
|
|||||||
Poco::Logger &Logger_;
|
Poco::Logger &Logger_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inline auto EventBusManager() { return EventBusManager::instance(); }
|
||||||
|
|
||||||
} // namespace OpenWifi
|
} // namespace OpenWifi
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ namespace OpenWifi {
|
|||||||
const std::string &Payload) {
|
const std::string &Payload) {
|
||||||
std::lock_guard G(InfraMutex_);
|
std::lock_guard G(InfraMutex_);
|
||||||
|
|
||||||
Poco::Logger &BusLogger = Poco::Logger::create(
|
Poco::Logger &BusLogger = EventBusManager()->Logger();
|
||||||
"BusMessageReceived", Poco::Logger::root().getChannel(), Poco::Logger::root().getLevel());
|
|
||||||
try {
|
try {
|
||||||
Poco::JSON::Parser P;
|
Poco::JSON::Parser P;
|
||||||
auto Object = P.parse(Payload).extract<Poco::JSON::Object::Ptr>();
|
auto Object = P.parse(Payload).extract<Poco::JSON::Object::Ptr>();
|
||||||
@@ -552,14 +552,12 @@ namespace OpenWifi {
|
|||||||
for (auto i : SubSystems_) {
|
for (auto i : SubSystems_) {
|
||||||
i->Start();
|
i->Start();
|
||||||
}
|
}
|
||||||
EventBusManager_ = std::make_unique<EventBusManager>(Poco::Logger::create(
|
EventBusManager()->Start();
|
||||||
"EventBusManager", Poco::Logger::root().getChannel(), Poco::Logger::root().getLevel()));
|
|
||||||
EventBusManager_->Start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MicroService::StopSubSystemServers() {
|
void MicroService::StopSubSystemServers() {
|
||||||
AddActivity("Stopping");
|
AddActivity("Stopping");
|
||||||
EventBusManager_->Stop();
|
EventBusManager()->Stop();
|
||||||
for (auto i = SubSystems_.rbegin(); i != SubSystems_.rend(); ++i) {
|
for (auto i = SubSystems_.rbegin(); i != SubSystems_.rend(); ++i) {
|
||||||
(*i)->Stop();
|
(*i)->Stop();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -201,7 +201,6 @@ namespace OpenWifi {
|
|||||||
Poco::JWT::Signer Signer_;
|
Poco::JWT::Signer Signer_;
|
||||||
Poco::Logger &Logger_;
|
Poco::Logger &Logger_;
|
||||||
Poco::ThreadPool TimerPool_{"timer:pool", 2, 32};
|
Poco::ThreadPool TimerPool_{"timer:pool", 2, 32};
|
||||||
std::unique_ptr<EventBusManager> EventBusManager_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inline MicroService *MicroService::instance_ = nullptr;
|
inline MicroService *MicroService::instance_ = nullptr;
|
||||||
|
|||||||
Reference in New Issue
Block a user