Package com.atlassian.jira.plugin
Class JiraFailedPluginTracker
java.lang.Object
com.atlassian.jira.plugin.JiraFailedPluginTracker
- All Implemented Interfaces:
InitializingComponent
,com.atlassian.plugin.exception.PluginExceptionInterception
public class JiraFailedPluginTracker
extends Object
implements com.atlassian.plugin.exception.PluginExceptionInterception, InitializingComponent
Plugins form a big part of what Atlassian software does. However we don't do a good job in trying to know what
plugins are loaded and importantly which ones have failed to load.
This class is used to track what plugins are expected to be loaded, what did load as expected and what failed to load.
- Since:
- v6.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A simple holder class of plugin informationstatic class
Represents a dependency that a plugin has to some other service -
Constructor Summary
ConstructorsConstructorDescriptionJiraFailedPluginTracker
(com.atlassian.plugin.event.PluginEventManager pluginEventManager) -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
onEnableException
(com.atlassian.plugin.Plugin plugin, Exception pluginException) void
onPluginContainerFailed
(com.atlassian.plugin.event.events.PluginContainerFailedEvent event) Called when the plugin container for the bundle has failed to be created.void
onPluginDisabledEvent
(com.atlassian.plugin.event.events.PluginDisabledEvent disabledEvent) void
onPluginEnabledEvent
(com.atlassian.plugin.event.events.PluginEnabledEvent enabledEvent) void
onServiceDependencyWaitEnded
(com.atlassian.plugin.osgi.event.PluginServiceDependencyWaitEndedEvent event) void
onServiceDependencyWaitStarting
(com.atlassian.plugin.osgi.event.PluginServiceDependencyWaitStartingEvent event) void
trackLoadingPlugin
(com.atlassian.plugin.Plugin plugin, com.atlassian.plugin.PluginArtifact pluginArtifact) This is called then the PluginFactory has decided it can create a plugin BUT it hasn't started it and hence resolved its dependencies
-
Constructor Details
-
JiraFailedPluginTracker
public JiraFailedPluginTracker(com.atlassian.plugin.event.PluginEventManager pluginEventManager)
-
-
Method Details
-
afterInstantiation
- Specified by:
afterInstantiation
in interfaceInitializingComponent
- Throws:
Exception
-
trackLoadingPlugin
public void trackLoadingPlugin(com.atlassian.plugin.Plugin plugin, com.atlassian.plugin.PluginArtifact pluginArtifact) This is called then the PluginFactory has decided it can create a plugin BUT it hasn't started it and hence resolved its dependencies- Parameters:
plugin
- the plugin that has been created by the PluginFactory but not resolvedpluginArtifact
- the artifact used to load this plugin
-
onPluginEnabledEvent
public void onPluginEnabledEvent(com.atlassian.plugin.event.events.PluginEnabledEvent enabledEvent) -
onPluginDisabledEvent
public void onPluginDisabledEvent(com.atlassian.plugin.event.events.PluginDisabledEvent disabledEvent) -
onServiceDependencyWaitStarting
public void onServiceDependencyWaitStarting(com.atlassian.plugin.osgi.event.PluginServiceDependencyWaitStartingEvent event) -
onServiceDependencyWaitEnded
public void onServiceDependencyWaitEnded(com.atlassian.plugin.osgi.event.PluginServiceDependencyWaitEndedEvent event) -
onPluginContainerFailed
public void onPluginContainerFailed(com.atlassian.plugin.event.events.PluginContainerFailedEvent event) throws com.atlassian.plugin.IllegalPluginStateException Called when the plugin container for the bundle has failed to be created. This means the bundle is still active, but the plugin container is not available, so for our purposes, the plugin shouldn't be enabled.- Parameters:
event
- The plugin container failed event- Throws:
com.atlassian.plugin.IllegalPluginStateException
- If the plugin key hasn't been set yet
-
onEnableException
- Specified by:
onEnableException
in interfacecom.atlassian.plugin.exception.PluginExceptionInterception
-
getFailedPlugins
- Returns:
- the list if plugins that failed to load
-
getUnaccountedForPlugins
- Returns:
- the list of plugins that loaded as plugin artifacts but never resolved into actual failed or loaded plugins. This list REALLY should be empty once the plugin system has started and the the plugins have been otherwise we have a serious problem.
-