com.atlassian.confluence.cache.spring
Class BeanNameTypeCache

java.lang.Object
  extended by com.atlassian.confluence.cache.spring.BeanNameTypeCache

public class BeanNameTypeCache
extends Object

A caching class used to improve the startup speed of Confluence, it has also shown improvements to systems under load.

Since:
4.2.0

Constructor Summary
BeanNameTypeCache()
           
 
Method Summary
 void clearCache()
          Clears the cache.
 BeanNameCacheResult get(Class type, boolean includeNonSingletons, boolean allowEagerInit)
          Get the value stored against the key made of the parameters passed.
 BeanNameCacheResult put(Class type, boolean includeNonSingletons, boolean allowEagerInit, String[] value)
          Put a new value into the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanNameTypeCache

public BeanNameTypeCache()
Method Detail

put

public BeanNameCacheResult put(Class type,
                               boolean includeNonSingletons,
                               boolean allowEagerInit,
                               String[] value)
Put a new value into the cache. Note that this class will return the *previous* value in the map. That means that when inserting a new value it will always return null. It will always overwrite any existing values.

Parameters:
type - used as a composite key.
includeNonSingletons - used as a composite key.
allowEagerInit - used as a composite key.
value - value to store against the key, can be null.
Returns:
*previous* value held in the map for the given key.

get

public BeanNameCacheResult get(Class type,
                               boolean includeNonSingletons,
                               boolean allowEagerInit)
Get the value stored against the key made of the parameters passed. Note it will return null if the value has not been stored. However if the key has been used in a put call it will return a BeanNameCacheResult that contains a null value.

Parameters:
type - used as a composite key.
includeNonSingletons - used as a composite key.
allowEagerInit - used as a composite key.
Returns:
cached result if present, null if no mapping can be found..

clearCache

public void clearCache()
Clears the cache. All mappings are removed after this call.



Copyright © 2003-2012 Atlassian. All Rights Reserved.