public class

PluginUtils

extends Object
java.lang.Object
   ↳ com.atlassian.plugin.util.PluginUtils

Class Overview

General plugin utility methods

Summary

Constants
String ATLASSIAN_DEV_MODE
String ATLASSIAN_PLUGINS_ENABLE_WAIT System property for storing and retrieving the time the plugin system will wait for the enabling of a plugin in seconds
Public Constructors
PluginUtils()
Public Methods
static boolean doesModuleElementApplyToApplication(Element element, Set<String> keys)
Determines if a module element applies to the current application by matching the 'application' attribute to the set of keys.
static boolean doesPluginRequireRestart(Plugin plugin)
Determines if a plugin requires a restart after being installed at runtime.
static int getDefaultEnablingWaitPeriod()
static Set<String> getPluginModulesThatRequireRestart(Plugin plugin)
Gets a list of all the module keys in a plugin that require restart.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String ATLASSIAN_DEV_MODE

Constant Value: "atlassian.dev.mode"

public static final String ATLASSIAN_PLUGINS_ENABLE_WAIT

System property for storing and retrieving the time the plugin system will wait for the enabling of a plugin in seconds

Constant Value: "atlassian.plugins.enable.wait"

Public Constructors

public PluginUtils ()

Public Methods

public static boolean doesModuleElementApplyToApplication (Element element, Set<String> keys)

Determines if a module element applies to the current application by matching the 'application' attribute to the set of keys. If the application is specified, but isn't in the set, we return false

Parameters
element The module element
keys The set of application keys
Returns
  • True if it should apply, false otherwise

public static boolean doesPluginRequireRestart (Plugin plugin)

Determines if a plugin requires a restart after being installed at runtime. Looks for the annotation RequiresRestart on the plugin's module descriptors.

Parameters
plugin The plugin that was just installed at runtime, but not yet enabled
Returns
  • True if a restart is required

public static int getDefaultEnablingWaitPeriod ()

Returns
  • The default enabling waiting period in seconds

public static Set<String> getPluginModulesThatRequireRestart (Plugin plugin)

Gets a list of all the module keys in a plugin that require restart. Looks for the annotation RequiresRestart on the plugin's module descriptors.

Parameters
plugin The plugin
Returns
  • A unique set of module keys