X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=system%2Fgeneral%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fsystem%2FAbstractComponent.java;h=a9752d1f09e7104cee6af9c75685ca9ae7b53a75;hb=6f8bb575523e672b9f8797e543f7c59d15db7253;hp=074e3ab0fe408a3e111f569b7a77d1df76bf0c23;hpb=2aa6c38d06e981a4a6c240e2d371638205c3fb54;p=utils diff --git a/system/general/src/main/java/org/wamblee/system/AbstractComponent.java b/system/general/src/main/java/org/wamblee/system/AbstractComponent.java index 074e3ab0..a9752d1f 100644 --- a/system/general/src/main/java/org/wamblee/system/AbstractComponent.java +++ b/system/general/src/main/java/org/wamblee/system/AbstractComponent.java @@ -1,3 +1,18 @@ +/* + * Copyright 2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.wamblee.system; import java.util.ArrayList; @@ -68,6 +83,12 @@ public abstract class AbstractComponent implements Component { LOG.info("Initializing '" + aContext + "." + _name + "'"); doStart(aContext + "." + getName()); _status = Status.RUNNING; + if ( _running.size() != _provided.size()) { + List remaining = + new ArrayList(_provided); + remaining.removeAll(_running); + throw new SystemAssemblyException(aContext + "." + getName() + ": not all services were started, missing " + remaining); + } } /**