(no commit message)
authorErik Brakkee <erik@brakkee.org>
Thu, 22 Jul 2010 11:54:27 +0000 (11:54 +0000)
committerErik Brakkee <erik@brakkee.org>
Thu, 22 Jul 2010 11:54:27 +0000 (11:54 +0000)
system/general/src/main/java/org/wamblee/system/container/Container.java
system/general/src/main/java/org/wamblee/system/core/AbstractComponent.java
system/general/src/main/java/org/wamblee/system/graph/component/CheckExternallyRequiredVisitor.java

index dc0995a42216d261a47ee9f22287f01dedf0f08b..a7d19e6c761be637611d08e8edfc26d6ef95dfad 100644 (file)
  */ 
 package org.wamblee.system.container;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 import org.wamblee.general.Pair;
-
 import org.wamblee.system.core.AbstractComponent;
 import org.wamblee.system.core.Component;
 import org.wamblee.system.core.DefaultScope;
@@ -34,17 +36,13 @@ import org.wamblee.system.graph.component.ConnectExternalProvidedProvidedFilter;
 import org.wamblee.system.graph.component.ConnectRequiredExternallyRequiredEdgeFilter;
 import org.wamblee.system.graph.component.ConnectRequiredProvidedEdgeFilter;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
 /**
  * Container consisting of multiple components.
  * 
  * @author Erik Brakkee
  */
 public class Container extends AbstractComponent<Scope> {
-    private static final Log LOG = LogFactory.getLog(Container.class);
+    private static final Logger LOG = Logger.getLogger(Container.class.getName());
 
     private List<Component> components;
 
@@ -369,7 +367,7 @@ public class Container extends AbstractComponent<Scope> {
             } catch (SystemAssemblyException e) {
                 throw e;
             } catch (RuntimeException e) {
-                LOG.error(getQualifiedName() + ": could not start '" +
+                LOG.log(Level.WARNING, getQualifiedName() + ": could not start '" +
                     component.getQualifiedName() + "'", e);
                 stopAlreadyStartedComponents(started, aScope);
                 throw e;
@@ -408,8 +406,8 @@ public class Container extends AbstractComponent<Scope> {
                 Component component = aStarted.get(i);
                 aStarted.get(i).stop(aScope.getRuntime(component));
             } catch (Throwable t) {
-                LOG.error(getQualifiedName() + ": error stopping " +
-                    aStarted.get(i).getQualifiedName());
+                LOG.log(Level.WARNING, getQualifiedName() + ": error stopping " +
+                    aStarted.get(i).getQualifiedName(), t);
             }
         }
     }
index c7145cdf20fb37fb02ba472221faf00c0f1f437f..b986d40be865da3f44186f778193e298010278c2 100644 (file)
  */ 
 package org.wamblee.system.core;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
+import java.util.logging.Logger;
 
 /**
  * Abstract subsystem class making it easy to implement new subsystems.
  * 
  */
 public abstract class AbstractComponent<Type> implements Component<Type> {
-    private static final Log LOG = LogFactory.getLog(AbstractComponent.class);
+    private static final Logger LOG = Logger.getLogger(AbstractComponent.class.getName());
 
     private ThreadLocal<List<ProvidedInterface>> remaining;
 
index 8e90ef4f2f132d77b843f2e4aa2866f2f49a0d49..15b5f9b118618909b89290007744e0f84f4f696c 100644 (file)
@@ -15,8 +15,6 @@
  */ 
 package org.wamblee.system.graph.component;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 
 import org.wamblee.system.core.SystemAssemblyException;
 import org.wamblee.system.graph.Edge;
@@ -25,6 +23,7 @@ import org.wamblee.system.graph.Node;
 import org.wamblee.system.graph.Visitor;
 
 import java.util.List;
+import java.util.logging.Logger;
 
 /**
  * Visitor that checks whether all required external interfaces of the container
@@ -33,7 +32,7 @@ import java.util.List;
  * @author Erik Brakkee
  */
 public class CheckExternallyRequiredVisitor implements Visitor {
-    private static final Log LOG = LogFactory.getLog(CheckExternallyRequiredVisitor.class);
+    private static final Logger LOG = Logger.getLogger(CheckExternallyRequiredVisitor.class.getName());
 
     private Graph graph;
 
@@ -64,7 +63,7 @@ public class CheckExternallyRequiredVisitor implements Visitor {
             List<Edge> edges = graph.findIncoming(aNode);
 
             if (edges.isEmpty()) {
-                LOG.warn(aNode + ": Superfluous required interface");
+                LOG.warning(aNode + ": Superfluous required interface");
             }
 
             for (Edge edge : edges) {