void LifecycleService::fireLifecycleEvent(const LifecycleEvent &lifecycleEvent) { util::LockGuard lg(listenerLock); util::ILogger &logger = util::ILogger::getLogger(); switch (lifecycleEvent.getState()) { case LifecycleEvent::STARTING : logger.info("LifecycleService::LifecycleEvent STARTING"); break; case LifecycleEvent::STARTED : logger.info("LifecycleService::LifecycleEvent STARTED"); break; case LifecycleEvent::SHUTTING_DOWN : logger.info("LifecycleService::LifecycleEvent SHUTTING_DOWN"); break; case LifecycleEvent::SHUTDOWN : logger.info("LifecycleService::LifecycleEvent SHUTDOWN"); break; case LifecycleEvent::CLIENT_CONNECTED : logger.info("LifecycleService::LifecycleEvent CLIENT_CONNECTED"); break; case LifecycleEvent::CLIENT_DISCONNECTED : logger.info("LifecycleService::LifecycleEvent CLIENT_DISCONNECTED"); break; } for (std::set<LifecycleListener *>::iterator it = listeners.begin(); it != listeners.end(); ++it) { (*it)->stateChanged(lifecycleEvent); } }
void stateChanged(const LifecycleEvent &event) { if (event.getState() == LifecycleEvent::CLIENT_CONNECTED) { latch.countDown(); } }