Interface ILuteceCacheManager
- All Known Implementing Classes:
LuteceCacheManager
-
Method Summary
Modifier and TypeMethodDescription<K,V> Lutece107Cache<K, V> createCache(String cacheName) Creates a namedCacheat runtime.<K,V, C extends javax.cache.configuration.Configuration<K, V>>
Lutece107Cache<K,V> createCache(String cacheName, C configuration, boolean enable) Creates a namedCacheat runtime.<K,V, C extends javax.cache.configuration.Configuration<K, V>>
Lutece107Cache<K,V> createCache(String cacheName, Class<K> k, Class<V> v) Creates a namedCacheat runtime.<K,V, C extends javax.cache.configuration.Configuration<K, V>>
Lutece107Cache<K,V> createCache(String strCacheName, Class<K> k, Class<V> v, boolean enable) Creates a namedCacheat runtime.<K,V, C extends javax.cache.configuration.Configuration<K, V>>
Lutece107Cache<K,V> createCache(String strCacheName, Class<K> k, Class<V> v, boolean enable, boolean preventGlobalReset) Creates a namedCacheat runtime.<K,V> Lutece107Cache<K, V> Looks up a managedCachegiven its name.<K,V> Lutece107Cache<K, V> Looks up a managedCachegiven its name.
-
Method Details
-
createCache
<K,V, Lutece107Cache<K,C extends javax.cache.configuration.Configuration<K, V>> V> createCache(String cacheName, C configuration, boolean enable) throws IllegalArgumentException Creates a namedCacheat runtime.If a
Cachewith the specified name is known to theCacheManager, a CacheException is thrown.If a
Cachewith the specified name is unknown theCacheManager, one is created according to the providedConfigurationafter which it becomes managed by theCacheManager.Prior to a
Cachebeing created, the providedConfigurations is validated within the context of theCacheManagerproperties and implementation.Implementers should be aware that the
Configurationmay be used to configure otherCaches.There's no requirement on the part of a developer to call this method for each
Cachean application may use. Implementations may support the use of declarative mechanisms to pre-configureCaches, thus removing the requirement to configure them in an application. In such circumstances a developer may simply call either thegetCache(String)orgetCache(String, Class, Class)methods to acquire a previously established or pre-configuredCache.- Type Parameters:
K- the type of keyV- the type of valueC- the type of the Configuration- Parameters:
cacheName- the name of theCache. Names should not use forward slashes(/) or colons(:), or start with java. or javax. These prefixes are reserved.enable- If enable is set to true, the cache will be initialized upon its creation.configuration- aConfigurationfor theCache- Throws:
IllegalStateException- if theCacheManager#isClosed()javax.cache.CacheException- if there was an error configuring theCache, which includes trying to create a cache that already exists.IllegalArgumentException- if the configuration is invalidUnsupportedOperationException- if the configuration specifies an unsupported featureNullPointerException- if the cache configuration or name is nullSecurityException- when the operation could not be performed due to the current security settings
-
createCache
Creates a namedCacheat runtime.If a
Cachewith the specified name is known to theCacheManager, a CacheException is thrown.If a
Cachewith the specified name is unknown theCacheManager, one is created according to the providedConfigurationafter which it becomes managed by theCacheManager.Prior to a
Cachebeing created, the providedConfigurations is validated within the context of theCacheManagerproperties and implementation.Implementers should be aware that the
Configurationmay be used to configure otherCaches.There's no requirement on the part of a developer to call this method for each
Cachean application may use. Implementations may support the use of declarative mechanisms to pre-configureCaches, thus removing the requirement to configure them in an application. In such circumstances a developer may simply call either thegetCache(String)orgetCache(String, Class, Class)methods to acquire a previously established or pre-configuredCache.- Type Parameters:
K- the type of keyV- the type of value- Parameters:
cacheName- the name of theCache. Names should not use forward slashes(/) or colons(:), or start with java. or javax. These prefixes are reserved.- Throws:
IllegalStateException- if theCacheManager#isClosed()javax.cache.CacheException- if there was an error configuring theCache, which includes trying to create a cache that already exists.IllegalArgumentException- if the configuration is invalidUnsupportedOperationException- if the configuration specifies an unsupported featureNullPointerException- if the cache configuration or name is nullSecurityException- when the operation could not be performed due to the current security settings
-
createCache
<K,V, Lutece107Cache<K,C extends javax.cache.configuration.Configuration<K, V>> V> createCache(String cacheName, Class<K> k, Class<V> v) throws IllegalArgumentException Creates a namedCacheat runtime.If a
Cachewith the specified name is known to theCacheManager, a CacheException is thrown.If a
Cachewith the specified name is unknown theCacheManager, one is created according to the providedConfigurationafter which it becomes managed by theCacheManager.Prior to a
Cachebeing created, the providedConfigurations is validated within the context of theCacheManagerproperties and implementation.Implementers should be aware that the
Configurationmay be used to configure otherCaches.There's no requirement on the part of a developer to call this method for each
Cachean application may use. Implementations may support the use of declarative mechanisms to pre-configureCaches, thus removing the requirement to configure them in an application. In such circumstances a developer may simply call either thegetCache(String)orgetCache(String, Class, Class)methods to acquire a previously established or pre-configuredCache.- Type Parameters:
K- the type of keyV- the type of valueC- the type of the Configuration- Parameters:
cacheName- the name of theCache. Names should not use forward slashes(/) or colons(:), or start with java. or javax. These prefixes are reserved.configuration- aConfigurationfor theCache- Throws:
IllegalStateException- if theCacheManager#isClosed()javax.cache.CacheException- if there was an error configuring theCache, which includes trying to create a cache that already exists.IllegalArgumentException- if the configuration is invalidUnsupportedOperationException- if the configuration specifies an unsupported featureNullPointerException- if the cache configuration or name is nullSecurityException- when the operation could not be performed due to the current security settings
-
createCache
<K,V, Lutece107Cache<K,C extends javax.cache.configuration.Configuration<K, V>> V> createCache(String strCacheName, Class<K> k, Class<V> v, boolean enable) throws IllegalArgumentException Creates a namedCacheat runtime.If a
Cachewith the specified name is known to theCacheManager, a CacheException is thrown.If a
Cachewith the specified name is unknown theCacheManager, one is created according to the providedConfigurationafter which it becomes managed by theCacheManager.Prior to a
Cachebeing created, the providedConfigurations is validated within the context of theCacheManagerproperties and implementation.Implementers should be aware that the
Configurationmay be used to configure otherCaches.There's no requirement on the part of a developer to call this method for each
Cachean application may use. Implementations may support the use of declarative mechanisms to pre-configureCaches, thus removing the requirement to configure them in an application. In such circumstances a developer may simply call either thegetCache(String)orgetCache(String, Class, Class)methods to acquire a previously established or pre-configuredCache.- Type Parameters:
K- the type of keyV- the type of valueC- the type of the Configuration- Parameters:
cacheName- the name of theCache. Names should not use forward slashes(/) or colons(:), or start with java. or javax. These prefixes are reserved.enable- If enable is set to true, the cache will be initialized upon its creation.configuration- aConfigurationfor theCache- Throws:
IllegalStateException- if theCacheManager#isClosed()javax.cache.CacheException- if there was an error configuring theCache, which includes trying to create a cache that already exists.IllegalArgumentException- if the configuration is invalidUnsupportedOperationException- if the configuration specifies an unsupported featureNullPointerException- if the cache configuration or name is nullSecurityException- when the operation could not be performed due to the current security settings
-
createCache
<K,V, Lutece107Cache<K,C extends javax.cache.configuration.Configuration<K, V>> V> createCache(String strCacheName, Class<K> k, Class<V> v, boolean enable, boolean preventGlobalReset) throws IllegalArgumentException Creates a namedCacheat runtime.If a
Cachewith the specified name is known to theCacheManager, a CacheException is thrown.If a
Cachewith the specified name is unknown theCacheManager, one is created according to the providedConfigurationafter which it becomes managed by theCacheManager.Prior to a
Cachebeing created, the providedConfigurations is validated within the context of theCacheManagerproperties and implementation.Implementers should be aware that the
Configurationmay be used to configure otherCaches.There's no requirement on the part of a developer to call this method for each
Cachean application may use. Implementations may support the use of declarative mechanisms to pre-configureCaches, thus removing the requirement to configure them in an application. In such circumstances a developer may simply call either thegetCache(String)orgetCache(String, Class, Class)methods to acquire a previously established or pre-configuredCache.- Type Parameters:
K- the type of keyV- the type of valueC- the type of the Configuration- Parameters:
cacheName- the name of theCache. Names should not use forward slashes(/) or colons(:), or start with java. or javax. These prefixes are reserved.enable- If enable is set to true, the cache will be initialized upon its creation.preventGlobalReset- If set to true, the cache will not be reset by global cache resets, like resetAllconfiguration- aConfigurationfor theCache- Throws:
IllegalStateException- if theCacheManager#isClosed()javax.cache.CacheException- if there was an error configuring theCache, which includes trying to create a cache that already exists.IllegalArgumentException- if the configuration is invalidUnsupportedOperationException- if the configuration specifies an unsupported featureNullPointerException- if the cache configuration or name is nullSecurityException- when the operation could not be performed due to the current security settings
-
getCache
Looks up a managedCachegiven its name.Use this method to check runtime key and value types.
Use
getCache(String)where this check is not required.Implementations must ensure that the key and value types are the same as those configured for the
Cacheprior to returning from this method.Implementations may further perform type checking on mutative cache operations and throw a
ClassCastExceptionif these checks fail.Implementations that support declarative mechanisms for pre-configuring
Caches may return a pre-configuredCacheinstead ofnull.- Type Parameters:
K- the type of keyV- the type of value- Parameters:
cacheName- the name of the managedCacheto acquirekeyType- the expectedClassof the keyvalueType- the expectedClassof the value- Returns:
- the Cache or null if it does exist or can't be pre-configured
- Throws:
IllegalStateException- if theCacheManageris#isClosed()ClassCastException- if the specified key and/or value types are incompatible with the configured cache.NullPointerException- if either keyType or classType is null.SecurityException- when the operation could not be performed due to the current security settings
-
getCache
Looks up a managedCachegiven its name.- Type Parameters:
K- the type of keyV- the type of value- Parameters:
cacheName- the name of the managedCacheto acquire- Returns:
- the Cache or null if it does exist or can't be pre-configured
- Throws:
IllegalStateException- if theCacheManageris#isClosed()ClassCastException- if the specified key and/or value types are incompatible with the configured cache.NullPointerException- if either keyType or classType is null.SecurityException- when the operation could not be performed due to the current security settings
-