com.atlassian.plugin.util
Class PluginUtils

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

public class PluginUtils
extends java.lang.Object

General plugin utility methods

Since:
2.1

Field Summary
static java.lang.String ATLASSIAN_DEV_MODE
           
static java.lang.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.
static java.lang.String DEFAULT_ATLASSIAN_PLUGINS_ENABLE_WAIT_SECONDS
          The default number of seconds that a plugin should wait for its dependencies to become enabled.
static java.lang.String WEBRESOURCE_DISABLE_FILE_CACHE
          Used to disable the file cache should that be desired.
static java.lang.String WEBRESOURCE_FILE_CACHE_SIZE
          Used to customise the size of the LRU cache for batch web resources.
 
Constructor Summary
PluginUtils()
           
 
Method Summary
static boolean doesModuleElementApplyToApplication(org.dom4j.Element element, java.util.Set<Application> applications, InstallationMode installationMode)
          Determines if a module element applies to the current application by matching the 'application' attribute to the set of applications.
static boolean doesPluginRequireRestart(Plugin plugin)
          Determines if a plugin requires a restart after being installed at runtime.
static int getDefaultEnablingWaitPeriod()
           
static java.util.Set<java.lang.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 java.lang.String ATLASSIAN_DEV_MODE
See Also:
Constant Field Values

ATLASSIAN_PLUGINS_ENABLE_WAIT

public static final java.lang.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:
DEFAULT_ATLASSIAN_PLUGINS_ENABLE_WAIT_SECONDS, Constant Field Values

DEFAULT_ATLASSIAN_PLUGINS_ENABLE_WAIT_SECONDS

public static final java.lang.String DEFAULT_ATLASSIAN_PLUGINS_ENABLE_WAIT_SECONDS
The default number of seconds that a plugin should wait for its dependencies to become enabled. Currently 60s.

Since:
3.1.0
See Also:
ATLASSIAN_PLUGINS_ENABLE_WAIT, Constant Field Values

WEBRESOURCE_FILE_CACHE_SIZE

public static final java.lang.String WEBRESOURCE_FILE_CACHE_SIZE
Used to customise the size of the LRU cache for batch web resources. This effectively controls how many files will be created by the file cache. Providing a negative number results in undefined behaviour.

Since:
2.13.0

WEBRESOURCE_DISABLE_FILE_CACHE

public static final java.lang.String WEBRESOURCE_DISABLE_FILE_CACHE
Used to disable the file cache should that be desired. Setting this value to true will disable the file caching completely for all places it is used.

Since:
2.13.0
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 java.util.Set<java.lang.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,
                                                          java.util.Set<Application> applications,
                                                          InstallationMode installationMode)
Determines if a module element applies to the current application by matching the 'application' attribute to the set of applications. If the application is specified, but isn't in the set, we return false

Parameters:
element - The module element
applications - The set of application applications
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 © 2013 Atlassian. All Rights Reserved.