Commit in servicemix/base/src/main/java/org/servicemix/jbi/config on MAIN
XmlWebApplicationContext.java+48added 1.1
added a helper class to allow non-validating ApplicationContexts with ServiceMIx's extended XML

servicemix/base/src/main/java/org/servicemix/jbi/config
XmlWebApplicationContext.java added at 1.1
diff -N XmlWebApplicationContext.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ XmlWebApplicationContext.java	12 Sep 2005 17:03:41 -0000	1.1
@@ -0,0 +1,48 @@
+/**
+ * 
+ * Copyright 2005 LogicBlaze, Inc. http://www.logicblaze.com
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); 
+ * you may not use this file except in compliance with the License. 
+ * You may obtain a copy of the License at 
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ * See the License for the specific language governing permissions and 
+ * limitations under the License. 
+ * 
+ **/
+package org.servicemix.jbi.config;
+
+import org.springframework.beans.factory.support.DefaultListableBeanFactory;
+import org.springframework.beans.factory.xml.ResourceEntityResolver;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
+
+import java.io.IOException;
+
+/**
+ * A modified version of the Spring class which supports ApplicationContext without validation.
+ * 
+ * @version $Revision$
+ */
+public class XmlWebApplicationContext extends org.springframework.web.context.support.XmlWebApplicationContext {
+
+    /**
+     * Loads the bean definitions via an XmlBeanDefinitionReader.
+     * 
+     * @see org.springframework.beans.factory.xml.XmlBeanDefinitionReader
+     * @see #initBeanDefinitionReader
+     * @see #loadBeanDefinitions
+     */
+    protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) throws IOException {
+        XmlBeanDefinitionReader beanDefinitionReader = new XmlBeanDefinitionReader(beanFactory);
+        beanDefinitionReader.setEntityResolver(new ResourceEntityResolver(this));
+        beanDefinitionReader.setValidating(false);
+        initBeanDefinitionReader(beanDefinitionReader);
+        loadBeanDefinitions(beanDefinitionReader);
+    }
+
+}
CVSspam 0.2.8



Reply via email to