com.atlassian.confluence.setup.bandana
Class ConfluenceCachingBandanaPersister

java.lang.Object
  extended by com.atlassian.confluence.setup.bandana.ConfluenceCachingBandanaPersister
All Implemented Interfaces:
com.atlassian.bandana.BandanaPersister

public class ConfluenceCachingBandanaPersister
extends Object
implements com.atlassian.bandana.BandanaPersister

Caching bandana persister that uses inline caching.

Uses the read-through cache factory for non-transactional updates to the cache when data is read from the underlying persister.


Field Summary
static org.apache.log4j.Category log
           
 
Constructor Summary
ConfluenceCachingBandanaPersister()
           
 
Method Summary
 void flushCaches()
           
 void remove(com.atlassian.bandana.BandanaContext context)
           
 void remove(com.atlassian.bandana.BandanaContext context, String key)
           
 Map retrieve(com.atlassian.bandana.BandanaContext context)
          This implementation is extremely processor intensive but correct.
 Object retrieve(com.atlassian.bandana.BandanaContext context, String key)
          Retrieves the value associated with the key from the given context.
 Iterable<String> retrieveKeys(com.atlassian.bandana.BandanaContext bandanaContext)
          Bypass the cache
 void setCacheFactory(ReadThroughCacheFactory cacheFactory)
           
 void setPersister(com.atlassian.bandana.BandanaPersister persister)
           
 void store(com.atlassian.bandana.BandanaContext context, String key, Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final org.apache.log4j.Category log
Constructor Detail

ConfluenceCachingBandanaPersister

public ConfluenceCachingBandanaPersister()
Method Detail

setCacheFactory

public void setCacheFactory(ReadThroughCacheFactory cacheFactory)

setPersister

public void setPersister(com.atlassian.bandana.BandanaPersister persister)

retrieve

public Object retrieve(com.atlassian.bandana.BandanaContext context,
                       String key)
Retrieves the value associated with the key from the given context. If the context does not exist, or the key is not found in the context, this method returns null.

Assumes that any BandanaContext we are passed is a ConfluenceBandanaContext because that's how Confluence uses Bandana.

Specified by:
retrieve in interface com.atlassian.bandana.BandanaPersister

retrieve

public Map retrieve(com.atlassian.bandana.BandanaContext context)
This implementation is extremely processor intensive but correct. The assumption is that this method NEVER gets called.

Specified by:
retrieve in interface com.atlassian.bandana.BandanaPersister
Parameters:
context - context to retrieve content for.
Returns:
a Map from String key to Object value

retrieveKeys

public Iterable<String> retrieveKeys(com.atlassian.bandana.BandanaContext bandanaContext)
Bypass the cache

Specified by:
retrieveKeys in interface com.atlassian.bandana.BandanaPersister
Parameters:
bandanaContext - the context for which to get keys
Returns:
the keys for the given context

store

public void store(com.atlassian.bandana.BandanaContext context,
                  String key,
                  Object value)
Specified by:
store in interface com.atlassian.bandana.BandanaPersister

flushCaches

public void flushCaches()
Specified by:
flushCaches in interface com.atlassian.bandana.BandanaPersister

remove

public void remove(com.atlassian.bandana.BandanaContext context)
Specified by:
remove in interface com.atlassian.bandana.BandanaPersister

remove

public void remove(com.atlassian.bandana.BandanaContext context,
                   String key)
Specified by:
remove in interface com.atlassian.bandana.BandanaPersister


Copyright © 2003-2011 Atlassian. All Rights Reserved.