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() |
Iterator<?> |
enumerateKeys() |
org.apache.velocity.runtime.resource.Resource |
get(@NonNull Object key) |
static ConfluenceVelocityResourceCache |
getInstance()
Get the Confluence resource cache singleton.
|
void |
initialize(@NonNull org.apache.velocity.runtime.RuntimeServices velocityServices) |
org.apache.velocity.runtime.resource.Resource |
put(@NonNull Object key,
@Nullable org.apache.velocity.runtime.resource.Resource resource) |
org.apache.velocity.runtime.resource.Resource |
remove(@NonNull Object key) |
static void |
removeFromCaches(@NonNull Object key)
Remove a particular object from the cache
|
public ConfluenceVelocityResourceCache(com.atlassian.vcache.VCacheFactory cacheFactory)
public static ConfluenceVelocityResourceCache getInstance()
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.ResourceCache
public org.apache.velocity.runtime.resource.Resource get(@NonNull Object key)
get
in interface org.apache.velocity.runtime.resource.ResourceCache
public 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.ResourceCache
public org.apache.velocity.runtime.resource.Resource remove(@NonNull 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–2020 Atlassian. All rights reserved.