From: Erik Brakkee Date: Thu, 22 Jul 2010 11:54:27 +0000 (+0000) Subject: (no commit message) X-Git-Tag: wamblee-utils-0.7~218 X-Git-Url: http://wamblee.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=dbc865a7c77c50c817f94230a795ff18cbc12143;hp=e27d51b0e8f5e2547b243015dec3f590aeabb733;p=utils --- diff --git a/system/general/src/main/java/org/wamblee/system/container/Container.java b/system/general/src/main/java/org/wamblee/system/container/Container.java index dc0995a4..a7d19e6c 100644 --- a/system/general/src/main/java/org/wamblee/system/container/Container.java +++ b/system/general/src/main/java/org/wamblee/system/container/Container.java @@ -15,11 +15,13 @@ */ 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 { - private static final Log LOG = LogFactory.getLog(Container.class); + private static final Logger LOG = Logger.getLogger(Container.class.getName()); private List components; @@ -369,7 +367,7 @@ public class Container extends AbstractComponent { } 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 { 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); } } } diff --git a/system/general/src/main/java/org/wamblee/system/core/AbstractComponent.java b/system/general/src/main/java/org/wamblee/system/core/AbstractComponent.java index c7145cdf..b986d40b 100644 --- a/system/general/src/main/java/org/wamblee/system/core/AbstractComponent.java +++ b/system/general/src/main/java/org/wamblee/system/core/AbstractComponent.java @@ -15,20 +15,18 @@ */ 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 implements Component { - private static final Log LOG = LogFactory.getLog(AbstractComponent.class); + private static final Logger LOG = Logger.getLogger(AbstractComponent.class.getName()); private ThreadLocal> remaining; diff --git a/system/general/src/main/java/org/wamblee/system/graph/component/CheckExternallyRequiredVisitor.java b/system/general/src/main/java/org/wamblee/system/graph/component/CheckExternallyRequiredVisitor.java index 8e90ef4f..15b5f9b1 100644 --- a/system/general/src/main/java/org/wamblee/system/graph/component/CheckExternallyRequiredVisitor.java +++ b/system/general/src/main/java/org/wamblee/system/graph/component/CheckExternallyRequiredVisitor.java @@ -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 edges = graph.findIncoming(aNode); if (edges.isEmpty()) { - LOG.warn(aNode + ": Superfluous required interface"); + LOG.warning(aNode + ": Superfluous required interface"); } for (Edge edge : edges) {