Package jetbrains.buildServer
Class PluginAwareSpringAccessor
- java.lang.Object
-
- jetbrains.buildServer.PluginAwareSpringAccessor
-
- All Implemented Interfaces:
EventListener
,PluginSpringContextListener
,SpringAccessor
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
public class PluginAwareSpringAccessor extends Object implements SpringAccessor, org.springframework.context.ApplicationContextAware, PluginSpringContextListener
-
-
Constructor Summary
Constructors Constructor Description PluginAwareSpringAccessor()
PluginAwareSpringAccessor(PluginManager manager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addOnClearCacheAction(Runnable runnable)
void
contextCreated(org.springframework.context.ApplicationContext applicationContext, PluginInfo plugin)
Called just after plugin context is created, but beforeConfigurableApplicationContext.refresh()
is called.void
contextFailedToLoad(org.springframework.context.ApplicationContext applicationContext, PluginInfo plugin, Throwable loadException)
May be called after plugin context is created andConfigurableApplicationContext.refresh()
is called if plugin spring context has failed to initialize.void
contextLoaded(org.springframework.context.ApplicationContext applicationContext, PluginInfo plugin)
Called just after plugin context is created andConfigurableApplicationContext.refresh()
is called.<T> Collection<T>
getSpringBeansOfType(Class<T> extensionClass, boolean autowireCandidatesOnly)
Returns spring beans of the specified type.void
registerBeanFactory(SpringAccessor accessor)
void
registerBeanFactory(SpringAccessor accessor, PluginInfo pluginInfo)
void
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
-
-
-
Constructor Detail
-
PluginAwareSpringAccessor
public PluginAwareSpringAccessor(PluginManager manager)
-
PluginAwareSpringAccessor
public PluginAwareSpringAccessor()
-
-
Method Detail
-
registerBeanFactory
public void registerBeanFactory(@NotNull SpringAccessor accessor)
-
registerBeanFactory
public void registerBeanFactory(@NotNull SpringAccessor accessor, @Nullable PluginInfo pluginInfo)
-
getSpringBeansOfType
@NotNull public <T> Collection<T> getSpringBeansOfType(@NotNull Class<T> extensionClass, boolean autowireCandidatesOnly)
Description copied from interface:SpringAccessor
Returns spring beans of the specified type.- Specified by:
getSpringBeansOfType
in interfaceSpringAccessor
- Type Parameters:
T
- see extensionClass- Parameters:
extensionClass
- the type of a bean to returnautowireCandidatesOnly
- if true then beans marked with autowire-candidate="false" are not returned- Returns:
- see above
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
- Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-
contextCreated
public void contextCreated(org.springframework.context.ApplicationContext applicationContext, PluginInfo plugin)
Description copied from interface:PluginSpringContextListener
Called just after plugin context is created, but beforeConfigurableApplicationContext.refresh()
is called.- Specified by:
contextCreated
in interfacePluginSpringContextListener
- Parameters:
applicationContext
- plugin's application contextplugin
- plugin descriptor
-
contextLoaded
public void contextLoaded(org.springframework.context.ApplicationContext applicationContext, PluginInfo plugin)
Description copied from interface:PluginSpringContextListener
Called just after plugin context is created andConfigurableApplicationContext.refresh()
is called. This method called afterPluginSpringContextListener.contextCreated(org.springframework.context.ApplicationContext, jetbrains.buildServer.plugins.bean.PluginInfo)
is called. This method may not be called is plugin context initialization exception is thrown.#contextFailedToLoad(org.springframework.context.ApplicationContext,jetbrains.buildServer.plugins.bean.PluginInfo, Exception)
will be called than.- Specified by:
contextLoaded
in interfacePluginSpringContextListener
- Parameters:
applicationContext
- plugin's application contextplugin
- plugin descriptor
-
contextFailedToLoad
public void contextFailedToLoad(org.springframework.context.ApplicationContext applicationContext, PluginInfo plugin, Throwable loadException)
Description copied from interface:PluginSpringContextListener
May be called after plugin context is created andConfigurableApplicationContext.refresh()
is called if plugin spring context has failed to initialize. This method called afterPluginSpringContextListener.contextCreated(org.springframework.context.ApplicationContext, jetbrains.buildServer.plugins.bean.PluginInfo)
is called. This method may not be called if plugin context has initialized successufully.PluginSpringContextListener.contextLoaded(org.springframework.context.ApplicationContext, jetbrains.buildServer.plugins.bean.PluginInfo)
method will be called than.- Specified by:
contextFailedToLoad
in interfacePluginSpringContextListener
- Parameters:
applicationContext
- plugin's application contextplugin
- plugin descriptor
-
addOnClearCacheAction
public void addOnClearCacheAction(Runnable runnable)
-
-