import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.GenericApplicationContext;
-import org.wamblee.system.AbstractComponent;
-import org.wamblee.system.ProvidedInterface;
-import org.wamblee.system.RequiredInterface;
-import org.wamblee.system.SystemAssemblyException;
+import org.wamblee.system.core.AbstractComponent;
+import org.wamblee.system.core.ProvidedInterface;
+import org.wamblee.system.core.RequiredInterface;
+import org.wamblee.system.core.SystemAssemblyException;
/**
* Represents a system configured based on spring. The spring config files that
throw new IllegalArgumentException(getQualifiedName() + ": service '"
+ name + "' is null");
}
- addService(_provided.get(name), svc);
+ addInterface(_provided.get(name), svc);
}
}
private void registerRequiredServices() {
// Register required services in a parent context
- for (RequiredInterface required: getRequiredServices()) {
+ for (RequiredInterface required: getRequiredInterfaces()) {
String beanName = _required.get(required);
ConstructorArgumentValues cargs = new ConstructorArgumentValues();
cargs.addGenericArgumentValue(required.getName());
@Override
protected void doStop() {
_context.close();
+ for (ProvidedInterface provided: getProvidedInterfaces()) {
+ removeInterface(provided);
+ }
}
}