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.vcache.VCacheFactory 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 velocityServices) |
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.vcache.VCacheFactory cacheFactory)
public static ConfluenceVelocityResourceCache getInstance()
@Deprecated public static void clearAllCaches()
public static void removeFromCaches(@Nonnull 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(@Nonnull org.apache.velocity.runtime.RuntimeServices velocityServices)
initialize in interface org.apache.velocity.runtime.resource.ResourceCachepublic org.apache.velocity.runtime.resource.Resource get(@Nonnull Object key)
get in interface org.apache.velocity.runtime.resource.ResourceCachepublic org.apache.velocity.runtime.resource.Resource put(@Nonnull Object key, @Nullable org.apache.velocity.runtime.resource.Resource resource)
put in interface org.apache.velocity.runtime.resource.ResourceCachepublic org.apache.velocity.runtime.resource.Resource remove(@Nonnull Object key)
remove in interface org.apache.velocity.runtime.resource.ResourceCachepublic Iterator<?> enumerateKeys()
enumerateKeys in interface org.apache.velocity.runtime.resource.ResourceCachepublic void clear()
Copyright © 2003–2018 Atlassian. All rights reserved.