Package org.ehcache.jsr107
Class Eh107Configuration<K,V>
java.lang.Object
org.ehcache.jsr107.Eh107Configuration<K,V>
- Type Parameters:
K- the key typeV- the value type
- All Implemented Interfaces:
Serializable,javax.cache.configuration.Configuration<K,V>
public abstract class Eh107Configuration<K,V>
extends Object
implements javax.cache.configuration.Configuration<K,V>
Abstract
Configuration implementation that enables building a JSR-107 compatible configuration from
a native Ehcache CacheConfiguration.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <K,V> javax.cache.configuration.Configuration<K, V> fromEhcacheCacheConfiguration(org.ehcache.config.Builder<? extends org.ehcache.config.CacheConfiguration<K, V>> ehcacheConfigBuilder) Creates a new JSR-107Configurationfrom the providedCacheConfigurationobtained through aBuilder.static <K,V> javax.cache.configuration.Configuration<K, V> fromEhcacheCacheConfiguration(org.ehcache.config.CacheConfiguration<K, V> ehcacheConfig) Creates a new JSR-107Configurationfrom the providedCacheConfiguration.abstract <T> TEnables to unwrap the underlying configuration.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.cache.configuration.Configuration
getKeyType, getValueType, isStoreByValue
-
Constructor Details
-
Eh107Configuration
public Eh107Configuration()
-
-
Method Details
-
fromEhcacheCacheConfiguration
public static <K,V> javax.cache.configuration.Configuration<K,V> fromEhcacheCacheConfiguration(org.ehcache.config.CacheConfiguration<K, V> ehcacheConfig) Creates a new JSR-107Configurationfrom the providedCacheConfiguration.- Type Parameters:
K- the key typeV- the value type- Parameters:
ehcacheConfig- the native Ehcache configuration- Returns:
- a JSR-107 configuration
-
fromEhcacheCacheConfiguration
public static <K,V> javax.cache.configuration.Configuration<K,V> fromEhcacheCacheConfiguration(org.ehcache.config.Builder<? extends org.ehcache.config.CacheConfiguration<K, V>> ehcacheConfigBuilder) Creates a new JSR-107Configurationfrom the providedCacheConfigurationobtained through aBuilder.- Type Parameters:
K- the key typeV- the value type- Parameters:
ehcacheConfigBuilder- the native Ehcache configuration through a builder- Returns:
- a JSR-107 configuration
-
unwrap
Enables to unwrap the underlying configuration.- Type Parameters:
T- the unwrap target type- Parameters:
clazz- the unwrap target class- Returns:
- unwrapped type
- Throws:
IllegalArgumentException- if the type cannot be unwrapped in the target type
-