mirror of https://github.com/Icinga/icinga2.git
ido: Clean up obsolete handlers.
This commit is contained in:
parent
cf3298f130
commit
a8972e78f8
|
@ -37,8 +37,6 @@ void DbConnection::Start(void)
|
|||
{
|
||||
DynamicObject::Start();
|
||||
|
||||
DbObject::OnRegistered.connect(boost::bind(&DbConnection::ActivateObject, this, _1));
|
||||
DbObject::OnUnregistered.connect(boost::bind(&DbConnection::DeactivateObject, this, _1));
|
||||
DbObject::OnQuery.connect(boost::bind(&DbConnection::ExecuteQuery, this, _1));
|
||||
}
|
||||
|
||||
|
|
|
@ -30,8 +30,6 @@
|
|||
|
||||
using namespace icinga;
|
||||
|
||||
boost::signals2::signal<void (const DbObject::Ptr&)> DbObject::OnRegistered;
|
||||
boost::signals2::signal<void (const DbObject::Ptr&)> DbObject::OnUnregistered;
|
||||
boost::signals2::signal<void (const DbQuery&)> DbObject::OnQuery;
|
||||
|
||||
INITIALIZE_ONCE(DbObject, &DbObject::StaticInitialize);
|
||||
|
@ -42,9 +40,6 @@ DbObject::DbObject(const shared_ptr<DbType>& type, const String& name1, const St
|
|||
|
||||
void DbObject::StaticInitialize(void)
|
||||
{
|
||||
DynamicObject::OnStarted.connect(boost::bind(&DbObject::ObjectStartedHandler, _1));
|
||||
DynamicObject::OnStopped.connect(boost::bind(&DbObject::ObjectStoppedHandler, _1));
|
||||
|
||||
DynamicObject::OnStateChanged.connect(boost::bind(&DbObject::StateChangedHandler, _1));
|
||||
}
|
||||
|
||||
|
@ -188,34 +183,6 @@ DbObject::Ptr DbObject::GetOrCreateByObject(const DynamicObject::Ptr& object)
|
|||
return dbobj;
|
||||
}
|
||||
|
||||
void DbObject::ObjectStartedHandler(const DynamicObject::Ptr& object)
|
||||
{
|
||||
DbObject::Ptr dbobj = GetOrCreateByObject(object);
|
||||
|
||||
if (!dbobj)
|
||||
return;
|
||||
|
||||
OnRegistered(dbobj);
|
||||
|
||||
dbobj->SendConfigUpdate();
|
||||
dbobj->SendStatusUpdate();
|
||||
}
|
||||
|
||||
void DbObject::ObjectStoppedHandler(const DynamicObject::Ptr& object)
|
||||
{
|
||||
DbObject::Ptr dbobj = GetOrCreateByObject(object);
|
||||
|
||||
if (!dbobj)
|
||||
return;
|
||||
|
||||
OnUnregistered(dbobj);
|
||||
|
||||
{
|
||||
ObjectLock olock(object);
|
||||
object->ClearExtension("DbObject");
|
||||
}
|
||||
}
|
||||
|
||||
void DbObject::StateChangedHandler(const DynamicObject::Ptr& object)
|
||||
{
|
||||
DbObject::Ptr dbobj = GetOrCreateByObject(object);
|
||||
|
|
|
@ -75,8 +75,6 @@ public:
|
|||
|
||||
static DbObject::Ptr GetOrCreateByObject(const DynamicObject::Ptr& object);
|
||||
|
||||
static boost::signals2::signal<void (const DbObject::Ptr&)> OnRegistered;
|
||||
static boost::signals2::signal<void (const DbObject::Ptr&)> OnUnregistered;
|
||||
static boost::signals2::signal<void (const DbQuery&)> OnQuery;
|
||||
|
||||
void SendConfigUpdate(void);
|
||||
|
@ -101,8 +99,6 @@ private:
|
|||
double m_LastConfigUpdate;
|
||||
double m_LastStatusUpdate;
|
||||
|
||||
static void ObjectStartedHandler(const DynamicObject::Ptr& object);
|
||||
static void ObjectStoppedHandler(const DynamicObject::Ptr& object);
|
||||
static void StateChangedHandler(const DynamicObject::Ptr& object);
|
||||
|
||||
friend class DbType;
|
||||
|
|
Loading…
Reference in New Issue