public final class ObjectCaches extends Object
This class provides the following services:
ObjectCache
.
Modifier and Type | Method and Description |
---|---|
static <K,V> ObjectCache<K,V> |
chain(ObjectCache<K,V> level1,
ObjectCache<K,V> level2)
Create a two level cache, operates as a level1 cache that is willing to obtain values from a
(usually shared) level2 cache.
|
static <K,V> ObjectCache<K,V> |
create(Hints hints)
Utility method used to produce cache based on provide Hint
|
static <K,V> ObjectCache<K,V> |
create(String policy,
int size)
Utility method used to produce an ObjectCache.
|
static String |
toKey(Citation citation,
String code)
Produce a good key based on the privided citaiton and code.
|
static Object |
toKey(Citation citation,
String code1,
String code2)
Produce a good key based on a pair of codes.
|
public static <K,V> ObjectCache<K,V> chain(ObjectCache<K,V> level1, ObjectCache<K,V> level2)
This functionality is used to tie two ObjectCache implementations together (allowing them
to collaborate while focusing on different use cases). The real world example of chaining is
in AbstractFindableAuthorityFactory
in which:
public static <K,V> ObjectCache<K,V> create(Hints hints) throws FactoryRegistryException
FactoryRegistryException
public static <K,V> ObjectCache<K,V> create(String policy, int size)
policy
- One of "weak", "all", "none", "soft"size
- Used to indicate requested size, exact use depends on policyHints.BUFFER_POLICY
public static String toKey(Citation citation, String code)
code
- CodeCopyright © 1996–2022 Geotools. All rights reserved.