def start(dependency=nil, stop_on_failure=true)
reply = ResultIO.new
self.class.notify_observers(:before_start, {:application => self, :reply => reply, :dependency => dependency})
self.start_order.each do |comp_inst_name|
comp_inst = self.comp_instance_map[comp_inst_name]
next if !dependency.nil? and (comp_inst.parent_cart_name != dependency)
next if comp_inst.parent_cart_name == self.name
begin
group_inst = self.group_instance_map[comp_inst.group_instance_name]
run_on_gears(group_inst.gears, reply) do |gear, r|
r.append gear.start(comp_inst)
end
rescue Exception => e
gear_exception = e.message[:exception]
self.stop(dependency,false,false) if stop_on_failure
raise gear_exception
end
end
self.class.notify_observers(:after_start, {:application => self, :reply => reply, :dependency => dependency})
reply
end