Class WebResourceBatchingStateCounterImpl

java.lang.Object
com.atlassian.plugin.webresource.WebResourceBatchingStateCounterImpl
All Implemented Interfaces:
WebResourceBatchingStateCounter

public class WebResourceBatchingStateCounterImpl extends Object implements WebResourceBatchingStateCounter
A ready-to-use implementation of batching state counter. Ready to be plugged into WebResourceIntegration.
Since:
2.11.0
  • Constructor Details

    • WebResourceBatchingStateCounterImpl

      public WebResourceBatchingStateCounterImpl(com.atlassian.plugin.event.PluginEventManager pluginEventManager)
  • Method Details

    • close

      public void close()
      Closes the instance.
    • onPluginFrameworkStarted

      public void onPluginFrameworkStarted(com.atlassian.plugin.event.events.PluginFrameworkStartedEvent event)
    • onPluginFrameworkPluginFrameworkShutdown

      public void onPluginFrameworkPluginFrameworkShutdown(com.atlassian.plugin.event.events.PluginFrameworkShutdownEvent event)
    • onPluginModuleEnabled

      public void onPluginModuleEnabled(com.atlassian.plugin.event.events.PluginModuleEnabledEvent event)
    • onPluginModuleDisabled

      public void onPluginModuleDisabled(com.atlassian.plugin.event.events.PluginModuleDisabledEvent event)
    • getBatchingStateCounter

      public long getBatchingStateCounter()
      Description copied from interface: WebResourceBatchingStateCounter
      Gets batching state counter. This counter increments every time there is a state change in any plugin inside the plugin framework such as a plugin being disabled or a new plugin being installed. This counter thus can be used to determine the validity of the current batch resources since a disabling/ enabling/upgrade of a plugin can result in relevant resources being updated or inserted into the batch.
      Specified by:
      getBatchingStateCounter in interface WebResourceBatchingStateCounter
      Returns:
      batching state counter
    • incrementCounter

      public void incrementCounter()
      Description copied from interface: WebResourceBatchingStateCounter
      Increment of the counter. This is often useful when there is a need to flush the batch resources explicitly as it is known that the current batch resources will be no longer relevant and that the plugins framework will not be notified by any kind of plugin event. An example is when there is a change in system theme which does not involve loading/unloading of plugins.
      Specified by:
      incrementCounter in interface WebResourceBatchingStateCounter