SpringComponent old = THIS.get();
Scope oldScope = SCOPE.get();
THIS.set(this);
- Scope scope = new DefaultScope(getProvidedInterfaces(), aExternalScope);
+ Scope scope = new DefaultScope(getProvidedInterfaces().toArray(), aExternalScope);
SCOPE.set(scope);
try {
GenericApplicationContext parentContext = new GenericApplicationContext();
// Register required services in a parent context
for (RequiredInterface required: getRequiredInterfaces()) {
String beanName = _required.get(required);
- ConstructorArgumentValues cargs = new ConstructorArgumentValues();
- cargs.addGenericArgumentValue(required.getName());
- BeanDefinition definition = new RootBeanDefinition(
- RequiredServiceBean.class, cargs,
- new MutablePropertyValues());
- aParentContext.registerBeanDefinition(beanName, definition);
+ if ( beanName != null && beanName.length() > 0) {
+ ConstructorArgumentValues cargs = new ConstructorArgumentValues();
+ cargs.addGenericArgumentValue(required.getName());
+ BeanDefinition definition = new RootBeanDefinition(
+ RequiredServiceBean.class, cargs,
+ new MutablePropertyValues());
+ aParentContext.registerBeanDefinition(beanName, definition);
+ } else {
+ // The required interface is not required by the spring config but by the sub-class directly.
+ }
}
}