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, org.springframework.beans.factory.InitializingBean

public class ConfluenceCachingBandanaPersister
extends java.lang.Object
implements com.atlassian.bandana.BandanaPersister, org.springframework.beans.factory.InitializingBean

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.


Constructor Summary
ConfluenceCachingBandanaPersister()
           
 
Method Summary
 void afterPropertiesSet()
           
 void flushCaches()
           
 void remove(com.atlassian.bandana.BandanaContext context)
           
 void remove(com.atlassian.bandana.BandanaContext context, java.lang.String key)
           
 java.util.Map<java.lang.String,java.lang.Object> retrieve(com.atlassian.bandana.BandanaContext context)
          This implementation is extremely processor intensive but correct.
 java.lang.Object retrieve(com.atlassian.bandana.BandanaContext context, java.lang.String key)
          Retrieves the value associated with the key from the given context.
 java.lang.Iterable<java.lang.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, java.lang.String key, java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfluenceCachingBandanaPersister

public ConfluenceCachingBandanaPersister()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception

setCacheFactory

public void setCacheFactory(ReadThroughCacheFactory cacheFactory)

setPersister

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

retrieve

public java.lang.Object retrieve(com.atlassian.bandana.BandanaContext context,
                                 java.lang.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 KeyedBandanaContext because that's how Confluence uses Bandana.

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

retrieve

public java.util.Map<java.lang.String,java.lang.Object> 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 java.lang.Iterable<java.lang.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,
                  java.lang.String key,
                  java.lang.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,
                   java.lang.String key)
Specified by:
remove in interface com.atlassian.bandana.BandanaPersister


Copyright © 2003-2014 Atlassian. All Rights Reserved.