Class DefaultJCacheConfigurationBuilder

java.lang.Object
org.broadleafcommerce.common.extensibility.cache.DefaultJCacheConfigurationBuilder
All Implemented Interfaces:
JCacheConfigurationBuilder
Direct Known Subclasses:
DefaultEhCacheConfigurationBuilder

@Service("blJCacheConfigurationBuilder") @ConditionalOnEhCacheMissing public class DefaultJCacheConfigurationBuilder extends Object implements JCacheConfigurationBuilder
  • Constructor Details

    • DefaultJCacheConfigurationBuilder

      public DefaultJCacheConfigurationBuilder()
  • Method Details

    • buildConfiguration

      public javax.cache.configuration.Configuration buildConfiguration(JCacheRegionConfiguration regionInformation)
      Description copied from interface: JCacheConfigurationBuilder
      Given a JCacheRegionConfiguration build the appropriate Configuration class

      The purpose of this method is to allow for extensibility and customization when using specific JCache implementations since most support more configuration than the JSR-107 spec allows

      Specified by:
      buildConfiguration in interface JCacheConfigurationBuilder
      Parameters:
      regionInformation - The JCacheRegionConfiguration to use to build the Configuration
      Returns:
      The Configuration
    • buildConfiguration

      public <K, V> javax.cache.configuration.Configuration<K,V> buildConfiguration(int ttlSeconds, int maxElementsInMemory, Class<K> keyClass, Class<V> valueClass)
      Description copied from interface: JCacheConfigurationBuilder
      Similar to JCacheConfigurationBuilder.buildConfiguration(JCacheRegionConfiguration) however it requires more specifc arguments.

      The purpose of this method was for internal Broadleaf usages where we're sending the exact arguments

      Specified by:
      buildConfiguration in interface JCacheConfigurationBuilder
      Type Parameters:
      K - The key class of the Configuration
      V - The value class of the Configuration
      Parameters:
      ttlSeconds - The time to live for cache items in seconds
      maxElementsInMemory - The maximum number of elments allowed in the cache. Note that in some JCache implementations this is not used
      keyClass - The key class of the Configuration
      valueClass - The value class of the Configuration
      Returns: