Comparison

core/componentmanager.lua @ 1850:8f1871c1d456

componentmanager: Fire event on component activation
author Matthew Wild <mwild1@gmail.com>
date Wed, 30 Sep 2009 11:03:11 +0100
parent 1849:5529d3c8eee7
child 1851:0a4d4ba01db8
comparison
equal deleted inserted replaced
1849:5529d3c8eee7 1850:8f1871c1d456
12 local log = require "util.logger".init("componentmanager"); 12 local log = require "util.logger".init("componentmanager");
13 local configmanager = require "core.configmanager"; 13 local configmanager = require "core.configmanager";
14 local modulemanager = require "core.modulemanager"; 14 local modulemanager = require "core.modulemanager";
15 local core_route_stanza = core_route_stanza; 15 local core_route_stanza = core_route_stanza;
16 local jid_split = require "util.jid".split; 16 local jid_split = require "util.jid".split;
17 local fire_event = require "core.eventmanager".fire_event;
17 local events_new = require "util.events".new; 18 local events_new = require "util.events".new;
18 local st = require "util.stanza"; 19 local st = require "util.stanza";
19 local hosts = hosts; 20 local hosts = hosts;
20 local serialize = require "util.serialization".serialize 21 local serialize = require "util.serialization".serialize
21 22
56 components[host] = default_component_handler; 57 components[host] = default_component_handler;
57 local ok, err = modulemanager.load(host, host_config.core.component_module); 58 local ok, err = modulemanager.load(host, host_config.core.component_module);
58 if not ok then 59 if not ok then
59 log("error", "Error loading %s component %s: %s", tostring(host_config.core.component_module), tostring(host), tostring(err)); 60 log("error", "Error loading %s component %s: %s", tostring(host_config.core.component_module), tostring(host), tostring(err));
60 else 61 else
62 fire_event("component-activated", host, host_config);
61 log("debug", "Activated %s component: %s", host_config.core.component_module, host); 63 log("debug", "Activated %s component: %s", host_config.core.component_module, host);
62 end 64 end
63 end 65 end
64 end 66 end
65 end 67 end