| Modifier and Type | Class and Description |
|---|---|
private class |
GenericCacheThreadsave.Index<T> |
| Modifier and Type | Field and Description |
|---|---|
private Map<String,GenericCacheThreadsave.Index<T>> |
attribName2Index |
private Map<String,Method> |
attribName2Method |
private ReadWriteLock |
lock |
private static org.apache.log4j.Logger |
logger |
private String |
primaryKeyAttributeName |
private boolean |
weakRefs |
| Constructor and Description |
|---|
GenericCacheThreadsave(Class<T> clazz)
Creates a new GenericCache for the specified type
|
GenericCacheThreadsave(Class<T> clazz,
boolean weakRefs) |
| Modifier and Type | Method and Description |
|---|---|
<C> CacheFinder<T,C> |
createCacheFinder(String attributeName) |
void |
fillCache(List<T> cacheables)
Fills the cache with the listed cacheables
|
void |
fillCache(T cacheable)
Adds the speciafied cacheable to the cache
|
Collection<T> |
findForKey(String attributeName,
Object key) |
Collection<T> |
findForKeys(String attributeName,
Collection<? extends Object> keys) |
Collection<T> |
getAllFromCache() |
void |
removeFromCache(Collection<T> cacheables) |
void |
removeFromCache(T cacheable2Remove) |
private static final org.apache.log4j.Logger logger
private final Map<String,GenericCacheThreadsave.Index<T>> attribName2Index
private String primaryKeyAttributeName
private final boolean weakRefs
private final ReadWriteLock lock
public void fillCache(List<T> cacheables) throws IllegalAccessException, InvocationTargetException
fillCache in interface Cache<T>cacheables - list of cacheablesIllegalAccessExceptionInvocationTargetExceptionpublic void fillCache(T cacheable) throws IllegalAccessException, InvocationTargetException
fillCache in interface Cache<T>cacheable - cacheable to be addedIllegalAccessExceptionInvocationTargetExceptionpublic void removeFromCache(Collection<T> cacheables) throws IllegalAccessException, InvocationTargetException
removeFromCache in interface Cache<T>IllegalAccessExceptionInvocationTargetExceptionpublic void removeFromCache(T cacheable2Remove) throws IllegalAccessException, InvocationTargetException
removeFromCache in interface Cache<T>IllegalAccessExceptionInvocationTargetExceptionpublic Collection<T> findForKey(String attributeName, Object key)
findForKey in interface Cache<T>public Collection<T> findForKeys(String attributeName, Collection<? extends Object> keys)
findForKeys in interface Cache<T>public Collection<T> getAllFromCache()
getAllFromCache in interface Cache<T>public <C> CacheFinder<T,C> createCacheFinder(String attributeName)
createCacheFinder in interface Cache<T>Copyright © 2013 RapidPM. All rights reserved.