public final class GraphCache extends Object
Modifier and Type | Method and Description |
---|---|
Graph |
get(String key,
Callable<Graph> callable)
Get the Graph corresponding to the specified key.
|
static int |
getExpirationTime()
Gets the expiration time for cached objects.
|
static GraphCache |
getInstance()
Get the singleton-instance.
|
List<String> |
getMatchingCacheKeys(Pattern pattern)
Gets all matching graph cache ids/keys.
|
void |
invalidate(String key)
Invalidate the object with the specified key.
|
void |
invalidateMatching(Pattern pattern)
Invalidates all graphs matching argument pattern.
|
public static GraphCache getInstance()
GraphCache
-instancepublic void invalidate(String key)
key
- The key whose Graph to invalidatepublic void invalidateMatching(Pattern pattern)
pattern
- the pattern to match for graph idspublic List<String> getMatchingCacheKeys(Pattern pattern)
pattern
- the pattern to match for graph idspublic static int getExpirationTime()
public Graph get(String key, Callable<Graph> callable) throws ExecutionException
Callable<Graph>
will be called.key
- The key for the graphcallable
- A callback to construct the graph that wasn't cachedExecutionException
- If a graph e.g. cannot be generatedCopyright © 2016–2019. All rights reserved.