|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.wanghy.cache.key.HashCodeCacheKeyGenerator
Generates the key for a cache entry using the hashCode of the intercepted method and its arguments.
Field Summary | |
private boolean |
generateArgumentHashCode
Flag that indicates if this generator should generate the hash code of the arguments passed to the method to apply caching to. |
Constructor Summary | |
HashCodeCacheKeyGenerator()
Constructor. |
|
HashCodeCacheKeyGenerator(boolean generateArgumentHashCode)
Constructor. |
Method Summary | |
CacheKey |
generateKey(MethodInvocation methodInvocation)
Generates the key for a cache entry. |
protected int |
getMethodArgumentHashCode(Object methodArgument)
Returns the hash code of the specified method argument. |
void |
setGenerateArgumentHashCode(boolean generateArgumentHashCode)
Setter for the field . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private boolean generateArgumentHashCode
false
,
this generator uses the default hash code of the arguments.
Constructor Detail |
public HashCodeCacheKeyGenerator()
public HashCodeCacheKeyGenerator(boolean generateArgumentHashCode)
generateArgumentHashCode
- the new value for generateArgumentHashCode
.Method Detail |
public final CacheKey generateKey(MethodInvocation methodInvocation)
CacheKeyGenerator
generateKey
in interface CacheKeyGenerator
methodInvocation
- the description of an invocation to the intercepted method.
CacheKeyGenerator.generateKey(MethodInvocation)
protected final int getMethodArgumentHashCode(Object methodArgument)
methodArgument
- the method argument.
public final void setGenerateArgumentHashCode(boolean generateArgumentHashCode)
generateArgumentHashCode
.
generateArgumentHashCode
- the new value to set
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |