public class

ConfluenceVelocityResourceCache

extends Object
implements ResourceCache
java.lang.Object
   ↳ com.atlassian.confluence.util.velocity.ConfluenceVelocityResourceCache
Known Direct Subclasses

Class Overview

Clearable velocity cache.

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.

Summary

Fields
public static final Logger log
Public Constructors
ConfluenceVelocityResourceCache(CacheFactory cacheFactory)
Create a resource cache using the provided cache manager.
Public Methods
void clear()
@Deprecated static void clearAllCaches()
This method is deprecated. since 2.9 Use getInstance().clear()
Iterator enumerateKeys()
Resource get(Object key)
static ConfluenceVelocityResourceCache getInstance()
Get the Confluence resource cache singleton.
void initialize(RuntimeServices runtimeServices)
Resource put(Object key, Resource resource)
Resource remove(Object key)
static void removeFromCaches(Object key)
Remove a particular object from the cache
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.velocity.runtime.resource.ResourceCache

Fields

public static final Logger log

Public Constructors

public ConfluenceVelocityResourceCache (CacheFactory cacheFactory)

Create a resource cache using the provided cache manager. Everytime this is called, the resource cache 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 (WebWork velcoity manager), we can't enforce singleton use via a factory method.

Public Methods

public void clear ()

@Deprecated public static void clearAllCaches ()

This method is deprecated.
since 2.9 Use getInstance().clear()

Clear the contents of all caches that have been created so far

public Iterator enumerateKeys ()

public Resource get (Object key)

public static ConfluenceVelocityResourceCache getInstance ()

Get the Confluence resource cache singleton.

Returns
  • Resource cache singleton, may be null if Confluence caching has not been initialised.

public void initialize (RuntimeServices runtimeServices)

public Resource put (Object key, Resource resource)

public Resource remove (Object key)

public static void removeFromCaches (Object key)

Remove a particular object from the cache

Parameters
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.