com.atlassian.velocity
Class PluginAwareResourceManager
java.lang.Object
org.apache.velocity.runtime.resource.ResourceManagerImpl
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
.
Fields inherited from class org.apache.velocity.runtime.resource.ResourceManagerImpl |
globalCache, log, RESOURCE_CONTENT, RESOURCE_TEMPLATE, resourceLoaders, rsvc |
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 |
PluginAwareResourceManager
public PluginAwareResourceManager()
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-2013 Atlassian. All Rights Reserved.