|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.core.io.DefaultResourceLoader
org.springframework.context.support.AbstractApplicationContext
org.springframework.context.support.AbstractRefreshableApplicationContext
org.eclipse.gemini.blueprint.context.support.AbstractOsgiBundleApplicationContext
org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext
org.eclipse.gemini.blueprint.context.support.OsgiBundleXmlApplicationContext
public class OsgiBundleXmlApplicationContext
Stand-alone XML application context, backed by an OSGi bundle.
The configuration location defaults can be overridden via getDefaultConfigLocations()
. Note that
locations can either denote concrete files like /myfiles/context.xml
or Ant-style patterns like
/myfiles/*-context.xml
(see the AntPathMatcher
javadoc for pattern
details).
Note: In case of multiple configuration locations, later bean definitions will override ones defined in earlier loaded files. This can be leveraged to deliberately override certain bean definitions via an extra XML file.
This is the main ApplicationContext class for OSGi environments.
Field Summary | |
---|---|
static String |
DEFAULT_CONFIG_LOCATION
Default config location for the root context(s) |
Fields inherited from class org.springframework.context.support.AbstractApplicationContext |
---|
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAME |
Fields inherited from interface org.eclipse.gemini.blueprint.context.ConfigurableOsgiBundleApplicationContext |
---|
APPLICATION_CONTEXT_SERVICE_PROPERTY_NAME, BUNDLE_BEAN_NAME, BUNDLE_CONTEXT_BEAN_NAME, SPRING_DM_APPLICATION_CONTEXT_SERVICE_PROPERTY_NAME |
Fields inherited from interface 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 |
Fields inherited from interface org.springframework.beans.factory.BeanFactory |
---|
FACTORY_BEAN_PREFIX |
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver |
---|
CLASSPATH_ALL_URL_PREFIX |
Fields inherited from interface org.springframework.core.io.ResourceLoader |
---|
CLASSPATH_URL_PREFIX |
Constructor Summary | |
---|---|
OsgiBundleXmlApplicationContext()
Creates a new OsgiBundleXmlApplicationContext with no parent. |
|
OsgiBundleXmlApplicationContext(org.springframework.context.ApplicationContext parent)
Creates a new OsgiBundleXmlApplicationContext with the given parent context. |
|
OsgiBundleXmlApplicationContext(String[] configLocations)
Creates a new OsgiBundleXmlApplicationContext with the given configLocations. |
|
OsgiBundleXmlApplicationContext(String[] configLocations,
org.springframework.context.ApplicationContext parent)
Creates a new OsgiBundleXmlApplicationContext with the given configLocations and parent context. |
Method Summary | |
---|---|
String[] |
getConfigLocations()
Returns this application context configuration locations. |
protected String[] |
getDefaultConfigLocations()
Provide default locations for XML files. |
protected void |
initBeanDefinitionReader(org.springframework.beans.factory.xml.XmlBeanDefinitionReader beanDefinitionReader)
Allows subclasses to do custom initialisation here. |
protected void |
loadBeanDefinitions(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory)
Loads the bean definitions via an XmlBeanDefinitionReader . |
protected void |
loadBeanDefinitions(org.springframework.beans.factory.xml.XmlBeanDefinitionReader reader)
Loads the bean definitions with the given XmlBeanDefinitionReader . |
Methods inherited from class org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext |
---|
completeRefresh, doClose, getDelegatedEventMulticaster, invokeBeanFactoryPostProcessors, normalClose, normalRefresh, refresh, registerBeanPostProcessors, registerBeanPostProcessors, setContextClassLoaderProvider, setDelegatedEventMulticaster, setDelegatedEventMulticaster, setExecutor, startRefresh |
Methods inherited from class org.eclipse.gemini.blueprint.context.support.AbstractOsgiBundleApplicationContext |
---|
createResourcePatternResolver, customizeApplicationContextServiceProperties, destroyBeans, finishRefresh, getBundle, getBundleContext, getClassLoader, getResource, getResourceByPath, getResourcePatternResolver, getResources, postProcessBeanFactory, prepareRefresh, setBundleContext, setClassLoader, setConfigLocations, setPublishContextAsService |
Methods inherited from class org.springframework.context.support.AbstractRefreshableApplicationContext |
---|
cancelRefresh, closeBeanFactory, createBeanFactory, customizeBeanFactory, getBeanFactory, hasBeanFactory, refreshBeanFactory, setAllowBeanDefinitionOverriding, setAllowCircularReferences |
Methods inherited from class org.springframework.context.support.AbstractApplicationContext |
---|
addApplicationListener, addBeanFactoryPostProcessor, addListener, close, containsBean, containsBeanDefinition, containsLocalBean, createEnvironment, destroy, findAnnotationOnBean, finishBeanFactoryInitialization, getAliases, getApplicationListeners, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getEnvironment, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getStartupDate, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, initPropertySources, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, obtainFreshBeanFactory, onClose, onRefresh, prepareBeanFactory, publishEvent, registerListeners, registerShutdownHook, setDisplayName, setEnvironment, setId, setParent, start, stop, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.gemini.blueprint.context.ConfigurableOsgiBundleApplicationContext |
---|
getBundle, getBundleContext, setBundleContext, setConfigLocations, setPublishContextAsService |
Methods inherited from interface org.springframework.context.ConfigurableApplicationContext |
---|
addApplicationListener, addBeanFactoryPostProcessor, close, getBeanFactory, getEnvironment, isActive, registerShutdownHook, setEnvironment, setId, setParent |
Methods inherited from interface org.springframework.context.ApplicationContext |
---|
getAutowireCapableBeanFactory, getDisplayName, getId, getParent, getStartupDate |
Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory |
---|
containsBeanDefinition, findAnnotationOnBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType, getBeansWithAnnotation |
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory |
---|
containsLocalBean, getParentBeanFactory |
Methods inherited from interface org.springframework.beans.factory.BeanFactory |
---|
containsBean, getAliases, getBean, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch |
Methods inherited from interface org.springframework.context.MessageSource |
---|
getMessage, getMessage, getMessage |
Methods inherited from interface org.springframework.context.ApplicationEventPublisher |
---|
publishEvent |
Methods inherited from interface org.springframework.core.io.support.ResourcePatternResolver |
---|
getResources |
Methods inherited from interface org.springframework.core.io.ResourceLoader |
---|
getClassLoader, getResource |
Methods inherited from interface org.springframework.context.Lifecycle |
---|
isRunning, start, stop |
Field Detail |
---|
public static final String DEFAULT_CONFIG_LOCATION
Constructor Detail |
---|
public OsgiBundleXmlApplicationContext()
OsgiBundleXmlApplicationContext
with no parent.
public OsgiBundleXmlApplicationContext(org.springframework.context.ApplicationContext parent)
OsgiBundleXmlApplicationContext
with the given parent context.
parent
- the parent contextpublic OsgiBundleXmlApplicationContext(String[] configLocations)
OsgiBundleXmlApplicationContext
with the given configLocations.
configLocations
- array of configuration resourcespublic OsgiBundleXmlApplicationContext(String[] configLocations, org.springframework.context.ApplicationContext parent)
OsgiBundleXmlApplicationContext
with the given configLocations and parent context.
configLocations
- array of configuration resourcesparent
- the parent contextMethod Detail |
---|
protected void loadBeanDefinitions(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory) throws IOException
XmlBeanDefinitionReader
.
loadBeanDefinitions
in class AbstractDelegatedExecutionApplicationContext
IOException
protected void initBeanDefinitionReader(org.springframework.beans.factory.xml.XmlBeanDefinitionReader beanDefinitionReader)
beanDefinitionReader
- protected void loadBeanDefinitions(org.springframework.beans.factory.xml.XmlBeanDefinitionReader reader) throws org.springframework.beans.BeansException, IOException
XmlBeanDefinitionReader
.
The lifecycle of the bean factory is handled by the refreshBeanFactory method; therefore this method is just supposed to load and/or register bean definitions.
Delegates to a ResourcePatternResolver for resolving location patterns into Resource instances.
org.springframework.beans.BeansException
- in case of bean registration errors
IOException
- if the required XML document isn't foundAbstractRefreshableApplicationContext.refreshBeanFactory()
,
getConfigLocations()
,
AbstractOsgiBundleApplicationContext.getResources(java.lang.String)
,
AbstractOsgiBundleApplicationContext.getResourcePatternResolver()
protected String[] getDefaultConfigLocations()
META-INF/spring/*.xml
relying
on the default resource environment for actual localisation. By default, the bundle space will be used for
locating the resources.
Note: Instead of overriding this method, consider using the Spring-DM specific header
inside your manifest bundle.
getDefaultConfigLocations
in class AbstractOsgiBundleApplicationContext
AbstractOsgiBundleApplicationContext.setConfigLocations(java.lang.String[])
public String[] getConfigLocations()
AbstractOsgiBundleApplicationContext
getConfigLocations
in class AbstractOsgiBundleApplicationContext
AbstractOsgiBundleApplicationContext.getDefaultConfigLocations()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |