|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jasig.services.persondir.support.AttributeBasedCacheKeyGenerator
public class AttributeBasedCacheKeyGenerator
Generates a cache key using a hash of the AttributeBasedCacheKeyGenerator.CachableMethod being called and for
IPersonAttributeDao.getMultivaluedUserAttributes(String) and
IPersonAttributeDao.getUserAttributes(String) the String uid or for
IPersonAttributeDao.getMultivaluedUserAttributes(Map) and
IPersonAttributeDao.getUserAttributes(Map) attributes from the seed Map
as specified by the cacheKeyAttributes Set
| Nested Class Summary | |
|---|---|
static class |
AttributeBasedCacheKeyGenerator.CachableMethod
Methods on IPersonAttributeDao that are cachable |
| Field Summary | |
|---|---|
protected org.apache.commons.logging.Log |
logger
|
| Constructor Summary | |
|---|---|
AttributeBasedCacheKeyGenerator()
|
|
| Method Summary | |
|---|---|
Serializable |
generateKey(org.aopalliance.intercept.MethodInvocation methodInvocation)
|
Set<String> |
getCacheKeyAttributes()
|
String |
getDefaultAttributeName()
|
protected Integer |
getKeyHash(Map<String,Object> seed)
Gets the hash of the key elements from the seed Map. |
protected Map<String,Object> |
getSeed(Object[] methodArguments,
AttributeBasedCacheKeyGenerator.CachableMethod cachableMethod)
Get the see Map that was passed to the AttributeBasedCacheKeyGenerator.CachableMethod. |
boolean |
isIgnoreEmptyAttributes()
|
boolean |
isUseAllAttributes()
|
protected AttributeBasedCacheKeyGenerator.CachableMethod |
resolveCacheableMethod(org.aopalliance.intercept.MethodInvocation methodInvocation)
Iterates over the AttributeBasedCacheKeyGenerator.CachableMethod instances to determine which instance the
passed MethodInvocation applies to. |
void |
setCacheKeyAttributes(Set<String> cacheKeyAttributes)
|
void |
setDefaultAttributeName(String defaultAttributeName)
|
void |
setIgnoreEmptyAttributes(boolean ignoreEmptyAttributes)
If seed attributes with empty values (null, empty string or empty list values) should be ignored when generating the cache key. |
void |
setUseAllAttributes(boolean useAllAttributes)
If all seed attributes should be used. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final org.apache.commons.logging.Log logger
| Constructor Detail |
|---|
public AttributeBasedCacheKeyGenerator()
| Method Detail |
|---|
public Set<String> getCacheKeyAttributes()
public void setCacheKeyAttributes(Set<String> cacheKeyAttributes)
cacheKeyAttributes - the cacheKeyAttributes to setpublic String getDefaultAttributeName()
public void setDefaultAttributeName(String defaultAttributeName)
defaultAttributeName - the defaultAttributeName to setpublic boolean isUseAllAttributes()
public void setUseAllAttributes(boolean useAllAttributes)
public boolean isIgnoreEmptyAttributes()
public void setIgnoreEmptyAttributes(boolean ignoreEmptyAttributes)
public Serializable generateKey(org.aopalliance.intercept.MethodInvocation methodInvocation)
generateKey in interface org.springmodules.cache.key.CacheKeyGenerator
protected Map<String,Object> getSeed(Object[] methodArguments,
AttributeBasedCacheKeyGenerator.CachableMethod cachableMethod)
Map that was passed to the AttributeBasedCacheKeyGenerator.CachableMethod. For AttributeBasedCacheKeyGenerator.CachableMethods that
take String arguments this method is responsible for converting it into a Map using the
defaultAttributeName.
methodArguments - The method argumentscachableMethod - The targeted cachable method
protected Integer getKeyHash(Map<String,Object> seed)
Map. The key elements are specified by
the cacheKeyAttributes Set or if it is null the
defaultAttributeName is used as the key attribute.
protected AttributeBasedCacheKeyGenerator.CachableMethod resolveCacheableMethod(org.aopalliance.intercept.MethodInvocation methodInvocation)
AttributeBasedCacheKeyGenerator.CachableMethod instances to determine which instance the
passed MethodInvocation applies to.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||