com.atlassian.confluence.cache
Class DefaultCacheSettingsManager

java.lang.Object
  extended by com.atlassian.confluence.cache.DefaultCacheSettingsManager
All Implemented Interfaces:
CacheSettingsManager

public class DefaultCacheSettingsManager
extends java.lang.Object
implements CacheSettingsManager

Implementation of CacheSettingsManager that uses a read-only Configuration file that specifies the cache defaults. The configuration file must be in the format to be parsed using the Typesafe Config Library.

The format of the file must include an entry caches which is an array of objects, that each object contains the following properties:

A config object may contain the following properties:

An example minimal configuration file is:

 // Defaults for local caches
 local-defaults = {
     local = true
     flushable = true
     max-entries = 1000
     expire-after-access-secs = 360
 }

 // Defaults for replicated caches
 remote-defaults = ${local-defaults} {
     local = false
     replicate-via-copy = true
 }

 remote-big = ${remote-defaults} {
     expire-after-write-secs = 42
     flushable = false
     replicate-async = true
     replicate-via-copy = false
     max-entries = 666666
 }

 caches = [
     { name = "a.local.cache", config = ${local-defaults} }
     { name = "a.remote.cache", config = ${remote-defaults} }
     { name = "big.ones.*", config = ${remote-big} }
     { name = "reg.+exp[chars(\\", config = ${remote-big} }
     { name = "*", config = ${remote-defaults} }
 ]
 


Constructor Summary
DefaultCacheSettingsManager(org.springframework.core.io.Resource configResource)
           
 
Method Summary
 com.atlassian.cache.CacheSettings obtainDefaults(java.lang.String name)
          Obtains the default cache settings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCacheSettingsManager

public DefaultCacheSettingsManager(org.springframework.core.io.Resource configResource)
                            throws java.io.IOException
Throws:
java.io.IOException
Method Detail

obtainDefaults

public com.atlassian.cache.CacheSettings obtainDefaults(java.lang.String name)
Description copied from interface: CacheSettingsManager
Obtains the default cache settings. from persistent storage, for the specified cache.

Specified by:
obtainDefaults in interface CacheSettingsManager
Parameters:
name - the name of the cache to obtain default settings
Returns:
the default cache settings


Copyright © 2003-2014 Atlassian. All Rights Reserved.