*/
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;
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;
} 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;
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);
}
}
}
*/
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;
*/
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;
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
* @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;
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) {