]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - org.argeo.slc.agent/src/main/java/org/argeo/slc/ant/AntSlcApplication.java
Adapt web services to lazy loading
[gpl/argeo-slc.git] / org.argeo.slc.agent / src / main / java / org / argeo / slc / ant / AntSlcApplication.java
index ae1f8ef13dbd2f6cd836bd1d60b271f503b6ef9c..7c85fc2397ca9d921ccb148ba55951648521208e 100644 (file)
@@ -28,6 +28,7 @@ import org.argeo.slc.core.structure.tree.TreeSPath;
 import org.argeo.slc.core.structure.tree.TreeSRegistry;
 import org.argeo.slc.logging.Log4jUtils;
 import org.argeo.slc.runtime.SlcExecutionOutput;
+import org.springframework.beans.factory.BeanFactoryUtils;
 import org.springframework.beans.factory.ListableBeanFactory;
 import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
 import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
@@ -45,7 +46,7 @@ public class AntSlcApplication {
        private final static Log log = LogFactory.getLog(AntSlcApplication.class);
 
        private Resource contextLocation;
-       private ApplicationContext parentContext;
+       private ConfigurableApplicationContext parentContext;
 
        private Resource rootDir;
        private Resource confDir;
@@ -248,8 +249,9 @@ public class AntSlcApplication {
                ListableBeanFactory context = (ListableBeanFactory) project
                                .getReference(AntConstants.REF_ROOT_CONTEXT);
                // Register build listeners
-               Map<String, BuildListener> listeners = context.getBeansOfType(
-                               BuildListener.class, false, true);
+               Map<String, BuildListener> listeners = BeanFactoryUtils
+                               .beansOfTypeIncludingAncestors(context, BuildListener.class,
+                                               false, false);
                for (BuildListener listener : listeners.values()) {
                        project.addBuildListener(listener);
                }
@@ -399,7 +401,7 @@ public class AntSlcApplication {
                this.workDir = workDir;
        }
 
-       public void setParentContext(ApplicationContext runtimeContext) {
+       public void setParentContext(ConfigurableApplicationContext runtimeContext) {
                this.parentContext = runtimeContext;
        }