import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.GenericApplicationContext;
-import org.wamblee.system.AbstractSubSystem;
+import org.wamblee.system.AbstractComponent;
import org.wamblee.system.CompositeSystem;
-import org.wamblee.system.ProvidedServiceDescriptor;
-import org.wamblee.system.RequiredServiceDescriptor;
+import org.wamblee.system.ProvidedInterfaceDescriptor;
+import org.wamblee.system.RequiredInterfaceDescriptor;
import org.wamblee.system.Service;
-import org.wamblee.system.ServiceDescriptor;
+import org.wamblee.system.InterfaceDescriptor;
import org.wamblee.system.ServiceRegistry;
import org.wamblee.system.SystemAssembler;
import org.wamblee.system.SystemAssemblyException;
/**
* Represents a system configured based on spring.
+ *
+ * @author Erik Brakkee
*/
-public class SpringSystem extends AbstractSubSystem {
+public class SpringSystem extends AbstractComponent {
/**
* Singleton access to the service registry. Required while starting up.
static ThreadLocal<ServiceRegistry> REGISTRY = new ThreadLocal<ServiceRegistry>();
private String[] _configFiles;
- private Map<String, ProvidedServiceDescriptor> _provided;
- private Map<RequiredServiceDescriptor, String> _required;
+ private Map<String, ProvidedInterfaceDescriptor> _provided;
+ private Map<RequiredInterfaceDescriptor, String> _required;
/**
* Parent application context containing required services.
*/
* service.
*/
public SpringSystem(String aName, ServiceRegistry aRegistry, String[] aConfigFiles,
- Map<String, ProvidedServiceDescriptor> aProvided,
- Map<RequiredServiceDescriptor, String> aRequired) {
- super(aName, aRegistry, aProvided.values().toArray(new ServiceDescriptor[0]),
- aRequired.keySet().toArray(new ServiceDescriptor[0]));
+ Map<String, ProvidedInterfaceDescriptor> aProvided,
+ Map<RequiredInterfaceDescriptor, String> aRequired) {
+ super(aName, aRegistry, aProvided.values().toArray(new InterfaceDescriptor[0]),
+ aRequired.keySet().toArray(new InterfaceDescriptor[0]));
_configFiles = aConfigFiles;
_provided = aProvided;
_required = aRequired;
for (Service svc: aRequiredServices) {
String id = svc.getId();
- ProvidedServiceDescriptor descriptor = svc.getDescriptor();
- RequiredServiceDescriptor[] requiredServices = SystemAssembler.filterRequiredServices(descriptor,
+ ProvidedInterfaceDescriptor descriptor = svc.getDescriptor();
+ RequiredInterfaceDescriptor[] requiredServices = SystemAssembler.filterRequiredServices(descriptor,
_required.keySet());
- for (RequiredServiceDescriptor required: requiredServices) {
+ for (RequiredInterfaceDescriptor required: requiredServices) {
String beanName = _required.get(required);
ConstructorArgumentValues cargs = new ConstructorArgumentValues();
cargs.addGenericArgumentValue(id);