Package 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.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.apache.velocity.runtime.resource.ResourceManagerImpl
globalCache, log, RESOURCE_CONTENT, RESOURCE_TEMPLATE, resourceLoaders, rsvc -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclearCacheOnDisable(com.atlassian.plugin.event.events.PluginDisabledEvent event) Clears the velocity resource cache when a plugin is disabled.voidinitialize(org.apache.velocity.runtime.RuntimeServices rs) Registers this class with theEventPublisher, and delegates to the super class initialize method.Methods inherited from class org.apache.velocity.runtime.resource.ResourceManagerImpl
createResource, getLoaderNameForResource, getResource, getResource, loadResource, refreshResource
-
Constructor Details
-
PluginAwareResourceManager
public PluginAwareResourceManager()
-
-
Method Details
-
initialize
Registers this class with theEventPublisher, and delegates to the super class initialize method.- Specified by:
initializein interfaceorg.apache.velocity.runtime.resource.ResourceManager- Overrides:
initializein classorg.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.
-