@Deprecated public final class CacheUtil extends Object
This class wanted to be Cache when it was grown up. Currently it's actually just a nested ConcurrentMap, and thus has fairly limited real value.
The usage of static methods here, instead of an (OSGi) "service"
(dependency inject-able in tests!) makes it impossible to easily properly
use code relying on this in component tests (as there would be no automatic
reset between tests; you would have to manually destroyCache(String)
@Before each test).
This class' "static" Singleton doesn't play nice with OSGi e.g. for hot reload.
This class' (necessary) use <?> generics causes @SuppressWarnings("unchecked") when used.
Perhaps you would like to use Google Guava's simple Caches, if not a full blown JSR 107 javax.cache (JCache) implementation, such as Infinispan or Ehcache, instead of this class?
Modifier and Type | Method and Description |
---|---|
static void |
createCache(String cacheName)
Deprecated.
|
static void |
destroyCache(String cacheName)
Deprecated.
|
static ConcurrentMap<?,?> |
getCache(String cacheName)
Deprecated.
|
static boolean |
isCacheValid(String cacheName)
Deprecated.
|
public static ConcurrentMap<?,?> getCache(String cacheName)
public static void createCache(String cacheName)
public static boolean isCacheValid(String cacheName)
public static void destroyCache(String cacheName)
Copyright © 2019 OpenDaylight. All rights reserved.