Class PluginUtils

java.lang.Object
com.atlassian.plugin.internal.util.PluginUtils

public class PluginUtils extends Object
General plugin utility methods
Since:
2.1
  • Field Details

    • ATLASSIAN_DEV_MODE

      public static final String ATLASSIAN_DEV_MODE
      See Also:
    • 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:
    • DEFAULT_ATLASSIAN_PLUGINS_ENABLE_WAIT_SECONDS

      public static final String DEFAULT_ATLASSIAN_PLUGINS_ENABLE_WAIT_SECONDS
      The default number of seconds that a plugin should wait for its dependencies to become enabled. Currently 300s.
      Since:
      3.1.0
      See Also:
    • WEBRESOURCE_FILE_CACHE_SIZE

      public static final 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 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 Details

    • PluginUtils

      public PluginUtils()
  • Method Details

    • 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<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
    • isAtlassianDevMode

      public static boolean isAtlassianDevMode()