ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/server/uk/org/iscream/cms/server/componentmanager/ComponentManager.java
(Generate patch)

Comparing projects/cms/source/server/uk/org/iscream/cms/server/componentmanager/ComponentManager.java (file contents):
Revision 1.17 by ajm, Fri Feb 23 16:36:38 2001 UTC vs.
Revision 1.19 by ajm, Fri Feb 23 17:16:43 2001 UTC

# Line 131 | Line 131 | public class ComponentManager {
131          Component component = null;
132          while(tryAgain) {
133              Iterator i = componentsToStart.iterator();
134 +            ArrayList failedComponents = new ArrayList();
135              while(i.hasNext()) {
136                  try {
137                      component = (Component) i.next();
138                      System.out.println(toString + ": starting component - " + component.toString());
139                      component.start();
140 <                    componentsToStart.remove(componentsToStart.indexOf(component));
140 >                    failedComponents.add(component);
141                  } catch (ComponentStartException e) {
142                      System.err.println(toString + ": ERROR starting component - " + component.toString());
143                      System.err.println(toString + ": component reports - " + e.getMessage());
# Line 150 | Line 151 | public class ComponentManager {
151              if (componentsToStart.size() > 0) {
152                  System.err.println(toString + ": WARNING One or more components failed to start correctly.");
153                  System.err.println(toString + ": Will try again in 5 seconds");
154 <                Thread.sleep(5000);
155 <            } else {
155 <                try {
156 <                    tryAgain = false;
154 >                try {    
155 >                    Thread.sleep(5000);
156                  } catch (InterruptedException e) {
157                      // we're not bothered
158                  }
159 +            } else {
160 +                tryAgain = false;
161              }
162 +            componentsToStart = failedComponents;
163          }
164                  
165              System.out.println(toString + ": running");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines