com.atlassian.jira.plugin
Class JiraFailedPluginTracker

java.lang.Object
  extended by com.atlassian.jira.plugin.JiraFailedPluginTracker
All Implemented Interfaces:
com.atlassian.plugin.exception.PluginExceptionInterception

public class JiraFailedPluginTracker
extends Object
implements com.atlassian.plugin.exception.PluginExceptionInterception

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
static class JiraFailedPluginTracker.PluginInfo
          A simple holder class of plugin information
static class JiraFailedPluginTracker.ServiceDependency
          Represents a dependency that a plugin has to some other service
 
Constructor Summary
JiraFailedPluginTracker(com.atlassian.plugin.event.PluginEventManager pluginEventManager)
           
 
Method Summary
 Iterable<JiraFailedPluginTracker.PluginInfo> getFailedPlugins()
           
 Iterable<JiraFailedPluginTracker.PluginInfo> getUnaccountedForPlugins()
           
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JiraFailedPluginTracker

public JiraFailedPluginTracker(com.atlassian.plugin.event.PluginEventManager pluginEventManager)
Method Detail

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 resolved
pluginArtifact - 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

public boolean onEnableException(com.atlassian.plugin.Plugin plugin,
                                 Exception pluginException)
Specified by:
onEnableException in interface com.atlassian.plugin.exception.PluginExceptionInterception

getFailedPlugins

public Iterable<JiraFailedPluginTracker.PluginInfo> getFailedPlugins()
Returns:
the list if plugins that failed to load

getUnaccountedForPlugins

public Iterable<JiraFailedPluginTracker.PluginInfo> 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.


Copyright © 2002-2014 Atlassian. All Rights Reserved.