01: package org.osbl.spring;
02:
03: import org.springframework.beans.factory.support.DefaultListableBeanFactory;
04: import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
05: import org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader;
06: import org.springframework.beans.factory.BeanFactory;
07: import org.springframework.core.io.Resource;
08:
09: public class DeployedBeanFactory extends DefaultListableBeanFactory {
10: private XmlBeanDefinitionReader reader;
11:
12: public DeployedBeanFactory(BeanFactory parent) {
13: super (parent);
14: reader = new XmlBeanDefinitionReader(this );
15: reader
16: .setDocumentReaderClass(DefaultBeanDefinitionDocumentReader.class);
17: }
18:
19: public DeployedBeanFactory() {
20: reader = new XmlBeanDefinitionReader(this );
21: reader
22: .setDocumentReaderClass(DefaultBeanDefinitionDocumentReader.class);
23: }
24:
25: public void addResource(Resource resource) {
26: this.reader.loadBeanDefinitions(resource);
27: }
28: }
|