org.thymeleaf.cache
Class StandardCacheManager

Object
  extended by org.thymeleaf.cache.AbstractCacheManager
      extended by org.thymeleaf.cache.StandardCacheManager
All Implemented Interfaces:
ICacheManager

public class StandardCacheManager
extends AbstractCacheManager

Standard implementation of ICacheManager, returning configurable instances of StandardCache for each of the default caches defined at the cache manager interface.

Each cache allows the configuration of the following parameters:

Since:
2.0.0
Author:
Daniel Fernández

Field Summary
static int DEFAULT_EXPRESSION_CACHE_INITIAL_SIZE
          Default expression cache initial size: 100
static String DEFAULT_EXPRESSION_CACHE_LOGGER_NAME
          Default expression cache logger name: null (default behaviour = org.thymeleaf.TemplateEngine.cache.EXPRESSION_CACHE)
static int DEFAULT_EXPRESSION_CACHE_MAX_SIZE
          Default expression cache maximum size: 500
static String DEFAULT_EXPRESSION_CACHE_NAME
          Default expression cache name: "EXPRESSION_CACHE"
static boolean DEFAULT_EXPRESSION_CACHE_USE_SOFT_REFERENCES
          Default expression cache "use soft references" flag: true
static ICacheEntryValidityChecker<String,Object> DEFAULT_EXPRESSION_CACHE_VALIDITY_CHECKER
          Default expression cache validity checker: null
static int DEFAULT_FRAGMENT_CACHE_INITIAL_SIZE
          Default fragment cache initial size: 20
static String DEFAULT_FRAGMENT_CACHE_LOGGER_NAME
          Default fragment cache logger name: null (default behaviour = org.thymeleaf.TemplateEngine.cache.FRAGMENT_CACHE)
static int DEFAULT_FRAGMENT_CACHE_MAX_SIZE
          Default fragment cache maximum size: 300
static String DEFAULT_FRAGMENT_CACHE_NAME
          Default fragment cache name: "FRAGMENT_CACHE"
static boolean DEFAULT_FRAGMENT_CACHE_USE_SOFT_REFERENCES
          Default fragment cache "use soft references" flag: true
static ICacheEntryValidityChecker<String,java.util.List<Node>> DEFAULT_FRAGMENT_CACHE_VALIDITY_CHECKER
          Default fragment cache validity checker: null
static int DEFAULT_MESSAGE_CACHE_INITIAL_SIZE
          Default message cache initial size: 20
static String DEFAULT_MESSAGE_CACHE_LOGGER_NAME
          Default message cache logger name: null (default behaviour = org.thymeleaf.TemplateEngine.cache.MESSAGE_CACHE)
static int DEFAULT_MESSAGE_CACHE_MAX_SIZE
          Default message cache maximum size: 300
static String DEFAULT_MESSAGE_CACHE_NAME
          Default message cache name: "MESSAGE_CACHE"
static boolean DEFAULT_MESSAGE_CACHE_USE_SOFT_REFERENCES
          Default message cache "use soft references" flag: true
static ICacheEntryValidityChecker<String,java.util.Properties> DEFAULT_MESSAGE_CACHE_VALIDITY_CHECKER
          Default message cache validity checker: null
static int DEFAULT_TEMPLATE_CACHE_INITIAL_SIZE
          Default template cache initial size: 10
static String DEFAULT_TEMPLATE_CACHE_LOGGER_NAME
          Default template cache logger name: null (default behaviour = org.thymeleaf.TemplateEngine.cache.TEMPLATE_CACHE)
static int DEFAULT_TEMPLATE_CACHE_MAX_SIZE
          Default template cache maximum size: 50
static String DEFAULT_TEMPLATE_CACHE_NAME
          Default template cache name: "TEMPLATE_CACHE"
static boolean DEFAULT_TEMPLATE_CACHE_USE_SOFT_REFERENCES
          Default template cache "use soft references" flag: true
static ICacheEntryValidityChecker<String,Template> DEFAULT_TEMPLATE_CACHE_VALIDITY_CHECKER
          Default template cache validity checker: an instance of StandardParsedTemplateEntryValidator.
 
Constructor Summary
StandardCacheManager()
           
 
Method Summary
 int getExpressionCacheInitialSize()
           
 org.slf4j.Logger getExpressionCacheLogger()
           
 String getExpressionCacheLoggerName()
           
 int getExpressionCacheMaxSize()
           
 String getExpressionCacheName()
           
 boolean getExpressionCacheUseSoftReferences()
           
 ICacheEntryValidityChecker<String,Object> getExpressionCacheValidityChecker()
           
 int getFragmentCacheInitialSize()
           
 org.slf4j.Logger getFragmentCacheLogger()
           
 String getFragmentCacheLoggerName()
           
 int getFragmentCacheMaxSize()
           
 String getFragmentCacheName()
           
 boolean getFragmentCacheUseSoftReferences()
           
 ICacheEntryValidityChecker<String,java.util.List<Node>> getFragmentCacheValidityChecker()
           
 int getMessageCacheInitialSize()
           
 org.slf4j.Logger getMessageCacheLogger()
           
 String getMessageCacheLoggerName()
           
 int getMessageCacheMaxSize()
           
 String getMessageCacheName()
           
 boolean getMessageCacheUseSoftReferences()
           
 ICacheEntryValidityChecker<String,java.util.Properties> getMessageCacheValidityChecker()
           
 int getTemplateCacheInitialSize()
           
 org.slf4j.Logger getTemplateCacheLogger()
           
 String getTemplateCacheLoggerName()
           
 int getTemplateCacheMaxSize()
           
 String getTemplateCacheName()
           
 boolean getTemplateCacheUseSoftReferences()
           
 ICacheEntryValidityChecker<String,Template> getTemplateCacheValidityChecker()
           
protected  ICache<String,Object> initializeExpressionCache()
           
protected  ICache<String,java.util.List<Node>> initializeFragmentCache()
           
protected  ICache<String,java.util.Properties> initializeMessageCache()
           
protected  ICache<String,Template> initializeTemplateCache()
           
 void setExpressionCacheInitialSize(int expressionCacheInitialSize)
           
 void setExpressionCacheLoggerName(String expressionCacheLoggerName)
           
 void setExpressionCacheMaxSize(int expressionCacheMaxSize)
           
 void setExpressionCacheName(String expressionCacheName)
           
 void setExpressionCacheUseSoftReferences(boolean expressionCacheUseSoftReferences)
           
 void setExpressionCacheValidityChecker(ICacheEntryValidityChecker<String,Object> expressionCacheValidityChecker)
           
 void setFragmentCacheInitialSize(int fragmentCacheInitialSize)
           
 void setFragmentCacheLoggerName(String fragmentCacheLoggerName)
           
 void setFragmentCacheMaxSize(int fragmentCacheMaxSize)
           
 void setFragmentCacheName(String fragmentCacheName)
           
 void setFragmentCacheUseSoftReferences(boolean fragmentCacheUseSoftReferences)
           
 void setFragmentCacheValidityChecker(ICacheEntryValidityChecker<String,java.util.List<Node>> fragmentCacheValidityChecker)
           
 void setMessageCacheInitialSize(int messageCacheInitialSize)
           
 void setMessageCacheLoggerName(String messageCacheLoggerName)
           
 void setMessageCacheMaxSize(int messageCacheMaxSize)
           
 void setMessageCacheName(String messageCacheName)
           
 void setMessageCacheUseSoftReferences(boolean messageCacheUseSoftReferences)
           
 void setMessageCacheValidityChecker(ICacheEntryValidityChecker<String,java.util.Properties> messageCacheValidityChecker)
           
 void setTemplateCacheInitialSize(int templateCacheInitialSize)
           
 void setTemplateCacheLoggerName(String templateCacheLoggerName)
           
 void setTemplateCacheMaxSize(int templateCacheMaxSize)
           
 void setTemplateCacheName(String templateCacheName)
           
 void setTemplateCacheUseSoftReferences(boolean templateCacheUseSoftReferences)
           
 void setTemplateCacheValidityChecker(ICacheEntryValidityChecker<String,Template> templateCacheValidityChecker)
           
 
Methods inherited from class org.thymeleaf.cache.AbstractCacheManager
getExpressionCache, getFragmentCache, getMessageCache, getSpecificCache, getTemplateCache
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TEMPLATE_CACHE_NAME

public static final String DEFAULT_TEMPLATE_CACHE_NAME
Default template cache name: "TEMPLATE_CACHE"

See Also:
Constant Field Values

DEFAULT_TEMPLATE_CACHE_INITIAL_SIZE

public static final int DEFAULT_TEMPLATE_CACHE_INITIAL_SIZE
Default template cache initial size: 10

See Also:
Constant Field Values

DEFAULT_TEMPLATE_CACHE_MAX_SIZE

public static final int DEFAULT_TEMPLATE_CACHE_MAX_SIZE
Default template cache maximum size: 50

See Also:
Constant Field Values

DEFAULT_TEMPLATE_CACHE_USE_SOFT_REFERENCES

public static final boolean DEFAULT_TEMPLATE_CACHE_USE_SOFT_REFERENCES
Default template cache "use soft references" flag: true

See Also:
Constant Field Values

DEFAULT_TEMPLATE_CACHE_LOGGER_NAME

public static final String DEFAULT_TEMPLATE_CACHE_LOGGER_NAME
Default template cache logger name: null (default behaviour = org.thymeleaf.TemplateEngine.cache.TEMPLATE_CACHE)


DEFAULT_TEMPLATE_CACHE_VALIDITY_CHECKER

public static final ICacheEntryValidityChecker<String,Template> DEFAULT_TEMPLATE_CACHE_VALIDITY_CHECKER
Default template cache validity checker: an instance of StandardParsedTemplateEntryValidator.


DEFAULT_FRAGMENT_CACHE_NAME

public static final String DEFAULT_FRAGMENT_CACHE_NAME
Default fragment cache name: "FRAGMENT_CACHE"

See Also:
Constant Field Values

DEFAULT_FRAGMENT_CACHE_INITIAL_SIZE

public static final int DEFAULT_FRAGMENT_CACHE_INITIAL_SIZE
Default fragment cache initial size: 20

See Also:
Constant Field Values

DEFAULT_FRAGMENT_CACHE_MAX_SIZE

public static final int DEFAULT_FRAGMENT_CACHE_MAX_SIZE
Default fragment cache maximum size: 300

See Also:
Constant Field Values

DEFAULT_FRAGMENT_CACHE_USE_SOFT_REFERENCES

public static final boolean DEFAULT_FRAGMENT_CACHE_USE_SOFT_REFERENCES
Default fragment cache "use soft references" flag: true

See Also:
Constant Field Values

DEFAULT_FRAGMENT_CACHE_LOGGER_NAME

public static final String DEFAULT_FRAGMENT_CACHE_LOGGER_NAME
Default fragment cache logger name: null (default behaviour = org.thymeleaf.TemplateEngine.cache.FRAGMENT_CACHE)


DEFAULT_FRAGMENT_CACHE_VALIDITY_CHECKER

public static final ICacheEntryValidityChecker<String,java.util.List<Node>> DEFAULT_FRAGMENT_CACHE_VALIDITY_CHECKER
Default fragment cache validity checker: null


DEFAULT_MESSAGE_CACHE_NAME

public static final String DEFAULT_MESSAGE_CACHE_NAME
Default message cache name: "MESSAGE_CACHE"

See Also:
Constant Field Values

DEFAULT_MESSAGE_CACHE_INITIAL_SIZE

public static final int DEFAULT_MESSAGE_CACHE_INITIAL_SIZE
Default message cache initial size: 20

See Also:
Constant Field Values

DEFAULT_MESSAGE_CACHE_MAX_SIZE

public static final int DEFAULT_MESSAGE_CACHE_MAX_SIZE
Default message cache maximum size: 300

See Also:
Constant Field Values

DEFAULT_MESSAGE_CACHE_USE_SOFT_REFERENCES

public static final boolean DEFAULT_MESSAGE_CACHE_USE_SOFT_REFERENCES
Default message cache "use soft references" flag: true

See Also:
Constant Field Values

DEFAULT_MESSAGE_CACHE_LOGGER_NAME

public static final String DEFAULT_MESSAGE_CACHE_LOGGER_NAME
Default message cache logger name: null (default behaviour = org.thymeleaf.TemplateEngine.cache.MESSAGE_CACHE)


DEFAULT_MESSAGE_CACHE_VALIDITY_CHECKER

public static final ICacheEntryValidityChecker<String,java.util.Properties> DEFAULT_MESSAGE_CACHE_VALIDITY_CHECKER
Default message cache validity checker: null


DEFAULT_EXPRESSION_CACHE_NAME

public static final String DEFAULT_EXPRESSION_CACHE_NAME
Default expression cache name: "EXPRESSION_CACHE"

See Also:
Constant Field Values

DEFAULT_EXPRESSION_CACHE_INITIAL_SIZE

public static final int DEFAULT_EXPRESSION_CACHE_INITIAL_SIZE
Default expression cache initial size: 100

See Also:
Constant Field Values

DEFAULT_EXPRESSION_CACHE_MAX_SIZE

public static final int DEFAULT_EXPRESSION_CACHE_MAX_SIZE
Default expression cache maximum size: 500

See Also:
Constant Field Values

DEFAULT_EXPRESSION_CACHE_USE_SOFT_REFERENCES

public static final boolean DEFAULT_EXPRESSION_CACHE_USE_SOFT_REFERENCES
Default expression cache "use soft references" flag: true

See Also:
Constant Field Values

DEFAULT_EXPRESSION_CACHE_LOGGER_NAME

public static final String DEFAULT_EXPRESSION_CACHE_LOGGER_NAME
Default expression cache logger name: null (default behaviour = org.thymeleaf.TemplateEngine.cache.EXPRESSION_CACHE)


DEFAULT_EXPRESSION_CACHE_VALIDITY_CHECKER

public static final ICacheEntryValidityChecker<String,Object> DEFAULT_EXPRESSION_CACHE_VALIDITY_CHECKER
Default expression cache validity checker: null

Constructor Detail

StandardCacheManager

public StandardCacheManager()
Method Detail

initializeTemplateCache

protected final ICache<String,Template> initializeTemplateCache()
Specified by:
initializeTemplateCache in class AbstractCacheManager

initializeFragmentCache

protected final ICache<String,java.util.List<Node>> initializeFragmentCache()
Specified by:
initializeFragmentCache in class AbstractCacheManager

initializeMessageCache

protected final ICache<String,java.util.Properties> initializeMessageCache()
Specified by:
initializeMessageCache in class AbstractCacheManager

initializeExpressionCache

protected final ICache<String,Object> initializeExpressionCache()
Specified by:
initializeExpressionCache in class AbstractCacheManager

getTemplateCacheName

public String getTemplateCacheName()

getTemplateCacheUseSoftReferences

public boolean getTemplateCacheUseSoftReferences()

getTemplateCacheInitialSize

public int getTemplateCacheInitialSize()

getTemplateCacheMaxSize

public int getTemplateCacheMaxSize()

getTemplateCacheLoggerName

public String getTemplateCacheLoggerName()

getTemplateCacheValidityChecker

public ICacheEntryValidityChecker<String,Template> getTemplateCacheValidityChecker()

getTemplateCacheLogger

public final org.slf4j.Logger getTemplateCacheLogger()

getFragmentCacheName

public String getFragmentCacheName()

getFragmentCacheUseSoftReferences

public boolean getFragmentCacheUseSoftReferences()

getFragmentCacheInitialSize

public int getFragmentCacheInitialSize()

getFragmentCacheMaxSize

public int getFragmentCacheMaxSize()

getFragmentCacheLoggerName

public String getFragmentCacheLoggerName()

getFragmentCacheValidityChecker

public ICacheEntryValidityChecker<String,java.util.List<Node>> getFragmentCacheValidityChecker()

getFragmentCacheLogger

public final org.slf4j.Logger getFragmentCacheLogger()

getMessageCacheName

public String getMessageCacheName()

getMessageCacheUseSoftReferences

public boolean getMessageCacheUseSoftReferences()

getMessageCacheInitialSize

public int getMessageCacheInitialSize()

getMessageCacheMaxSize

public int getMessageCacheMaxSize()

getMessageCacheLoggerName

public String getMessageCacheLoggerName()

getMessageCacheValidityChecker

public ICacheEntryValidityChecker<String,java.util.Properties> getMessageCacheValidityChecker()

getMessageCacheLogger

public final org.slf4j.Logger getMessageCacheLogger()

getExpressionCacheName

public String getExpressionCacheName()

getExpressionCacheUseSoftReferences

public boolean getExpressionCacheUseSoftReferences()

getExpressionCacheInitialSize

public int getExpressionCacheInitialSize()

getExpressionCacheMaxSize

public int getExpressionCacheMaxSize()

getExpressionCacheLoggerName

public String getExpressionCacheLoggerName()

getExpressionCacheValidityChecker

public ICacheEntryValidityChecker<String,Object> getExpressionCacheValidityChecker()

getExpressionCacheLogger

public final org.slf4j.Logger getExpressionCacheLogger()

setTemplateCacheName

public void setTemplateCacheName(String templateCacheName)

setTemplateCacheInitialSize

public void setTemplateCacheInitialSize(int templateCacheInitialSize)

setTemplateCacheMaxSize

public void setTemplateCacheMaxSize(int templateCacheMaxSize)

setTemplateCacheUseSoftReferences

public void setTemplateCacheUseSoftReferences(boolean templateCacheUseSoftReferences)

setTemplateCacheLoggerName

public void setTemplateCacheLoggerName(String templateCacheLoggerName)

setTemplateCacheValidityChecker

public void setTemplateCacheValidityChecker(ICacheEntryValidityChecker<String,Template> templateCacheValidityChecker)

setFragmentCacheName

public void setFragmentCacheName(String fragmentCacheName)

setFragmentCacheInitialSize

public void setFragmentCacheInitialSize(int fragmentCacheInitialSize)

setFragmentCacheMaxSize

public void setFragmentCacheMaxSize(int fragmentCacheMaxSize)

setFragmentCacheUseSoftReferences

public void setFragmentCacheUseSoftReferences(boolean fragmentCacheUseSoftReferences)

setFragmentCacheLoggerName

public void setFragmentCacheLoggerName(String fragmentCacheLoggerName)

setFragmentCacheValidityChecker

public void setFragmentCacheValidityChecker(ICacheEntryValidityChecker<String,java.util.List<Node>> fragmentCacheValidityChecker)

setMessageCacheName

public void setMessageCacheName(String messageCacheName)

setMessageCacheInitialSize

public void setMessageCacheInitialSize(int messageCacheInitialSize)

setMessageCacheMaxSize

public void setMessageCacheMaxSize(int messageCacheMaxSize)

setMessageCacheUseSoftReferences

public void setMessageCacheUseSoftReferences(boolean messageCacheUseSoftReferences)

setMessageCacheLoggerName

public void setMessageCacheLoggerName(String messageCacheLoggerName)

setMessageCacheValidityChecker

public void setMessageCacheValidityChecker(ICacheEntryValidityChecker<String,java.util.Properties> messageCacheValidityChecker)

setExpressionCacheName

public void setExpressionCacheName(String expressionCacheName)

setExpressionCacheInitialSize

public void setExpressionCacheInitialSize(int expressionCacheInitialSize)

setExpressionCacheMaxSize

public void setExpressionCacheMaxSize(int expressionCacheMaxSize)

setExpressionCacheUseSoftReferences

public void setExpressionCacheUseSoftReferences(boolean expressionCacheUseSoftReferences)

setExpressionCacheLoggerName

public void setExpressionCacheLoggerName(String expressionCacheLoggerName)

setExpressionCacheValidityChecker

public void setExpressionCacheValidityChecker(ICacheEntryValidityChecker<String,Object> expressionCacheValidityChecker)


Copyright © 2012 The THYMELEAF team. All Rights Reserved.