import org.springframework.beans.factory.FactoryBean;
import org.wamblee.system.core.ProvidedInterface;
import org.wamblee.system.core.RequiredInterface;
+import org.wamblee.system.core.RequiredInterfaces;
import org.wamblee.system.core.SystemAssemblyException;
/**
* @param aId Id of the bean in the service registry.
*/
public RequiredServiceBean(String aId) {
- RequiredInterface[] required = SpringComponent.THIS.get().getRequiredInterfaces();
+ RequiredInterfaces required = SpringComponent.THIS.get().getRequiredInterfaces();
for ( RequiredInterface intf: required) {
if ( intf.getName().equals(aId)) {
_required = intf;
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();
HelloService.class);
Scope scope = new DefaultScope(new ProvidedInterface[] { helloService });
scope.publishInterface(helloService, helloObject);
- system.getRequiredInterfaces()[0].setProvider(helloService);
+ system.getRequiredInterfaces().get(0).setProvider(helloService);
Scope runtime = system.start(scope);
system.stop(runtime);
HelloService.class);
Scope scope = new DefaultScope(new ProvidedInterface[] { helloService });
scope.publishInterface(helloService, helloObject);
- system.getRequiredInterfaces()[0].setProvider(helloService);
+ system.getRequiredInterfaces().get(0).setProvider(helloService);
Scope runtime = system.start(scope);
ProvidedInterface started = runtime.getProvidedInterfaces()[0];
assertSame(service, service2);
Object floatsvc = _externalScope.getInterfaceImplementation(system
- .getProvidedInterfaces()[1], Object.class);
+ .getProvidedInterfaces().get(1), Object.class);
assertTrue(floatsvc instanceof Float);
assertTrue((((Float) floatsvc).floatValue() - 100.345f) < 0.00001);
Scope scope = new DefaultScope(new ProvidedInterface[] { helloService });
scope.publishInterface(helloService, helloObject);
scope.publishInterface(floatService, 100.234f);
- system.getRequiredInterfaces()[0].setProvider(helloService);
- system.getRequiredInterfaces()[1].setProvider(floatService);
+ system.getRequiredInterfaces().get(0).setProvider(helloService);
+ system.getRequiredInterfaces().get(1).setProvider(floatService);
Scope runtime = system.start(scope);
system.stop(runtime);