public final class ObjectCaches extends Object
This class provides the following services:
ObjectCache
.
Modifier and Type | Method and Description |
---|---|
static ObjectCache |
chain(ObjectCache level1,
ObjectCache level2)
Create a two level cache, operates as a level1 cache that is willing to obtain values from a
(usually shared) level2 cache.
|
static ObjectCache |
create(Hints hints)
Utility method used to produce cache based on provide Hint
|
static ObjectCache |
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 ObjectCache chain(ObjectCache level1, ObjectCache 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:
level1
- level2
- public static ObjectCache create(Hints hints) throws FactoryRegistryException
FactoryRegistryException
public static ObjectCache 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–2019 Geotools. All rights reserved.