Class AbstractRefreshableConfigApplicationContext
java.lang.Object
org.springframework.core.io.DefaultResourceLoader
org.springframework.context.support.AbstractApplicationContext
org.springframework.context.support.AbstractRefreshableApplicationContext
org.springframework.context.support.AbstractRefreshableConfigApplicationContext
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- Aware,- BeanFactory,- BeanNameAware,- HierarchicalBeanFactory,- InitializingBean,- ListableBeanFactory,- ApplicationContext,- ApplicationEventPublisher,- ConfigurableApplicationContext,- Lifecycle,- MessageSource,- EnvironmentCapable,- ResourceLoader,- ResourcePatternResolver
- Direct Known Subclasses:
- AbstractRefreshableWebApplicationContext,- AbstractXmlApplicationContext
public abstract class AbstractRefreshableConfigApplicationContext
extends AbstractRefreshableApplicationContext
implements BeanNameAware, InitializingBean
AbstractRefreshableApplicationContext subclass that adds common handling
 of specified config locations. Serves as base class for XML-based application
 context implementations such as ClassPathXmlApplicationContext and
 FileSystemXmlApplicationContext, as well as
 XmlWebApplicationContext.- Since:
- 2.5.2
- Author:
- Juergen Hoeller
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class org.springframework.core.io.DefaultResourceLoaderDefaultResourceLoader.ClassPathContextResource
- 
Field SummaryFields inherited from class org.springframework.context.support.AbstractApplicationContextAPPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAMEFields inherited from interface org.springframework.beans.factory.BeanFactoryFACTORY_BEAN_PREFIXFields inherited from interface org.springframework.context.ConfigurableApplicationContextAPPLICATION_STARTUP_BEAN_NAME, BOOTSTRAP_EXECUTOR_BEAN_NAME, CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, ENVIRONMENT_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SHUTDOWN_HOOK_THREAD_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAMEFields inherited from interface org.springframework.core.io.ResourceLoaderCLASSPATH_URL_PREFIXFields inherited from interface org.springframework.core.io.support.ResourcePatternResolverCLASSPATH_ALL_URL_PREFIX
- 
Constructor SummaryConstructorsConstructorDescriptionCreate a new AbstractRefreshableConfigApplicationContext with no parent.Create a new AbstractRefreshableConfigApplicationContext with the given parent context.
- 
Method SummaryModifier and TypeMethodDescriptionvoidTriggersAbstractApplicationContext.refresh()if not refreshed in the concrete context's constructor already.protected String[]Return an array of resource locations, referring to the XML bean definition files that this context should be built with.protected String[]Return the default config locations to use, for the case where no explicit config locations have been specified.protected StringresolvePath(String path) Resolve the given path, replacing placeholders with corresponding environment property values if necessary.voidsetBeanName(String name) Sets the id of this context to the bean name by default, for cases where the context instance is itself defined as a bean.voidsetConfigLocation(String location) Set the config locations for this application context in init-param style, i.e.voidsetConfigLocations(String... locations) Set the config locations for this application context.voidSet the unique id of this application context.Methods inherited from class org.springframework.context.support.AbstractRefreshableApplicationContextassertBeanFactoryActive, cancelRefresh, closeBeanFactory, createBeanFactory, customizeBeanFactory, getBeanFactory, hasBeanFactory, loadBeanDefinitions, refreshBeanFactory, setAllowBeanDefinitionOverriding, setAllowCircularReferencesMethods inherited from class org.springframework.context.support.AbstractApplicationContextaddApplicationListener, addBeanFactoryPostProcessor, clearResourceCaches, close, containsBean, containsBeanDefinition, containsLocalBean, createEnvironment, destroyBeans, doClose, findAllAnnotationsOnBean, findAnnotationOnBean, findAnnotationOnBean, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getApplicationName, getApplicationStartup, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForAnnotation, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanProvider, getBeanProvider, getBeanProvider, getBeanProvider, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getEnvironment, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResourcePatternResolver, getResources, getStartupDate, getType, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, initPropertySources, invokeBeanFactoryPostProcessors, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, isTypeMatch, obtainFreshBeanFactory, onClose, onRefresh, postProcessBeanFactory, prepareBeanFactory, prepareRefresh, publishEvent, publishEvent, publishEvent, refresh, registerBeanPostProcessors, registerListeners, registerShutdownHook, removeApplicationListener, resetCommonCaches, setApplicationStartup, setDisplayName, setEnvironment, setParent, start, stop, toStringMethods inherited from class org.springframework.core.io.DefaultResourceLoaderaddProtocolResolver, getClassLoader, getProtocolResolvers, getResource, getResourceByPath, getResourceCache, setClassLoaderMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.context.ConfigurableApplicationContextaddProtocolResolver, setClassLoaderMethods inherited from interface org.springframework.core.io.ResourceLoadergetClassLoader, getResource
- 
Constructor Details- 
AbstractRefreshableConfigApplicationContextpublic AbstractRefreshableConfigApplicationContext()Create a new AbstractRefreshableConfigApplicationContext with no parent.
- 
AbstractRefreshableConfigApplicationContextCreate a new AbstractRefreshableConfigApplicationContext with the given parent context.- Parameters:
- parent- the parent context
 
 
- 
- 
Method Details- 
setConfigLocationSet the config locations for this application context in init-param style, i.e. with distinct locations separated by commas, semicolons or whitespace.If not set, the implementation may use a default as appropriate. 
- 
setConfigLocationsSet the config locations for this application context.If not set, the implementation may use a default as appropriate. 
- 
getConfigLocationsReturn an array of resource locations, referring to the XML bean definition files that this context should be built with. Can also include location patterns, which will get resolved via a ResourcePatternResolver.The default implementation returns null. Subclasses can override this to provide a set of resource locations to load bean definitions from.- Returns:
- an array of resource locations, or nullif none
- See Also:
 
- 
getDefaultConfigLocationsReturn the default config locations to use, for the case where no explicit config locations have been specified.The default implementation returns null, requiring explicit config locations.- Returns:
- an array of default config locations, if any
- See Also:
 
- 
resolvePathResolve the given path, replacing placeholders with corresponding environment property values if necessary. Applied to config locations.- Parameters:
- path- the original file path
- Returns:
- the resolved file path
- See Also:
 
- 
setIdDescription copied from class:AbstractApplicationContextSet the unique id of this application context.Default is the object id of the context instance, or the name of the context bean if the context is itself defined as a bean. - Specified by:
- setIdin interface- ConfigurableApplicationContext
- Overrides:
- setIdin class- AbstractApplicationContext
- Parameters:
- id- the unique id of the context
 
- 
setBeanNameSets the id of this context to the bean name by default, for cases where the context instance is itself defined as a bean.- Specified by:
- setBeanNamein interface- BeanNameAware
- Parameters:
- name- the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use the- BeanFactoryUtils.originalBeanName(String)method to extract the original bean name (without suffix), if desired.
 
- 
afterPropertiesSetpublic void afterPropertiesSet()TriggersAbstractApplicationContext.refresh()if not refreshed in the concrete context's constructor already.- Specified by:
- afterPropertiesSetin interface- InitializingBean
 
 
-