From 8c0f6328a199183d1c6991575984b21b898173e7 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Mon, 9 Sep 2013 18:00:05 +1000 Subject: [PATCH] 415401 Add initalizeDefaults call to SpringConfigurationProcessor remove deprecated XmlBeansFactory usage --- .../jetty/spring/SpringConfigurationProcessor.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/jetty-spring/src/main/java/org/eclipse/jetty/spring/SpringConfigurationProcessor.java b/jetty-spring/src/main/java/org/eclipse/jetty/spring/SpringConfigurationProcessor.java index 89108bc73d6..f226e6725e6 100644 --- a/jetty-spring/src/main/java/org/eclipse/jetty/spring/SpringConfigurationProcessor.java +++ b/jetty-spring/src/main/java/org/eclipse/jetty/spring/SpringConfigurationProcessor.java @@ -33,6 +33,8 @@ import org.eclipse.jetty.xml.XmlParser; import org.springframework.beans.BeanWrapper; import org.springframework.beans.PropertyValues; import org.springframework.beans.factory.config.BeanDefinition; +import org.springframework.beans.factory.support.DefaultListableBeanFactory; +import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.beans.factory.xml.XmlBeanFactory; import org.springframework.core.io.ByteArrayResource; import org.springframework.core.io.Resource; @@ -63,9 +65,10 @@ public class SpringConfigurationProcessor implements ConfigurationProcessor private static final Logger LOG = Log.getLogger(SpringConfigurationProcessor.class); private XmlConfiguration _configuration; - private XmlBeanFactory _beanFactory; + private DefaultListableBeanFactory _beanFactory; private String _main; + @Override public void init(URL url, XmlParser.Node config, XmlConfiguration configuration) { try @@ -79,7 +82,8 @@ public class SpringConfigurationProcessor implements ConfigurationProcessor "" + config).getBytes("UTF-8")); - _beanFactory = new XmlBeanFactory(resource){ + _beanFactory = new DefaultListableBeanFactory() + { @Override protected void applyPropertyValues(String beanName, BeanDefinition mbd, BeanWrapper bw, PropertyValues pvs) { @@ -87,6 +91,8 @@ public class SpringConfigurationProcessor implements ConfigurationProcessor super.applyPropertyValues(beanName, mbd, bw, pvs); } }; + + new XmlBeanDefinitionReader(_beanFactory).loadBeanDefinitions(resource); } catch (Exception e) { @@ -94,6 +100,7 @@ public class SpringConfigurationProcessor implements ConfigurationProcessor } } + @Override public Object configure(Object obj) throws Exception { doConfigure(); @@ -105,6 +112,7 @@ public class SpringConfigurationProcessor implements ConfigurationProcessor * * @see org.eclipse.jetty.xml.ConfigurationProcessor#configure() */ + @Override public Object configure() throws Exception { doConfigure();