Package org.apache.struts2.ognl

# Class DefaultOgnlCacheFactory<Key,Value>

java.lang.Object
org.apache.struts2.ognl.DefaultOgnlCacheFactory<Key,Value>

Type Parameters:
  `Key` - The type for the cache key entries
  `Value` - The type for the cache value entries

All Implemented Interfaces:
  `OgnlCacheFactory<Key,Value>`

Direct Known Subclasses:
  `DefaultOgnlBeanInfoCacheFactory`, `DefaultOgnlExpressionCacheFactory`

public class DefaultOgnlCacheFactory<Key,Value> extends Object implements OgnlCacheFactory<Key,Value>

Default OGNL Cache factory implementation.

Currently used for Expression cache and BeanInfo cache creation.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface org.apache.struts2.ognl.OgnlCacheFactory

  `OgnlCacheFactory.CacheType`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DefaultOgnlCacheFactory(int cacheMaxSize, OgnlCacheFactory.CacheType defaultCacheType)`
  `DefaultOgnlCacheFactory(int cacheMaxSize, OgnlCacheFactory.CacheType defaultCacheType, int initialCapacity)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `OgnlCache<Key,Value>`
  `buildOgnlCache()`
  `OgnlCache<Key,Value>`
  `buildOgnlCache(int evictionLimit, int initialCapacity, float loadFactor, OgnlCacheFactory.CacheType cacheType)`
  `int`
  `getCacheMaxSize()`
  `OgnlCacheFactory.CacheType`
  `getDefaultCacheType()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### DefaultOgnlCacheFactory

    public DefaultOgnlCacheFactory(int cacheMaxSize, OgnlCacheFactory.CacheType defaultCacheType)

  - ### DefaultOgnlCacheFactory

    public DefaultOgnlCacheFactory(int cacheMaxSize, OgnlCacheFactory.CacheType defaultCacheType, int initialCapacity)

- ## Method Details

  - ### buildOgnlCache

    public OgnlCache<Key,Value> buildOgnlCache()
    Specified by:
      `buildOgnlCache` in interface `OgnlCacheFactory<Key,Value>`

  - ### buildOgnlCache

    public OgnlCache<Key,Value> buildOgnlCache(int evictionLimit, int initialCapacity, float loadFactor, OgnlCacheFactory.CacheType cacheType)
    Specified by:
      `buildOgnlCache` in interface `OgnlCacheFactory<Key,Value>`
    Parameters:
      `evictionLimit` - maximum capacity of the cache where applicable for cache type chosen
      `initialCapacity` - initial capacity of the cache where applicable for cache type chosen
      `loadFactor` - load factor of the cache where applicable for cache type chosen
      `cacheType` - type of cache to build
    Returns:
      a new cache instance

  - ### getCacheMaxSize

    public int getCacheMaxSize()
    Specified by:
      `getCacheMaxSize` in interface `OgnlCacheFactory<Key,Value>`

  - ### getDefaultCacheType

    public OgnlCacheFactory.CacheType getDefaultCacheType()
    Specified by:
      `getDefaultCacheType` in interface `OgnlCacheFactory<Key,Value>`