Interface ILuteceCacheManager

All Known Implementing Classes:
LuteceCacheManager

public interface ILuteceCacheManager
  • Method Details

    • createCache

      <K, V, C extends javax.cache.configuration.Configuration<K, V>> Lutece107Cache<K,V> createCache(String cacheName, C configuration, boolean enable) throws IllegalArgumentException
      Creates a named Cache at runtime.

      If a Cache with the specified name is known to the CacheManager, a CacheException is thrown.

      If a Cache with the specified name is unknown the CacheManager, one is created according to the provided Configuration after which it becomes managed by the CacheManager.

      Prior to a Cache being created, the provided Configurations is validated within the context of the CacheManager properties and implementation.

      Implementers should be aware that the Configuration may be used to configure other Caches.

      There's no requirement on the part of a developer to call this method for each Cache an application may use. Implementations may support the use of declarative mechanisms to pre-configure Caches, thus removing the requirement to configure them in an application. In such circumstances a developer may simply call either the getCache(String) or getCache(String, Class, Class) methods to acquire a previously established or pre-configured Cache.

      Type Parameters:
      K - the type of key
      V - the type of value
      C - the type of the Configuration
      Parameters:
      cacheName - the name of the Cache. 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 - a Configuration for the Cache
      Throws:
      IllegalStateException - if the CacheManager #isClosed()
      javax.cache.CacheException - if there was an error configuring the Cache, which includes trying to create a cache that already exists.
      IllegalArgumentException - if the configuration is invalid
      UnsupportedOperationException - if the configuration specifies an unsupported feature
      NullPointerException - if the cache configuration or name is null
      SecurityException - when the operation could not be performed due to the current security settings
    • createCache

      <K, V> Lutece107Cache<K,V> createCache(String cacheName) throws IllegalArgumentException
      Creates a named Cache at runtime.

      If a Cache with the specified name is known to the CacheManager, a CacheException is thrown.

      If a Cache with the specified name is unknown the CacheManager, one is created according to the provided Configuration after which it becomes managed by the CacheManager.

      Prior to a Cache being created, the provided Configurations is validated within the context of the CacheManager properties and implementation.

      Implementers should be aware that the Configuration may be used to configure other Caches.

      There's no requirement on the part of a developer to call this method for each Cache an application may use. Implementations may support the use of declarative mechanisms to pre-configure Caches, thus removing the requirement to configure them in an application. In such circumstances a developer may simply call either the getCache(String) or getCache(String, Class, Class) methods to acquire a previously established or pre-configured Cache.

      Type Parameters:
      K - the type of key
      V - the type of value
      Parameters:
      cacheName - the name of the Cache. Names should not use forward slashes(/) or colons(:), or start with java. or javax. These prefixes are reserved.
      Throws:
      IllegalStateException - if the CacheManager #isClosed()
      javax.cache.CacheException - if there was an error configuring the Cache, which includes trying to create a cache that already exists.
      IllegalArgumentException - if the configuration is invalid
      UnsupportedOperationException - if the configuration specifies an unsupported feature
      NullPointerException - if the cache configuration or name is null
      SecurityException - when the operation could not be performed due to the current security settings
    • createCache

      <K, V, C extends javax.cache.configuration.Configuration<K, V>> Lutece107Cache<K,V> createCache(String cacheName, Class<K> k, Class<V> v) throws IllegalArgumentException
      Creates a named Cache at runtime.

      If a Cache with the specified name is known to the CacheManager, a CacheException is thrown.

      If a Cache with the specified name is unknown the CacheManager, one is created according to the provided Configuration after which it becomes managed by the CacheManager.

      Prior to a Cache being created, the provided Configurations is validated within the context of the CacheManager properties and implementation.

      Implementers should be aware that the Configuration may be used to configure other Caches.

      There's no requirement on the part of a developer to call this method for each Cache an application may use. Implementations may support the use of declarative mechanisms to pre-configure Caches, thus removing the requirement to configure them in an application. In such circumstances a developer may simply call either the getCache(String) or getCache(String, Class, Class) methods to acquire a previously established or pre-configured Cache.

      Type Parameters:
      K - the type of key
      V - the type of value
      C - the type of the Configuration
      Parameters:
      cacheName - the name of the Cache. Names should not use forward slashes(/) or colons(:), or start with java. or javax. These prefixes are reserved.
      configuration - a Configuration for the Cache
      Throws:
      IllegalStateException - if the CacheManager #isClosed()
      javax.cache.CacheException - if there was an error configuring the Cache, which includes trying to create a cache that already exists.
      IllegalArgumentException - if the configuration is invalid
      UnsupportedOperationException - if the configuration specifies an unsupported feature
      NullPointerException - if the cache configuration or name is null
      SecurityException - when the operation could not be performed due to the current security settings
    • createCache

      <K, V, C extends javax.cache.configuration.Configuration<K, V>> Lutece107Cache<K,V> createCache(String strCacheName, Class<K> k, Class<V> v, boolean enable) throws IllegalArgumentException
      Creates a named Cache at runtime.

      If a Cache with the specified name is known to the CacheManager, a CacheException is thrown.

      If a Cache with the specified name is unknown the CacheManager, one is created according to the provided Configuration after which it becomes managed by the CacheManager.

      Prior to a Cache being created, the provided Configurations is validated within the context of the CacheManager properties and implementation.

      Implementers should be aware that the Configuration may be used to configure other Caches.

      There's no requirement on the part of a developer to call this method for each Cache an application may use. Implementations may support the use of declarative mechanisms to pre-configure Caches, thus removing the requirement to configure them in an application. In such circumstances a developer may simply call either the getCache(String) or getCache(String, Class, Class) methods to acquire a previously established or pre-configured Cache.

      Type Parameters:
      K - the type of key
      V - the type of value
      C - the type of the Configuration
      Parameters:
      cacheName - the name of the Cache. 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 - a Configuration for the Cache
      Throws:
      IllegalStateException - if the CacheManager #isClosed()
      javax.cache.CacheException - if there was an error configuring the Cache, which includes trying to create a cache that already exists.
      IllegalArgumentException - if the configuration is invalid
      UnsupportedOperationException - if the configuration specifies an unsupported feature
      NullPointerException - if the cache configuration or name is null
      SecurityException - when the operation could not be performed due to the current security settings
    • createCache

      <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) throws IllegalArgumentException
      Creates a named Cache at runtime.

      If a Cache with the specified name is known to the CacheManager, a CacheException is thrown.

      If a Cache with the specified name is unknown the CacheManager, one is created according to the provided Configuration after which it becomes managed by the CacheManager.

      Prior to a Cache being created, the provided Configurations is validated within the context of the CacheManager properties and implementation.

      Implementers should be aware that the Configuration may be used to configure other Caches.

      There's no requirement on the part of a developer to call this method for each Cache an application may use. Implementations may support the use of declarative mechanisms to pre-configure Caches, thus removing the requirement to configure them in an application. In such circumstances a developer may simply call either the getCache(String) or getCache(String, Class, Class) methods to acquire a previously established or pre-configured Cache.

      Type Parameters:
      K - the type of key
      V - the type of value
      C - the type of the Configuration
      Parameters:
      cacheName - the name of the Cache. 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 resetAll
      configuration - a Configuration for the Cache
      Throws:
      IllegalStateException - if the CacheManager #isClosed()
      javax.cache.CacheException - if there was an error configuring the Cache, which includes trying to create a cache that already exists.
      IllegalArgumentException - if the configuration is invalid
      UnsupportedOperationException - if the configuration specifies an unsupported feature
      NullPointerException - if the cache configuration or name is null
      SecurityException - when the operation could not be performed due to the current security settings
    • getCache

      <K, V> Lutece107Cache<K,V> getCache(String cacheName, Class<K> keyType, Class<V> valueType)
      Looks up a managed Cache given 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 Cache prior to returning from this method.

      Implementations may further perform type checking on mutative cache operations and throw a ClassCastException if these checks fail.

      Implementations that support declarative mechanisms for pre-configuring Caches may return a pre-configured Cache instead of null.

      Type Parameters:
      K - the type of key
      V - the type of value
      Parameters:
      cacheName - the name of the managed Cache to acquire
      keyType - the expected Class of the key
      valueType - the expected Class of the value
      Returns:
      the Cache or null if it does exist or can't be pre-configured
      Throws:
      IllegalStateException - if the CacheManager is #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

      <K, V> Lutece107Cache<K,V> getCache(String cacheName)
      Looks up a managed Cache given its name.
      Type Parameters:
      K - the type of key
      V - the type of value
      Parameters:
      cacheName - the name of the managed Cache to acquire
      Returns:
      the Cache or null if it does exist or can't be pre-configured
      Throws:
      IllegalStateException - if the CacheManager is #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