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 TypeMethodDescriptionvoid
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 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:
initialize
in interfaceorg.apache.velocity.runtime.resource.ResourceManager
- Overrides:
initialize
in 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.
-