public class ConfluenceVelocityResourceCache extends Object implements org.apache.velocity.runtime.resource.ResourceCache
We configure velocity to use this cache, then we can get at the static methods to globally remove things from the cache if we need to. This is necessary for the dynamic decorator stuff.
Constructor and Description |
---|
ConfluenceVelocityResourceCache(com.atlassian.cache.CacheFactory cacheFactory)
Create a resource cache using the provided cache manager.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
static void |
clearAllCaches()
Deprecated.
since 2.9 Use getInstance().clear()
|
Iterator<?> |
enumerateKeys() |
org.apache.velocity.runtime.resource.Resource |
get(Object key) |
static ConfluenceVelocityResourceCache |
getInstance()
Get the Confluence resource cache singleton.
|
void |
initialize(org.apache.velocity.runtime.RuntimeServices runtimeServices) |
org.apache.velocity.runtime.resource.Resource |
put(Object key,
org.apache.velocity.runtime.resource.Resource resource) |
org.apache.velocity.runtime.resource.Resource |
remove(Object key) |
static void |
removeFromCaches(Object key)
Remove a particular object from the cache
|
public ConfluenceVelocityResourceCache(com.atlassian.cache.CacheFactory cacheFactory)
public static ConfluenceVelocityResourceCache getInstance()
@Deprecated public static void clearAllCaches()
public static void removeFromCaches(Object key)
key
- the cache-key to remove. Any cached object with a key that has this key as a
substring will be removed, for safety's sake.public void initialize(org.apache.velocity.runtime.RuntimeServices runtimeServices)
initialize
in interface org.apache.velocity.runtime.resource.ResourceCache
public org.apache.velocity.runtime.resource.Resource get(Object key)
get
in interface org.apache.velocity.runtime.resource.ResourceCache
public org.apache.velocity.runtime.resource.Resource put(Object key, org.apache.velocity.runtime.resource.Resource resource)
put
in interface org.apache.velocity.runtime.resource.ResourceCache
public org.apache.velocity.runtime.resource.Resource remove(Object key)
remove
in interface org.apache.velocity.runtime.resource.ResourceCache
public Iterator<?> enumerateKeys()
enumerateKeys
in interface org.apache.velocity.runtime.resource.ResourceCache
public void clear()
Copyright © 2003–2015 Atlassian. All rights reserved.