Documentation for Confluence 2.5.4 - 2.5.8.
Documentation for [Confluence Cloud] and the latest Confluence Server is available too.

説明

The StateAware interface can be implemented by plugin modules which need to know when they are enabled or disabled.

実装

To be notified of enablement/disablement, implement the following in your Macro Plugins, Event Listener Plugins or Component Plugins:

public class YourMacro extends BaseMacro implements com.atlassian.plugin.StateAware

This has two methods you must implement:

public void enabled()
{
    // Your enablement code goes here.
}

public void disabled()
{
    // Your disablement code goes here.
}

Call Sequence

These methods are called in the following circumstances:

enabled()

  1. At server startup, if the plugin is already installed and enabled.
  2. If the plugin is installed via uploading
  3. If the plugin is enabled after having been disabled.
  4. If the specific module is enabled after having been disabled.

disabled()

  1. At server shutdown, if the plugin is installed and enabled.
  2. If the plugin is uninstalled.
  3. If the plugin is disabled.
  4. If the specific module is disabled.

注意

Each method is only called once at each logical enablement/disablement event. Please note that the module class's constructor is not a reliable place to put initialisation code either, as the classes are often constructed or destructed more often than they are disabled/enabled. However, once enabled, the same class will remain in memory until it is disabled.

既知の問題

Supported Module Types

Not all module types have been tested, but the following have the following status:

Module Type

Confluence バージョン

Working

Macro Plugins

2.3.3

(tick)

Component Plugins

2.3.3

(tick)

Event Listener Plugins

2.3.3

(tick)

Lifecycle Plugins

2.3.3

(error)

  • ラベルなし