public class

DeferredOperationsCache

extends CacheAdapter
java.lang.Object
   ↳ com.atlassian.confluence.cache.CacheAdapter
     ↳ com.atlassian.confluence.cache.DeferredOperationsCache

Class Overview

An implementation of com.atlassian.cache.Cache that records changes to a delegate cache, only actually performing them when sync() is called. Deferred operations are still visible to the client, the actions are just not taken on the delegate cache.

For example, calling put(Object, Object) will not update the delegate cache, but the value will still be recorded for subsequent calls to get(Object) for the same key. Once sync() is called, the new value will be inserted in the delegate cache.

Objects of this class are NOT thread-safe. It is the client's responsibility to ensure serialized access to this object.

Summary

Public Constructors
DeferredOperationsCache(Cache delegate)
Construct a deferred operations cache wrapper
Public Methods
Object get(Object key)
Collection getKeys()
boolean hasDeferredOperations()
void put(Object key, Object value)
void remove(Object key)
void removeAll()
void sync()
[Expand]
Inherited Methods
From class com.atlassian.confluence.cache.CacheAdapter
From class java.lang.Object
From interface com.atlassian.cache.Cache

Public Constructors

public DeferredOperationsCache (Cache delegate)

Construct a deferred operations cache wrapper

Parameters
delegate Cache to wrap

Public Methods

public Object get (Object key)

public Collection getKeys ()

public boolean hasDeferredOperations ()

public void put (Object key, Object value)

public void remove (Object key)

public void removeAll ()

public void sync ()