com.atlassian.velocity
Class PluginAwareResourceManager

java.lang.Object
  extended by org.apache.velocity.runtime.resource.ResourceManagerImpl
      extended by com.atlassian.velocity.PluginAwareResourceManager
All Implemented Interfaces:
org.apache.velocity.runtime.resource.ResourceManager

public class PluginAwareResourceManager
extends org.apache.velocity.runtime.resource.ResourceManagerImpl

Listens for plugin events, and clears the velocity resource cache accordingly.

The resource cache contains the velocity templates that have already been rendered by the underlying VelocityEngine.


Nested Class Summary
static class PluginAwareResourceManager.Cache
           
 
Field Summary
 
Fields inherited from class org.apache.velocity.runtime.resource.ResourceManagerImpl
globalCache, log, RESOURCE_CONTENT, RESOURCE_TEMPLATE, resourceLoaders, rsvc
 
Constructor Summary
PluginAwareResourceManager()
           
 
Method Summary
 void clearCacheOnDisable(com.atlassian.plugin.event.events.PluginDisabledEvent event)
          Clears the velocity resource cache when a plugin is disabled.
 void initialize(org.apache.velocity.runtime.RuntimeServices rs)
          Registers this class with the EventPublisher, and delegates to the super class initialize method.
 
Methods inherited from class org.apache.velocity.runtime.resource.ResourceManagerImpl
createResource, getLoaderNameForResource, getResource, getResource, loadResource, refreshResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginAwareResourceManager

public PluginAwareResourceManager()
Method Detail

initialize

public void initialize(org.apache.velocity.runtime.RuntimeServices rs)
                throws Exception
Registers this class with the EventPublisher, and delegates to the super class initialize method.

Specified by:
initialize in interface org.apache.velocity.runtime.resource.ResourceManager
Overrides:
initialize in class org.apache.velocity.runtime.resource.ResourceManagerImpl
Parameters:
rs - RuntimeServices instance
Throws:
Exception

clearCacheOnDisable

@EventListener
public void clearCacheOnDisable(com.atlassian.plugin.event.events.PluginDisabledEvent event)
Clears the velocity resource cache when a plugin is disabled.

Parameters:
event - The event instance fired when a plugin is disabled.


Copyright © 2002-2014 Atlassian. All Rights Reserved.