/[freeride]/freeride/freebase/configuration.rb
ViewVC logotype

Diff of /freeride/freebase/configuration.rb

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by richkilmer, Mon Nov 11 20:22:05 2002 UTC revision 1.4 by richkilmer, Tue Nov 12 04:52:18 2002 UTC
# Line 56  module FreeBASE Line 56  module FreeBASE
56      # Loads all the plugins based on the load list calculated by the depenency resolution      # Loads all the plugins based on the load list calculated by the depenency resolution
57      #      #
58      def load_plugins      def load_plugins
59        @load_list.each do |plugin|        num = 0
60          while num < @load_list.size
61            plugin = @load_list[num]
62          plugin.instance.load          plugin.instance.load
63            if plugin.instance.state != LOADED
64              fail_load_dependencies(plugin)
65              fail_start_dependencies(plugin)
66            else
67              num += 1
68            end
69        end        end
70      end      end
71            
# Line 65  module FreeBASE Line 73  module FreeBASE
73      # Starts all the plugins based on the start list calculated by the depenency resolution      # Starts all the plugins based on the start list calculated by the depenency resolution
74      #      #
75      def start_plugins      def start_plugins
76        @start_list.each do |plugin|        num = 0
77          while num < @start_list.size
78            plugin = @start_list[num]
79          plugin.instance.start          plugin.instance.start
80            if plugin.instance.state != RUNNING
81              fail_start_dependencies(plugin)
82            else
83              num += 1
84            end
85        end        end
86      end      end
87            
# Line 90  module FreeBASE Line 105  module FreeBASE
105            
106      private      private
107            
108        def fail_load_dependencies(plugin)
109          puts "Failing to load: #{plugin.name}"
110          @load_list.delete(plugin)
111          plugin.rev_load_graph.each { |other| fail_load_dependencies(other) }
112        end
113        
114        def fail_start_dependencies(plugin)
115          puts "Failing to start: #{plugin.name}"
116          @start_list.delete(plugin)
117          plugin.rev_start_graph.each { |other| fail_start_dependencies(other) }
118        end
119        
120      def resolve_dependencies      def resolve_dependencies
121        # graph dependencies        # graph dependencies
122        @plugins.each_value do |plugin|        @plugins.each_value do |plugin|

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26