com.atlassian.plugin.webresource
Class WebResourceBatchingStateCounterImpl

java.lang.Object
  extended by 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 Summary
WebResourceBatchingStateCounterImpl(PluginEventManager pluginEventManager)
           
 
Method Summary
 void close()
          Closes the instance.
 long getBatchingStateCounter()
          Gets batching state counter.
 void incrementCounter()
          Increment of the counter.
 void onPluginFrameworkPluginFrameworkShutdown(PluginFrameworkShutdownEvent event)
           
 void onPluginFrameworkStarted(PluginFrameworkStartedEvent event)
           
 void onPluginModuleDisabled(PluginModuleDisabledEvent event)
           
 void onPluginModuleEnabled(PluginModuleEnabledEvent event)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebResourceBatchingStateCounterImpl

public WebResourceBatchingStateCounterImpl(PluginEventManager pluginEventManager)
Method Detail

close

public void close()
Closes the instance.


onPluginFrameworkStarted

public void onPluginFrameworkStarted(PluginFrameworkStartedEvent event)

onPluginFrameworkPluginFrameworkShutdown

public void onPluginFrameworkPluginFrameworkShutdown(PluginFrameworkShutdownEvent event)

onPluginModuleEnabled

public void onPluginModuleEnabled(PluginModuleEnabledEvent event)

onPluginModuleDisabled

public void onPluginModuleDisabled(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


Copyright © 2013 Atlassian. All Rights Reserved.