Commit f72c08ce authored by Renato Figueiro Maia's avatar Renato Figueiro Maia
Browse files

[OPENBUS-2928] 'busadmin' oferce recurso de finalização do núcleo do barramento

git-svn-id: ae0415b3-e90b-0410-900d-d0be9363c56b
parents 6d0b3e64 c51eb4dd
...@@ -159,26 +159,20 @@ function module.newSCS(params) ...@@ -159,26 +159,20 @@ function module.newSCS(params)
end end
-- inicia o componente -- inicia o componente
function component.IComponent:startup() component.IComponent.startup = params.startup or function(self)
for name, obj in pairs(facets) do for name, obj in pairs(facets) do
if obj.startup ~= nil then if obj.startup ~= nil then
obj:startup() obj:startup()
end end
end end
end end
local shutdown = params.shutdown component.IComponent.shutdown = params.shutdown or function(self)
function component.IComponent:shutdown()
for name, obj in pairs(facets) do for name, obj in pairs(facets) do
if obj.shutdown ~= nil then if obj.shutdown ~= nil then
obj:shutdown() obj:shutdown()
end end
end end
if shutdown ~= nil then shutdown() end self.context:deactivateComponent()
local errors = self.context:deactivateComponent()
for name, error in pairs(errors) do
errors[#errors+1] = tostring(error)
assert(errors == 0, concat(errors, "\n"))
end end
local init = params.init local init = params.init
if init ~= nil then init() end if init ~= nil then init() end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment