X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=system%2Fgeneral%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fsystem%2Fcore%2FAbstractComponent.java;h=6567e4e74067cf13f563e5e0f7f4ab6aa4cdc4be;hb=f9145c96b66fea2db0b9f04b009caf992ad1ab70;hp=9608f4179d2aca1a07b4ed4ed81d96d6217d9113;hpb=c210d3c212308d3c5a84f4c19e84a95175e4f172;p=utils 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 9608f417..6567e4e7 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 @@ -63,12 +63,12 @@ public abstract class AbstractComponent implements Component { this(aName, new ProvidedInterface[0], new RequiredInterface[0]); } - protected AbstractComponent addProvidedInterface(ProvidedInterface aProvided) { + public AbstractComponent addProvidedInterface(ProvidedInterface aProvided) { _provided.add(aProvided); return this; } - protected AbstractComponent addRequiredInterface(RequiredInterface aRequired) { + public AbstractComponent addRequiredInterface(RequiredInterface aRequired) { _required.add(aRequired); return this; } @@ -87,6 +87,7 @@ public abstract class AbstractComponent implements Component { } } + @Override public String getContext() { return _context; } @@ -111,12 +112,13 @@ public abstract class AbstractComponent implements Component { @Override public final Type start(Scope aScope) { - LOG.info("Initializing '" + getQualifiedName() + "'"); + LOG.info("Initialization starting '" + getQualifiedName() + "'"); List oldRemaining = _remaining.get(); _remaining.set(new ArrayList(Arrays.asList(getProvidedInterfaces()))); try { Type runtime = doStart(aScope); checkNotStartedInterfaces(); + LOG.info("Initialization finished '" + getQualifiedName() + "'"); return runtime; } finally { _remaining.set(oldRemaining); @@ -163,7 +165,9 @@ public abstract class AbstractComponent implements Component { @Override public void stop(Type aRuntime) { + LOG.info("Stopping initiated '" + getQualifiedName() + "'"); doStop(aRuntime); + LOG.info("Stopping completed '" + getQualifiedName() + "'"); } protected abstract void doStop(Type aRuntime);