Package jetbrains.buildServer.plugins
Interface PluginManager
-
- All Superinterfaces:
PluginClassesLoader
,PluginInfoLoader
- All Known Implementing Classes:
MockPluginManager
,PluginManagerImpl
public interface PluginManager extends PluginInfoLoader, PluginClassesLoader
Main service to locate, load, register plugins in TeamCity- Since:
- 4.5
- Author:
- Eugene Petrenko
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Collection<PluginInfo>
getDetectedPlugins()
Enumerates all loaded plugins.Collection<NotLoadedPlugin>
getNotLoadedPlugins()
Enumerates plugins that were not loaded.EventDispatcher<PluginManagerListener>
getPluginLifecycleEventDispatcher()
void
loadPlugin(PluginInfo pluginInfo)
Tries to load a plugin in runtimevoid
loadPlugins()
Scan plugins folders for plugins.void
loadPlugins(Collection<PluginInfo> pluginsToLoad)
load specified collection of plugins.void
loadPlugins(Collection<PluginInfo> pluginsToLoad, Function<LoadPluginException,Boolean> shouldStop)
The same asloadPlugins(Collection)
but allows to stop loading plugins if exception occursList<PluginInfo>
unloadPlugin(PluginInfo pluginInfo)
Tries to unload a plugin in runtime.-
Methods inherited from interface jetbrains.buildServer.plugins.PluginClassesLoader
addPluginClassesLoadedListener
-
Methods inherited from interface jetbrains.buildServer.plugins.PluginInfoLoader
addPluginInfoLoadedListener
-
-
-
-
Method Detail
-
getPluginLifecycleEventDispatcher
EventDispatcher<PluginManagerListener> getPluginLifecycleEventDispatcher()
- Returns:
- PluginLifecycleListener events dispatcher. Could not exist in the spring context.
-
loadPlugin
void loadPlugin(@NotNull PluginInfo pluginInfo) throws LoadPluginException
Tries to load a plugin in runtime- Parameters:
pluginInfo
-- Throws:
LoadPluginException
- if load is impossible (plugin is not reloadable) or exception occurred during loadAlreadyLoadedPluginException
- if the plugin is already loaded- Since:
- 2018.2
-
unloadPlugin
List<PluginInfo> unloadPlugin(@NotNull PluginInfo pluginInfo) throws UnloadPluginException
Tries to unload a plugin in runtime. Also unloads dependent plugins if any- Parameters:
pluginInfo
- plugin to be unloaded- Returns:
- list of unloaded plugins (including dependent on current). The list is topo-sorted (dependent plugins placed before dependency in the list)
- Throws:
UnloadPluginException
- if unload is impossible (plugin is not reloadable) or exception occurred during unloadPluginNotLoadedException
- if the plugin is not loaded- Since:
- 2018.2
-
loadPlugins
void loadPlugins()
Scan plugins folders for plugins. Plugin is detected by registeredPluginFileSystemLookup
implementations. If plugin with same name is found again, it will override the first occurrence of the plugin. Warning message will be shown no that case. Plugins with names specified in .BuildServer/config/disabled_plugins.txt are treated as disabled and ignored- Parameters:
paths
- filesystem paths to scan plugins
-
loadPlugins
void loadPlugins(Collection<PluginInfo> pluginsToLoad)
load specified collection of plugins. The same as invocationloadPlugin(PluginInfo)
for each plugin in topological order.- Since:
- 2021.1.1
-
loadPlugins
void loadPlugins(Collection<PluginInfo> pluginsToLoad, Function<LoadPluginException,Boolean> shouldStop)
The same asloadPlugins(Collection)
but allows to stop loading plugins if exception occurs- Since:
- 2023.05
-
getDetectedPlugins
@NotNull Collection<PluginInfo> getDetectedPlugins()
Enumerates all loaded plugins. This function may return empty collection if called while plugins are loading.- Returns:
- collection of loaded plugin infos
- Since:
- 5.1
-
getNotLoadedPlugins
@NotNull Collection<NotLoadedPlugin> getNotLoadedPlugins()
Enumerates plugins that were not loaded. This function may return empty collection if called while plugins are loading.- Since:
- 2017.2
-
-