|
||||||||||
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.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext
public abstract class AbstractDelegatedExecutionApplicationContext
OSGi-specific application context that delegates the execution of its life cycle methods to a different class. The main reason behind this is to break the startup of the application context in steps that can be executed asynchronously.
Therefresh()
and AbstractApplicationContext.close()
methods delegate their execution to an
OsgiBundleApplicationContextExecutor
class that chooses how to call the lifecycle methods. One
can still call the 'traditional' lifecycle methods through normalRefresh()
and normalClose()
.
DelegatedExecutionOsgiBundleApplicationContext
Field Summary |
---|
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.springframework.osgi.context.ConfigurableOsgiBundleApplicationContext |
---|
APPLICATION_CONTEXT_SERVICE_PROPERTY_NAME, BUNDLE_BEAN_NAME, BUNDLE_CONTEXT_BEAN_NAME |
Fields inherited from interface org.springframework.context.ConfigurableApplicationContext |
---|
CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_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 | |
---|---|
AbstractDelegatedExecutionApplicationContext()
Constructs a new AbstractDelegatedExecutionApplicationContext instance. |
|
AbstractDelegatedExecutionApplicationContext(ApplicationContext parent)
Constructs a new AbstractDelegatedExecutionApplicationContext instance. |
Method Summary | |
---|---|
void |
completeRefresh()
The second, last phase of the refresh. |
protected void |
doClose()
Unregister the ApplicationContext OSGi service (in case there is any). |
OsgiBundleApplicationContextEventMulticaster |
getDelegatedEventMulticaster()
Returns the OSGi event multicaster (if any) associated with this application context. |
protected void |
invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory beanFactory)
|
protected void |
loadBeanDefinitions(DefaultListableBeanFactory beanFactory)
|
void |
normalClose()
Non-delegated close operation (execute ConfigurableApplicationContext.close() in the
traditional way). |
void |
normalRefresh()
Non-delegated refresh operation (execute ConfigurableApplicationContext.refresh() in the
traditional way). |
void |
refresh()
Delegate execution of refresh method to a third party. |
protected void |
registerBeanPostProcessors(ConfigurableListableBeanFactory beanFactory)
|
protected void |
registerBeanPostProcessors(ConfigurableListableBeanFactory beanFactory,
Class<?> type,
Class<?> exclude,
boolean check)
Instantiate and invoke all registered BeanPostProcessor beans, respecting explicit order if given. |
void |
setContextClassLoaderProvider(ContextClassLoaderProvider contextClassLoaderProvider)
Sets the ContextClassLoaderProvider used by this OSGi application context instance. |
void |
setDelegatedEventMulticaster(ApplicationEventMulticaster multicaster)
Sets the OSGi multicaster by using a Spring ApplicationEventMulticaster . |
void |
setDelegatedEventMulticaster(OsgiBundleApplicationContextEventMulticaster multicaster)
Allows a delegated OsgiBundleApplicationContextEventMulticaster ,
external to the application context, to be used for sending OSGi
application context events regarding the application context life cycle. |
void |
setExecutor(OsgiBundleApplicationContextExecutor executor)
Assigns the OsgiBundleApplicationContextExecutor for this
delegated context. |
void |
startRefresh()
First phase of the refresh. |
Methods inherited from class org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext |
---|
createResourcePatternResolver, customizeApplicationContextServiceProperties, destroyBeans, finishRefresh, getBundle, getBundleContext, getClassLoader, getConfigLocations, getDefaultConfigLocations, 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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.springframework.osgi.context.ConfigurableOsgiBundleApplicationContext |
---|
getBundle, getBundleContext, setBundleContext, setConfigLocations, setPublishContextAsService |
Methods inherited from interface org.springframework.context.ConfigurableApplicationContext |
---|
addApplicationListener, addBeanFactoryPostProcessor, close, getBeanFactory, isActive, registerShutdownHook, 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 |
Constructor Detail |
---|
public AbstractDelegatedExecutionApplicationContext()
AbstractDelegatedExecutionApplicationContext
instance.
public AbstractDelegatedExecutionApplicationContext(ApplicationContext parent)
AbstractDelegatedExecutionApplicationContext
instance.
parent
- parent application contextMethod Detail |
---|
public void refresh() throws BeansException, IllegalStateException
refresh
in interface ConfigurableApplicationContext
refresh
in class AbstractApplicationContext
BeansException
IllegalStateException
public void normalRefresh()
DelegatedExecutionOsgiBundleApplicationContext
ConfigurableApplicationContext.refresh()
in the
traditional way).
normalRefresh
in interface DelegatedExecutionOsgiBundleApplicationContext
ConfigurableApplicationContext.refresh()
public void normalClose()
DelegatedExecutionOsgiBundleApplicationContext
ConfigurableApplicationContext.close()
in the
traditional way).
normalClose
in interface DelegatedExecutionOsgiBundleApplicationContext
ConfigurableApplicationContext.close()
protected void doClose()
AbstractOsgiBundleApplicationContext
doClose
in class AbstractOsgiBundleApplicationContext
public void startRefresh()
DelegatedExecutionOsgiBundleApplicationContext
beanFactory
but does not instantiates any beans.
startRefresh
in interface DelegatedExecutionOsgiBundleApplicationContext
public void completeRefresh()
DelegatedExecutionOsgiBundleApplicationContext
refresh
operation. Normally, this operations performs
most of the refresh work
, such as instantiating
singletons.
completeRefresh
in interface DelegatedExecutionOsgiBundleApplicationContext
protected void invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory beanFactory)
invokeBeanFactoryPostProcessors
in class AbstractApplicationContext
protected void registerBeanPostProcessors(ConfigurableListableBeanFactory beanFactory)
registerBeanPostProcessors
in class AbstractApplicationContext
protected void registerBeanPostProcessors(ConfigurableListableBeanFactory beanFactory, Class<?> type, Class<?> exclude, boolean check)
AbstractApplicationContext.invokeBeanFactoryPostProcessors(org.springframework.beans.factory.config.ConfigurableListableBeanFactory)
but allowing exclusion of a certain type.
public void setExecutor(OsgiBundleApplicationContextExecutor executor)
DelegatedExecutionOsgiBundleApplicationContext
OsgiBundleApplicationContextExecutor
for this
delegated context.
setExecutor
in interface DelegatedExecutionOsgiBundleApplicationContext
executor
- the executor of this application context, to which the
refresh
method is delegated toprotected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) throws IOException, BeansException
loadBeanDefinitions
in class AbstractRefreshableApplicationContext
IOException
BeansException
public void setDelegatedEventMulticaster(OsgiBundleApplicationContextEventMulticaster multicaster)
DelegatedExecutionOsgiBundleApplicationContext
OsgiBundleApplicationContextEventMulticaster
,
external to the application context, to be used for sending OSGi
application context events regarding the application context life cycle.
This method is mainly intended for monitoring the context lifecycle by
third parties (such as the OSGi extender). It's up to the implementation
to decide whether this setter method is required or not.
setDelegatedEventMulticaster
in interface DelegatedExecutionOsgiBundleApplicationContext
multicaster
- the application multicaster used for sending events
triggered by the delegated execution.OsgiBundleApplicationContextEvent
public void setDelegatedEventMulticaster(ApplicationEventMulticaster multicaster)
ApplicationEventMulticaster
. This method is added as a
covenience.
multicaster
- Spring multi-caster used for propagating OSGi specific eventsOsgiBundleApplicationContextEventMulticasterAdapter
public OsgiBundleApplicationContextEventMulticaster getDelegatedEventMulticaster()
DelegatedExecutionOsgiBundleApplicationContext
getDelegatedEventMulticaster
in interface DelegatedExecutionOsgiBundleApplicationContext
public void setContextClassLoaderProvider(ContextClassLoaderProvider contextClassLoaderProvider)
ContextClassLoaderProvider
used by this OSGi application context instance. By default,
DefaultContextClassLoaderProvider
is used.
contextClassLoaderProvider
- context class loader provider to useContextClassLoaderProvider
,
DefaultContextClassLoaderProvider
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |