public final class DefaultRepositoryCache extends java.lang.Object implements RepositoryCache
| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<java.lang.Object,java.lang.Object> |
cache |
| Constructor and Description |
|---|
DefaultRepositoryCache() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
get(RepositorySystemSession session,
java.lang.Object key)
Gets the specified data from the cache.
|
void |
put(RepositorySystemSession session,
java.lang.Object key,
java.lang.Object data)
Puts the specified data into the cache.
|
public java.lang.Object get(RepositorySystemSession session, java.lang.Object key)
RepositoryCacheWarning: The cache will directly return the saved reference. If the cached data is to be modified after its retrieval, the caller is responsible to create a copy of the returned data and use this instead of the cache record.
get in interface RepositoryCachesession - The repository session during which the cache is accessed, must not be null.key - The key to use for lookup of the data, must not be null.null if none was present in the cache.public void put(RepositorySystemSession session, java.lang.Object key, java.lang.Object data)
RepositoryCacheWarning: The cache will directly save the provided reference. If the cached data is mutable, i.e. could be modified after being put into the cache, the caller is responsible for creating a copy of the original data and store the copy in the cache.
put in interface RepositoryCachesession - The repository session during which the cache is accessed, must not be null.key - The key to use for lookup of the data, must not be null.data - The data to store in the cache, may be null.