Class StandardCacheProvider
- java.lang.Object
-
- org.opendaylight.infrautils.caches.standard.StandardCacheProvider
-
- All Implemented Interfaces:
CacheProvider
@Singleton public class StandardCacheProvider extends Object implements CacheProvider
Default standard usual ordinary habitual ;)CacheProvider
. Use this for example when writing an end2end component test and wanting to bind to "just some implementation, the usual one that will probably be available at runtime".In the future, this may be extended to allow dynamically switching out cache implementations at run-time. Therefore, all client code should refer to this instead of another specific implementation.
- Author:
- Michael Vorburger.ch
-
-
Constructor Summary
Constructors Constructor Description StandardCacheProvider(CacheManagersRegistry cacheManagersRegistry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <K,V>
Cache<K,V>newCache(CacheConfig<K,V> cacheConfig, CachePolicy initialPolicy)
Creates a brand newCache
(API with unchecked exceptions), based on the passed configuration and policy.<K,V,E extends Exception>
CheckedCache<K,V,E>newCheckedCache(CheckedCacheConfig<K,V,E> cacheConfig, CachePolicy initialPolicy)
Creates a brand newCheckedCache
(API for checked exceptions), based on the passed configuration and policy.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opendaylight.infrautils.caches.CacheProvider
newCache, newCheckedCache
-
-
-
-
Constructor Detail
-
StandardCacheProvider
@Inject public StandardCacheProvider(CacheManagersRegistry cacheManagersRegistry)
-
-
Method Detail
-
newCache
public <K,V> Cache<K,V> newCache(CacheConfig<K,V> cacheConfig, CachePolicy initialPolicy)
Description copied from interface:CacheProvider
Creates a brand newCache
(API with unchecked exceptions), based on the passed configuration and policy. It is the caller's responsibility toAutoCloseable.close()
a Cache obtained from this when they stop.- Specified by:
newCache
in interfaceCacheProvider
-
newCheckedCache
public <K,V,E extends Exception> CheckedCache<K,V,E> newCheckedCache(CheckedCacheConfig<K,V,E> cacheConfig, CachePolicy initialPolicy)
Description copied from interface:CacheProvider
Creates a brand newCheckedCache
(API for checked exceptions), based on the passed configuration and policy. It is the caller's responsibility toAutoCloseable.close()
a Cache obtained from this when they stop.- Specified by:
newCheckedCache
in interfaceCacheProvider
-
-