public class DefaultRepositoryCache extends Object implements RepositoryCache
ConcurrentHashMap
. The simplistic nature of this cache makes it
only suitable for use with short-lived repository system sessions.Constructor and Description |
---|
DefaultRepositoryCache() |
Modifier and Type | Method and Description |
---|---|
Object |
get(RepositorySystemSession session,
Object key)
Gets the specified data from the cache.
|
void |
put(RepositorySystemSession session,
Object key,
Object data)
Puts the specified data into the cache.
|
public Object get(RepositorySystemSession session, Object key)
RepositoryCache
get
in interface RepositoryCache
session
- 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, Object key, Object data)
RepositoryCache
put
in interface RepositoryCache
session
- The repository session during which the cache is accessed, must not be null
.key
- The key to use for lookup the data with, must not be null
.data
- The data to store in the cache, may be null
.Copyright © 2010-2012 Sonatype, Inc.. All Rights Reserved.