mirror of https://github.com/Icinga/icinga2.git
Renamed "hooks" to "methods".
This commit is contained in:
parent
8e118983be
commit
7270fb160c
|
@ -197,12 +197,12 @@ void ConfigObject::RemoveTag(const string& key)
|
||||||
GetTags()->Remove(key);
|
GetTags()->Remove(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
ScriptTask::Ptr ConfigObject::InvokeHook(const string& hook,
|
ScriptTask::Ptr ConfigObject::InvokeMethod(const string& method,
|
||||||
const vector<Variant>& arguments, ScriptTask::CompletionCallback callback)
|
const vector<Variant>& arguments, ScriptTask::CompletionCallback callback)
|
||||||
{
|
{
|
||||||
Dictionary::Ptr hooks;
|
Dictionary::Ptr methods;
|
||||||
string funcName;
|
string funcName;
|
||||||
if (!GetProperty("hooks", &hooks) || !hooks->Get(hook, &funcName))
|
if (!GetProperty("methods", &methods) || !methods->Get(method, &funcName))
|
||||||
return ScriptTask::Ptr();
|
return ScriptTask::Ptr();
|
||||||
|
|
||||||
ScriptFunction::Ptr func = ScriptFunction::GetByName(funcName);
|
ScriptFunction::Ptr func = ScriptFunction::GetByName(funcName);
|
||||||
|
|
|
@ -65,7 +65,7 @@ public:
|
||||||
|
|
||||||
void RemoveTag(const string& key);
|
void RemoveTag(const string& key);
|
||||||
|
|
||||||
ScriptTask::Ptr InvokeHook(const string& hook,
|
ScriptTask::Ptr InvokeMethod(const string& hook,
|
||||||
const vector<Variant>& arguments, ScriptTask::CompletionCallback callback);
|
const vector<Variant>& arguments, ScriptTask::CompletionCallback callback);
|
||||||
|
|
||||||
string GetType(void) const;
|
string GetType(void) const;
|
||||||
|
|
|
@ -46,8 +46,8 @@ void ConfigObjectAdapter::RemoveTag(const string& key)
|
||||||
m_ConfigObject->RemoveTag(key);
|
m_ConfigObject->RemoveTag(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
ScriptTask::Ptr ConfigObjectAdapter::InvokeHook(const string& hook,
|
ScriptTask::Ptr ConfigObjectAdapter::InvokeMethod(const string& method,
|
||||||
const vector<Variant>& arguments, ScriptTask::CompletionCallback callback)
|
const vector<Variant>& arguments, ScriptTask::CompletionCallback callback)
|
||||||
{
|
{
|
||||||
return m_ConfigObject->InvokeHook(hook, arguments, callback);
|
return m_ConfigObject->InvokeMethod(method, arguments, callback);
|
||||||
}
|
}
|
|
@ -57,7 +57,7 @@ public:
|
||||||
|
|
||||||
void RemoveTag(const string& key);
|
void RemoveTag(const string& key);
|
||||||
|
|
||||||
ScriptTask::Ptr InvokeHook(const string& hook,
|
ScriptTask::Ptr InvokeMethod(const string& method,
|
||||||
const vector<Variant>& arguments, ScriptTask::CompletionCallback callback);
|
const vector<Variant>& arguments, ScriptTask::CompletionCallback callback);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -79,7 +79,7 @@ void CheckerComponent::CheckTimerHandler(void)
|
||||||
vector<Variant> arguments;
|
vector<Variant> arguments;
|
||||||
arguments.push_back(service.GetConfigObject());
|
arguments.push_back(service.GetConfigObject());
|
||||||
ScriptTask::Ptr task;
|
ScriptTask::Ptr task;
|
||||||
task = service.InvokeHook("check", arguments, boost::bind(&CheckerComponent::CheckCompletedHandler, this, service, _1));
|
task = service.InvokeMethod("check", arguments, boost::bind(&CheckerComponent::CheckCompletedHandler, this, service, _1));
|
||||||
assert(task); /* TODO: gracefully handle missing hooks */
|
assert(task); /* TODO: gracefully handle missing hooks */
|
||||||
|
|
||||||
m_PendingServices.insert(service.GetConfigObject());
|
m_PendingServices.insert(service.GetConfigObject());
|
||||||
|
|
Loading…
Reference in New Issue