com.opensymphony.xwork2.ognl

## Interface OgnlCacheFactory<Key,Value>

- Type Parameters:
    `Key` - The type for the cache key entries
    `Value` - The type for the cache value entries
  All Known Subinterfaces:
    BeanInfoCacheFactory<Key,Value>, ExpressionCacheFactory<Key,Value>
  All Known Implementing Classes:
    DefaultOgnlBeanInfoCacheFactory, DefaultOgnlCacheFactory, DefaultOgnlExpressionCacheFactory

      public interface OgnlCacheFactory<Key,Value>

  Used by `OgnlUtil` to create appropriate OGNL caches based on configuration.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `OgnlCacheFactory.CacheType`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `OgnlCache<Key,Value>` | `buildOgnlCache()`
    `default OgnlCache<Key,Value>` | `buildOgnlCache(int evictionLimit, int initialCapacity, float loadFactor, boolean lruCache)` Deprecated. since 6.4.0, use `buildOgnlCache(int, int, float, CacheType)`
    `OgnlCache<Key,Value>` | `buildOgnlCache(int evictionLimit, int initialCapacity, float loadFactor, OgnlCacheFactory.CacheType cacheType)`
    `int` | `getCacheMaxSize()`
    `OgnlCacheFactory.CacheType` | `getDefaultCacheType()`
    `default boolean` | `getUseLRUCache()` Deprecated. since 6.4.0

- - ### Method Detail

    - #### buildOgnlCache

          OgnlCache<Key,Value> buildOgnlCache()

    - #### buildOgnlCache

          @Deprecated
          default OgnlCache<Key,Value> buildOgnlCache(int evictionLimit,
                                                                  int initialCapacity,
                                                                  float loadFactor,
                                                                  boolean lruCache)

      Deprecated. since 6.4.0, use `buildOgnlCache(int, int, float, CacheType)`
      Note that if `lruCache` is `false`, the cache type could still be LRU if the default cache type is configured as such.

    - #### buildOgnlCache

          OgnlCache<Key,Value> buildOgnlCache(int evictionLimit,
                                              int initialCapacity,
                                              float loadFactor,
                                              OgnlCacheFactory.CacheType cacheType)

      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

          int getCacheMaxSize()

    - #### getUseLRUCache

          @Deprecated
          default boolean getUseLRUCache()

      Deprecated. since 6.4.0

    - #### getDefaultCacheType

          OgnlCacheFactory.CacheType getDefaultCacheType()

Copyright © 2000–2025 Apache Software Foundation. All rights reserved.