001: /*
002: * Copyright 2006 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.opensource.org/licenses/ecl1.php
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package org.kuali.core.util.spring;
017:
018: import org.springframework.beans.BeansException;
019: import org.springframework.beans.factory.support.DefaultListableBeanFactory;
020: import org.springframework.context.ApplicationContext;
021:
022: /**
023: * This class is what is recommended by the spring folks to get around stronger validation in spring 2 that tries to prevent circular
024: * references: http://opensource.atlassian.com/projects/spring/browse/SPR-2415?page=comments
025: */
026: public class ClassPathXmlApplicationContext
027: extends
028: org.springframework.context.support.ClassPathXmlApplicationContext {
029:
030: /**
031: * Sets allowRawInjectionDespiteWrapping to true.
032: *
033: * @see org.springframework.context.support.AbstractRefreshableApplicationContext#createBeanFactory()
034: */
035: @Override
036: protected DefaultListableBeanFactory createBeanFactory() {
037: DefaultListableBeanFactory beanFactory = super
038: .createBeanFactory();
039: beanFactory.setAllowRawInjectionDespiteWrapping(true);
040: return beanFactory;
041: }
042:
043: /**
044: * @see org.springframework.context.support.ClassPathXmlApplicationContext#ClassPathXmlApplicationContext(java.lang.String)
045: */
046: public ClassPathXmlApplicationContext(String configLocation)
047: throws BeansException {
048: super (configLocation);
049: }
050:
051: /**
052: * @see org.springframework.context.support.ClassPathXmlApplicationContext#ClassPathXmlApplicationContext(java.lang.String[])
053: */
054: public ClassPathXmlApplicationContext(String[] configLocations)
055: throws BeansException {
056: super (configLocations);
057: }
058:
059: /**
060: * @see org.springframework.context.support.ClassPathXmlApplicationContext#ClassPathXmlApplicationContext(java.lang.String[],org.springframework.context.ApplicationContext)
061: */
062: public ClassPathXmlApplicationContext(String[] configLocations,
063: ApplicationContext parent) throws BeansException {
064: super (configLocations, parent);
065: }
066:
067: /**
068: * @see org.springframework.context.support.ClassPathXmlApplicationContext#ClassPathXmlApplicationContext(java.lang.String[],boolean)
069: */
070: public ClassPathXmlApplicationContext(String[] configLocations,
071: boolean refresh) throws BeansException {
072: super (configLocations, refresh);
073: }
074:
075: /**
076: * @see org.springframework.context.support.ClassPathXmlApplicationContext#ClassPathXmlApplicationContext(java.lang.String[],boolean,org.springframework.context.ApplicationContext)
077: */
078: public ClassPathXmlApplicationContext(String[] configLocations,
079: boolean refresh, ApplicationContext parent)
080: throws BeansException {
081: super (configLocations, refresh, parent);
082: }
083:
084: /**
085: * @see org.springframework.context.support.ClassPathXmlApplicationContext#ClassPathXmlApplicationContext(java.lang.String,java.lang.Class)
086: */
087: public ClassPathXmlApplicationContext(String path, Class clazz)
088: throws BeansException {
089: super (path, clazz);
090: }
091:
092: /**
093: * @see org.springframework.context.support.ClassPathXmlApplicationContext#ClassPathXmlApplicationContext(java.lang.String[],java.lang.Class)
094: */
095: public ClassPathXmlApplicationContext(String[] paths, Class clazz)
096: throws BeansException {
097: super (paths, clazz);
098: }
099:
100: /**
101: * @see org.springframework.context.support.ClassPathXmlApplicationContext#ClassPathXmlApplicationContext(java.lang.String[],java.lang.Class,org.springframework.context.ApplicationContext)
102: */
103: public ClassPathXmlApplicationContext(String[] paths, Class clazz,
104: ApplicationContext parent) throws BeansException {
105: super(paths, clazz, parent);
106: }
107: }
|