SpringComponent now supports adding properties as beans instead of
[utils] / system / spring / src / main / java / org / wamblee / system / spring / SpringComponent.java
index aea9b15aa1a548eacfe9e7c1a39667f684606003..1da30a324ed53c4c9812306669e2adc287b5b6a8 100644 (file)
@@ -94,10 +94,6 @@ public class SpringComponent extends AbstractComponent<Scope> {
                        setProperty((String) key, aProperties.getProperty((String) key));
                }
        }
-       
-       public Scope start() { 
-               return super.start(new DefaultScope(new ProvidedInterface[0]));
-       }
 
        @Override
        protected Scope doStart(Scope aExternalScope) {
@@ -113,20 +109,22 @@ public class SpringComponent extends AbstractComponent<Scope> {
                        registerRequiredServices(parentContext);
 
                        parentContext.refresh();
-
+                       
+                       System.out.println("Parent context " + parentContext);
+                   
                        AbstractApplicationContext context = parseConfigFiles(parentContext);
 
                        context
                                        .addBeanFactoryPostProcessor(new PropertySetter(_properties));
                        context.refresh();
 
-                       exposeProvidedServices(context, scope);
+                       exposeProvidedServices(context, aExternalScope);
                        
                        scope.put(CONTEXT_KEY, context);
                        return scope; 
                } catch (Exception e) {
                        throw new SystemAssemblyException(
-                                       "Failed to assemble spring system", e);
+                                       "Failed to assemble spring system " + getName(), e);
                } finally {
                        THIS.set(old);
                        SCOPE.set(oldScope);
@@ -144,7 +142,6 @@ public class SpringComponent extends AbstractComponent<Scope> {
                        }
                        addInterface(_provided.get(name), svc, aScope);
                        System.out.println("addService " + _provided.get(name) + " " + svc);
-                       aScope.publishInterface(_provided.get(name), svc);
                }
        }
 
@@ -152,7 +149,7 @@ public class SpringComponent extends AbstractComponent<Scope> {
                // Parse spring config files
 
                return new ClassPathXmlApplicationContext((String[]) _configFiles,
-                               aParentContext);
+                               false, aParentContext);
        }
 
        private void registerRequiredServices(GenericApplicationContext aParentContext) {