added databasecomponent and now using Derby in the unit tests.
[utils] / system / general / src / main / java / org / wamblee / system / core / AbstractComponent.java
index 6567e4e74067cf13f563e5e0f7f4ab6aa4cdc4be..04f0480125c36ff5737258b728b64461b3d3b11d 100644 (file)
@@ -159,7 +159,10 @@ public abstract class AbstractComponent<Type> implements Component<Type> {
                        Object aService, Scope aScope) {
                LOG.info("Interface '" + getQualifiedName() + "."
                                + aDescriptor.getName() + "' started.");
-               _remaining.get().remove(aDescriptor);
+               if ( !_remaining.get().remove(aDescriptor) ) { 
+                   throw new SystemAssemblyException("Component '" + getQualifiedName() + "' started an unexpected interface '" + 
+                           aDescriptor + "' that was not registerd as a provided interface before");
+               }
                aScope.publishInterface(aDescriptor, aService);
        }