public class ThreadSafeCacheHolder<T extends Serializable> extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected ReentrantReadWriteLock |
cacheLock |
protected Map<String,T> |
cacheMap |
static int |
DEFAULT_SIZE |
Constructor and Description |
---|
ThreadSafeCacheHolder() |
ThreadSafeCacheHolder(int maxSize) |
Modifier and Type | Method and Description |
---|---|
void |
addToCache(DocumentModel doc,
String key,
T value) |
void |
addToCache(DocumentRef docRef,
String key,
T value) |
void |
addToCache(String key,
T value) |
protected void |
doAdd(String key,
T value) |
protected T |
doGet(String key) |
protected void |
doRemove(String key) |
T |
getFromCache(DocumentModel doc,
String key) |
T |
getFromCache(DocumentRef docRef,
String key) |
T |
getFromCache(String key) |
protected String |
getKey(DocumentModel doc,
String key) |
protected String |
getKey(DocumentRef docRef,
String key) |
void |
removeFromCache(DocumentModel doc,
String key) |
void |
removeFromCache(DocumentRef docRef,
String key) |
void |
removeFromCache(String key) |
public static final int DEFAULT_SIZE
protected final Map<String,T extends Serializable> cacheMap
protected final ReentrantReadWriteLock cacheLock
public ThreadSafeCacheHolder()
public ThreadSafeCacheHolder(int maxSize)
protected String getKey(DocumentRef docRef, String key)
protected String getKey(DocumentModel doc, String key)
public void addToCache(String key, T value)
public void addToCache(DocumentRef docRef, String key, T value)
public void addToCache(DocumentModel doc, String key, T value)
public T getFromCache(String key)
public T getFromCache(DocumentRef docRef, String key)
public T getFromCache(DocumentModel doc, String key)
public void removeFromCache(DocumentRef docRef, String key)
public void removeFromCache(DocumentModel doc, String key)
public void removeFromCache(String key)
Copyright © 2018 Nuxeo. All rights reserved.