public static interface DynamicContext.Installer
| Modifier and Type | Method and Description |
|---|---|
void |
closeAndUseContext(org.springframework.context.ConfigurableApplicationContext childContext,
org.springframework.context.ApplicationContext replacementContext)
This method can "close" a child application context (typically one created with
useContext(String[],
org.springframework.context.ApplicationContext) and set in the replacement application context instead. |
org.springframework.context.ConfigurableApplicationContext |
useContext(String[] springConfigPaths,
org.springframework.context.ApplicationContext parentContext)
This method will create and install a new child application context into the plugin.
|
org.springframework.context.ConfigurableApplicationContext useContext(String[] springConfigPaths, org.springframework.context.ApplicationContext parentContext)
As a side effect a PluginRefreshedEvent will be generated for this new
child context.
By calling this method you are able to have the plugin auto-wire components such as actions and web-items from the child context instead of the originating parent context. This will allow you to dynamically grow and shrink the components that your plugin gives off to the world based on external events such as licencing or memory passivisation.
springConfigPaths - the paths to find spring configuration files on the class pathparentContext - the parent context, typically the context that came with your pluginvoid closeAndUseContext(org.springframework.context.ConfigurableApplicationContext childContext,
org.springframework.context.ApplicationContext replacementContext)
useContext(String[],
org.springframework.context.ApplicationContext) and set in the replacement application context instead.
Typically the replacement would be the parent of the child context to be closed but it doesnt always have to be.childContext - the child context to close.replacementContext - the context to replace the child context with. Typically this can be its parentCopyright © 2019 Atlassian. All rights reserved.