Class PluginClusterAwareEventListener


  • @Internal
    public class PluginClusterAwareEventListener
    extends Object
    Stateful service that handles plugin events in a cluster environment.

    It starts disabled by default and enable() can be used to start handling plugin events.

    Since:
    9.5
    • Constructor Summary

      Constructors 
      Constructor Description
      PluginClusterAwareEventListener​(@NotNull com.atlassian.plugin.event.PluginEventManager pluginEventManager)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void onPluginDisabled​(com.atlassian.plugin.event.events.PluginDisabledEvent event)
      Monitors plugin disabling and ask other nodes to disable the same plugin, making sure all nodes have the same capabilities enabled.
      void onPluginEnabled​(com.atlassian.plugin.event.events.PluginEnabledEvent event)
      Monitors plugin enabling and ask other nodes to enable the same plugin, making sure all nodes have the same capabilities enabled.
      void onPluginInstalled​(com.atlassian.plugin.event.events.PluginInstalledEvent event)
      Monitors plugin installation and ask other nodes to install the same plugin, making sure all nodes have the same capabilities enabled.
      void onPluginUninstalled​(com.atlassian.plugin.event.events.PluginUninstalledEvent event)
      Monitors plugin removal and ask other nodes to uninstall the same plugin, making sure all nodes have the same capabilities enabled.
      void onPluginUpgraded​(com.atlassian.plugin.event.events.PluginUpgradedEvent event)
      Monitors plugin upgrading and ask other nodes to upgrade the same plugin, making sure all nodes have the same capabilities enabled.
      void postConstruct()  
      void runWithoutEventListening​(@NotNull Runnable runnable)
      Immediately executes some logic with NO plugin event handling.
    • Constructor Detail

      • PluginClusterAwareEventListener

        @Inject
        public PluginClusterAwareEventListener​(@NotNull
                                               @NotNull com.atlassian.plugin.event.PluginEventManager pluginEventManager)
        Constructor
        Parameters:
        pluginEventManager - used to register the new instance as a listener to plugin events
        Since:
        9.5
    • Method Detail

      • postConstruct

        @PostConstruct
        public void postConstruct()
      • onPluginInstalled

        public void onPluginInstalled​(com.atlassian.plugin.event.events.PluginInstalledEvent event)
        Monitors plugin installation and ask other nodes to install the same plugin, making sure all nodes have the same capabilities enabled.
        Parameters:
        event - the event
        Since:
        9.5
      • onPluginUninstalled

        public void onPluginUninstalled​(com.atlassian.plugin.event.events.PluginUninstalledEvent event)
        Monitors plugin removal and ask other nodes to uninstall the same plugin, making sure all nodes have the same capabilities enabled.
        Parameters:
        event - the event
        Since:
        9.5
      • onPluginEnabled

        public void onPluginEnabled​(com.atlassian.plugin.event.events.PluginEnabledEvent event)
        Monitors plugin enabling and ask other nodes to enable the same plugin, making sure all nodes have the same capabilities enabled.
        Parameters:
        event - the event
        Since:
        9.5
      • onPluginDisabled

        public void onPluginDisabled​(com.atlassian.plugin.event.events.PluginDisabledEvent event)
        Monitors plugin disabling and ask other nodes to disable the same plugin, making sure all nodes have the same capabilities enabled.
        Parameters:
        event - the event
        Since:
        9.5
      • onPluginUpgraded

        public void onPluginUpgraded​(com.atlassian.plugin.event.events.PluginUpgradedEvent event)
        Monitors plugin upgrading and ask other nodes to upgrade the same plugin, making sure all nodes have the same capabilities enabled.
        Parameters:
        event - the event
        Since:
        9.5
      • runWithoutEventListening

        public void runWithoutEventListening​(@NotNull
                                             @NotNull Runnable runnable)
        Immediately executes some logic with NO plugin event handling. All plugin events originating from the other nodes are handled through this method, so the 'synchronized' is crucial here.
        Parameters:
        runnable - the logic to be executed.