Class ConfluenceVelocityResourceManager
- java.lang.Object
-
- com.atlassian.confluence.util.velocity.ConfigurableResourceManager
-
- com.atlassian.confluence.util.velocity.ConfluenceVelocityResourceManager
-
- All Implemented Interfaces:
org.apache.velocity.runtime.resource.ResourceManager
- Direct Known Subclasses:
CompatibleVelocityResourceManager
public class ConfluenceVelocityResourceManager extends ConfigurableResourceManager
Specialisation that allows for a hot swappable ResourceCache. Also allows resource loaders to be configured as source of space decoration resources via the decorator.provider boolean property. Any resource loader not configured to be a space decorator provider will be wrapped and answer null for space decoration resources.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ConfluenceVelocityResourceManager.ConfluenceResourceFactory
This factory will return template that can be used to detect the presence of HTML in the template if required-
Nested classes/interfaces inherited from class com.atlassian.confluence.util.velocity.ConfigurableResourceManager
ConfigurableResourceManager.ResourceFactory
-
-
Field Summary
-
Fields inherited from class com.atlassian.confluence.util.velocity.ConfigurableResourceManager
globalCache, log, RESOURCE_CONTENT, RESOURCE_TEMPLATE, resourceLoaders, rsvc
-
-
Constructor Summary
Constructors Constructor Description ConfluenceVelocityResourceManager()
Everytime this is called, the resource manager singleton is replaced with the newly provided instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected ConfigurableResourceManager.ResourceFactory
getResourceFactory()
Template method for provisioning aConfigurableResourceManager.ResourceFactory
.void
initialize(org.apache.velocity.runtime.RuntimeServices runtimeServices)
Initialize the ResourceManager.protected org.apache.velocity.runtime.resource.loader.ResourceLoader
postProcessLoader(org.apache.velocity.runtime.resource.loader.ResourceLoader loader, org.apache.commons.collections.ExtendedProperties config)
Template method to allow subclasses to post process and possibly wrap a resource loader before it is added to the loader list.static void
setCacheFactory(com.atlassian.cache.CacheFactory cacheFactory)
static void
setCacheFactory(com.atlassian.vcache.VCacheFactory cacheFactory)
Deprecated.since 7.20 usesetCacheFactory(CacheFactory)
-
Methods inherited from class com.atlassian.confluence.util.velocity.ConfigurableResourceManager
getLoaderNameForResource, getResource, loadResource, refreshResource
-
-
-
-
Constructor Detail
-
ConfluenceVelocityResourceManager
public ConfluenceVelocityResourceManager()
Everytime this is called, the resource manager singleton is replaced with the newly provided instance. There should only ever be one of these created but as we don't have control over the creating code (Struts velocity manager), we can't enforce singleton use via a factory method.
-
-
Method Detail
-
setCacheFactory
public static void setCacheFactory(com.atlassian.cache.CacheFactory cacheFactory)
-
setCacheFactory
@Deprecated public static void setCacheFactory(com.atlassian.vcache.VCacheFactory cacheFactory)
Deprecated.since 7.20 usesetCacheFactory(CacheFactory)
-
initialize
public void initialize(org.apache.velocity.runtime.RuntimeServices runtimeServices) throws Exception
Description copied from class:ConfigurableResourceManager
Initialize the ResourceManager.- Specified by:
initialize
in interfaceorg.apache.velocity.runtime.resource.ResourceManager
- Overrides:
initialize
in classConfigurableResourceManager
- Parameters:
runtimeServices
- The Runtime Services object which is associated with this Resource Manager.- Throws:
Exception
-
postProcessLoader
protected org.apache.velocity.runtime.resource.loader.ResourceLoader postProcessLoader(org.apache.velocity.runtime.resource.loader.ResourceLoader loader, org.apache.commons.collections.ExtendedProperties config)
Description copied from class:ConfigurableResourceManager
Template method to allow subclasses to post process and possibly wrap a resource loader before it is added to the loader list. This implementation does nothing.- Overrides:
postProcessLoader
in classConfigurableResourceManager
- Parameters:
loader
- Resource loader to processconfig
- Configured properties for the resource loader- Returns:
- final resource loader instance to be used at runtime. Must not be null.
-
getResourceFactory
protected ConfigurableResourceManager.ResourceFactory getResourceFactory()
Description copied from class:ConfigurableResourceManager
Template method for provisioning a
ConfigurableResourceManager.ResourceFactory
. Subclasses may customise this factory where necessary.This implementation returns a strategy that delegates to the default Velocity resource factory methods.
- Overrides:
getResourceFactory
in classConfigurableResourceManager
- Returns:
- resource factory to use for this resource manager
- See Also:
ConfigurableResourceManager.DefaultResourceFactory
-
-