mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-27 07:34:15 +02:00
Fix order for startup events.
This commit is contained in:
parent
91724814d8
commit
a3eed67774
@ -73,12 +73,6 @@ void DynamicObject::Deserialize(const Dictionary::Ptr& update, int attributeType
|
|||||||
ObjectLock olock(this);
|
ObjectLock olock(this);
|
||||||
InternalDeserialize(update, attributeTypes);
|
InternalDeserialize(update, attributeTypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attributeTypes & Attribute_Config)
|
|
||||||
OnConfigLoaded();
|
|
||||||
|
|
||||||
if (attributeTypes & Attribute_State)
|
|
||||||
OnStateLoaded();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DynamicObject::InternalSerialize(const Dictionary::Ptr& bag, int attributeTypes) const
|
void DynamicObject::InternalSerialize(const Dictionary::Ptr& bag, int attributeTypes) const
|
||||||
|
@ -82,6 +82,9 @@ public:
|
|||||||
virtual void Start(void);
|
virtual void Start(void);
|
||||||
virtual void Stop(void);
|
virtual void Stop(void);
|
||||||
|
|
||||||
|
virtual void OnConfigLoaded(void);
|
||||||
|
virtual void OnStateLoaded(void);
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
static shared_ptr<T> GetObject(const String& name)
|
static shared_ptr<T> GetObject(const String& name)
|
||||||
{
|
{
|
||||||
@ -102,9 +105,6 @@ protected:
|
|||||||
virtual void InternalSerialize(const Dictionary::Ptr& bag, int attributeTypes) const;
|
virtual void InternalSerialize(const Dictionary::Ptr& bag, int attributeTypes) const;
|
||||||
virtual void InternalDeserialize(const Dictionary::Ptr& bag, int attributeTypes);
|
virtual void InternalDeserialize(const Dictionary::Ptr& bag, int attributeTypes);
|
||||||
|
|
||||||
virtual void OnConfigLoaded(void);
|
|
||||||
virtual void OnStateLoaded(void);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
String m_Name;
|
String m_Name;
|
||||||
String m_Type;
|
String m_Type;
|
||||||
|
@ -275,9 +275,17 @@ void ConfigItem::ActivateItems(void)
|
|||||||
objects.push_back(object);
|
objects.push_back(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOST_FOREACH(const DynamicObject::Ptr& object, objects) {
|
||||||
|
object->OnConfigLoaded();
|
||||||
|
}
|
||||||
|
|
||||||
/* restore the previous program state */
|
/* restore the previous program state */
|
||||||
DynamicObject::RestoreObjects(Application::GetStatePath());
|
DynamicObject::RestoreObjects(Application::GetStatePath());
|
||||||
|
|
||||||
|
BOOST_FOREACH(const DynamicObject::Ptr& object, objects) {
|
||||||
|
object->OnStateLoaded();
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_FOREACH(const DynamicObject::Ptr& object, objects) {
|
BOOST_FOREACH(const DynamicObject::Ptr& object, objects) {
|
||||||
Log(LogDebug, "config", "Activating object '" + object->GetName() + "' of type '" + object->GetType()->GetName() + "'");
|
Log(LogDebug, "config", "Activating object '" + object->GetName() + "' of type '" + object->GetType()->GetName() + "'");
|
||||||
object->Start();
|
object->Start();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user