com.atlassian.plugin.util
Class PluginUtils

java.lang.Object
  extended by com.atlassian.plugin.util.PluginUtils

public class PluginUtils
extends Object

General plugin utility methods

Since:
2.1

Field Summary
static String ATLASSIAN_DEV_MODE
           
static 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
 
Constructor Summary
PluginUtils()
           
 
Method Summary
static boolean doesModuleElementApplyToApplication(org.dom4j.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATLASSIAN_DEV_MODE

public static final String ATLASSIAN_DEV_MODE
See Also:
Constant Field Values

ATLASSIAN_PLUGINS_ENABLE_WAIT

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

Since:
2.3.6
See Also:
Constant Field Values
Constructor Detail

PluginUtils

public PluginUtils()
Method Detail

doesPluginRequireRestart

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
Since:
2.1

getPluginModulesThatRequireRestart

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
Since:
2.5.0

doesModuleElementApplyToApplication

public static boolean doesModuleElementApplyToApplication(org.dom4j.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
Since:
2.2.0

getDefaultEnablingWaitPeriod

public static int getDefaultEnablingWaitPeriod()
Returns:
The default enabling waiting period in seconds
Since:
2.3.6


Copyright © 2011 Atlassian. All Rights Reserved.