类 AbstractRefreshableConfigApplicationContext
- java.lang.Object
- org.springframework.core.io.DefaultResourceLoader
- org.springframework.context.support.AbstractApplicationContext
- org.springframework.context.support.AbstractRefreshableApplicationContext
- org.springframework.context.support.AbstractRefreshableConfigApplicationContext
- 所有已实现的接口:
Closeable
,AutoCloseable
,Aware
,BeanFactory
,BeanNameAware
,DisposableBean
,HierarchicalBeanFactory
,InitializingBean
,ListableBeanFactory
,ApplicationContext
,ApplicationEventPublisher
,ConfigurableApplicationContext
,Lifecycle
,MessageSource
,EnvironmentCapable
,ResourceLoader
,ResourcePatternResolver
- 直接已知子类:
AbstractRefreshablePortletApplicationContext
,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 asClassPathXmlApplicationContext
andFileSystemXmlApplicationContext
, as well asXmlWebApplicationContext
andXmlPortletApplicationContext
.- 从以下版本开始:
- 2.5.2
- 作者:
- Juergen Hoeller
- 另请参阅:
setConfigLocation(java.lang.String)
,setConfigLocations(java.lang.String...)
,getDefaultConfigLocations()
嵌套类概要
从类继承的嵌套类/接口 org.springframework.core.io.DefaultResourceLoader
DefaultResourceLoader.ClassPathContextResource
字段概要
从类继承的字段 org.springframework.context.support.AbstractApplicationContext
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAME
从接口继承的字段 org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
从接口继承的字段 org.springframework.context.ConfigurableApplicationContext
CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, ENVIRONMENT_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME
从接口继承的字段 org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
从接口继承的字段 org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
构造器概要
构造器 构造器 说明 AbstractRefreshableConfigApplicationContext()
Create a new AbstractRefreshableConfigApplicationContext with no parent.AbstractRefreshableConfigApplicationContext(ApplicationContext parent)
Create a new AbstractRefreshableConfigApplicationContext with the given parent context.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
afterPropertiesSet()
TriggersAbstractApplicationContext.refresh()
if not refreshed in the concrete context's constructor already.protected String[]
getConfigLocations()
Return an array of resource locations, referring to the XML bean definition files that this context should be built with.protected String[]
getDefaultConfigLocations()
Return the default config locations to use, for the case where no explicit config locations have been specified.protected String
resolvePath(String path)
Resolve the given path, replacing placeholders with corresponding environment property values if necessary.void
setBeanName(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.void
setConfigLocation(String location)
Set the config locations for this application context in init-param style, i.e. with distinct locations separated by commas, semicolons or whitespace.void
setConfigLocations(String... locations)
Set the config locations for this application context.void
setId(String id)
Set the unique id of this application context.从类继承的方法 org.springframework.context.support.AbstractRefreshableApplicationContext
assertBeanFactoryActive, cancelRefresh, closeBeanFactory, createBeanFactory, customizeBeanFactory, getBeanFactory, hasBeanFactory, loadBeanDefinitions, refreshBeanFactory, setAllowBeanDefinitionOverriding, setAllowCircularReferences
从类继承的方法 org.springframework.context.support.AbstractApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, close, containsBean, containsBeanDefinition, containsLocalBean, createEnvironment, destroy, destroyBeans, doClose, findAnnotationOnBean, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getApplicationName, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForAnnotation, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getEnvironment, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResourcePatternResolver, getResources, getStartupDate, 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, resetCommonCaches, setDisplayName, setEnvironment, setParent, start, stop, toString
从类继承的方法 org.springframework.core.io.DefaultResourceLoader
addProtocolResolver, getClassLoader, getProtocolResolvers, getResource, getResourceByPath, setClassLoader
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
从接口继承的方法 org.springframework.context.ConfigurableApplicationContext
addProtocolResolver
从接口继承的方法 org.springframework.core.io.ResourceLoader
getClassLoader, getResource
构造器详细资料
AbstractRefreshableConfigApplicationContext
public AbstractRefreshableConfigApplicationContext()
Create a new AbstractRefreshableConfigApplicationContext with no parent.
AbstractRefreshableConfigApplicationContext
public AbstractRefreshableConfigApplicationContext(ApplicationContext parent)
Create a new AbstractRefreshableConfigApplicationContext with the given parent context.- 参数:
parent
- the parent context
方法详细资料
setConfigLocation
public void setConfigLocation(String location)
Set 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.
setConfigLocations
public void setConfigLocations(String... locations)
Set the config locations for this application context.If not set, the implementation may use a default as appropriate.
getConfigLocations
protected String[] getConfigLocations()
Return 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.- 返回:
- an array of resource locations, or
null
if none - 另请参阅:
AbstractApplicationContext.getResources(java.lang.String)
,AbstractApplicationContext.getResourcePatternResolver()
getDefaultConfigLocations
protected String[] getDefaultConfigLocations()
Return 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.- 返回:
- an array of default config locations, if any
- 另请参阅:
setConfigLocations(java.lang.String...)
resolvePath
protected String resolvePath(String path)
Resolve the given path, replacing placeholders with corresponding environment property values if necessary. Applied to config locations.- 参数:
path
- the original file path- 返回:
- the resolved file path
- 另请参阅:
PropertyResolver.resolveRequiredPlaceholders(String)
setId
public void setId(String id)
从类复制的说明:AbstractApplicationContext
Set 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.
- 指定者:
setId
在接口中ConfigurableApplicationContext
- 覆盖:
setId
在类中AbstractApplicationContext
- 参数:
id
- the unique id of the context
setBeanName
public void setBeanName(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.- 指定者:
setBeanName
在接口中BeanNameAware
- 参数:
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 theBeanFactoryUtils.originalBeanName(String)
method to extract the original bean name (without suffix), if desired.
afterPropertiesSet
public void afterPropertiesSet()
TriggersAbstractApplicationContext.refresh()
if not refreshed in the concrete context's constructor already.- 指定者:
afterPropertiesSet
在接口中InitializingBean