|
|
@ -16,17 +16,6 @@ |
|
|
|
|
|
|
|
|
|
|
|
package com.fr.third.springframework.web.context; |
|
|
|
package com.fr.third.springframework.web.context; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
import java.util.Properties; |
|
|
|
|
|
|
|
import java.util.concurrent.ConcurrentHashMap; |
|
|
|
|
|
|
|
import javax.servlet.ServletContext; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.logging.Log; |
|
|
|
|
|
|
|
import org.apache.commons.logging.LogFactory; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fr.third.springframework.beans.BeanUtils; |
|
|
|
import com.fr.third.springframework.beans.BeanUtils; |
|
|
|
import com.fr.third.springframework.beans.factory.access.BeanFactoryLocator; |
|
|
|
import com.fr.third.springframework.beans.factory.access.BeanFactoryLocator; |
|
|
|
import com.fr.third.springframework.beans.factory.access.BeanFactoryReference; |
|
|
|
import com.fr.third.springframework.beans.factory.access.BeanFactoryReference; |
|
|
@ -43,7 +32,16 @@ import com.fr.third.springframework.core.io.support.PropertiesLoaderUtils; |
|
|
|
import com.fr.third.springframework.util.Assert; |
|
|
|
import com.fr.third.springframework.util.Assert; |
|
|
|
import com.fr.third.springframework.util.ClassUtils; |
|
|
|
import com.fr.third.springframework.util.ClassUtils; |
|
|
|
import com.fr.third.springframework.util.ObjectUtils; |
|
|
|
import com.fr.third.springframework.util.ObjectUtils; |
|
|
|
import com.fr.third.springframework.util.StringUtils; |
|
|
|
import org.apache.commons.logging.Log; |
|
|
|
|
|
|
|
import org.apache.commons.logging.LogFactory; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.ServletContext; |
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
import java.util.Properties; |
|
|
|
|
|
|
|
import java.util.concurrent.ConcurrentHashMap; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Performs the actual initialization work for the root application context. |
|
|
|
* Performs the actual initialization work for the root application context. |
|
|
@ -494,20 +492,6 @@ public class ContextLoader { |
|
|
|
List<Class<ApplicationContextInitializer<ConfigurableApplicationContext>>> classes = |
|
|
|
List<Class<ApplicationContextInitializer<ConfigurableApplicationContext>>> classes = |
|
|
|
new ArrayList<Class<ApplicationContextInitializer<ConfigurableApplicationContext>>>(); |
|
|
|
new ArrayList<Class<ApplicationContextInitializer<ConfigurableApplicationContext>>>(); |
|
|
|
|
|
|
|
|
|
|
|
String globalClassNames = servletContext.getInitParameter(GLOBAL_INITIALIZER_CLASSES_PARAM); |
|
|
|
|
|
|
|
if (globalClassNames != null) { |
|
|
|
|
|
|
|
for (String className : StringUtils.tokenizeToStringArray(globalClassNames, INIT_PARAM_DELIMITERS)) { |
|
|
|
|
|
|
|
classes.add(loadInitializerClass(className)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String localClassNames = servletContext.getInitParameter(CONTEXT_INITIALIZER_CLASSES_PARAM); |
|
|
|
|
|
|
|
if (localClassNames != null) { |
|
|
|
|
|
|
|
for (String className : StringUtils.tokenizeToStringArray(localClassNames, INIT_PARAM_DELIMITERS)) { |
|
|
|
|
|
|
|
classes.add(loadInitializerClass(className)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return classes; |
|
|
|
return classes; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -534,14 +518,14 @@ public class ContextLoader { |
|
|
|
* EJBs. For pure web applications, there is usually no need to worry about |
|
|
|
* EJBs. For pure web applications, there is usually no need to worry about |
|
|
|
* having a parent context to the root web application context. |
|
|
|
* having a parent context to the root web application context. |
|
|
|
* <p>The default implementation uses |
|
|
|
* <p>The default implementation uses |
|
|
|
* {@link com.fr.third.springframework.context.access.ContextSingletonBeanFactoryLocator}, |
|
|
|
* {@link ContextSingletonBeanFactoryLocator}, |
|
|
|
* configured via {@link #LOCATOR_FACTORY_SELECTOR_PARAM} and |
|
|
|
* configured via {@link #LOCATOR_FACTORY_SELECTOR_PARAM} and |
|
|
|
* {@link #LOCATOR_FACTORY_KEY_PARAM}, to load a parent context |
|
|
|
* {@link #LOCATOR_FACTORY_KEY_PARAM}, to load a parent context |
|
|
|
* which will be shared by all other users of ContextsingletonBeanFactoryLocator |
|
|
|
* which will be shared by all other users of ContextsingletonBeanFactoryLocator |
|
|
|
* which also use the same configuration parameters. |
|
|
|
* which also use the same configuration parameters. |
|
|
|
* @param servletContext current servlet context |
|
|
|
* @param servletContext current servlet context |
|
|
|
* @return the parent application context, or {@code null} if none |
|
|
|
* @return the parent application context, or {@code null} if none |
|
|
|
* @see com.fr.third.springframework.context.access.ContextSingletonBeanFactoryLocator |
|
|
|
* @see ContextSingletonBeanFactoryLocator |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected ApplicationContext loadParentContext(ServletContext servletContext) { |
|
|
|
protected ApplicationContext loadParentContext(ServletContext servletContext) { |
|
|
|
ApplicationContext parentContext = null; |
|
|
|
ApplicationContext parentContext = null; |
|
|
|