|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.googlecode.ehcache.annotations.key.SpELCacheKeyGenerator
public class SpELCacheKeyGenerator
Spring Expression Language cache key generator. Usage:
@Property(key="expression" value="args[ARGUMENT_INDEX].propertyOfModel"
| Constructor Summary | |
|---|---|
SpELCacheKeyGenerator()
|
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
|
protected CacheKeyGenerator<java.io.Serializable> |
createKeyGenerator(java.lang.String name,
java.lang.Class<CacheKeyGenerator<java.io.Serializable>> keyGeneratorClass,
org.springframework.beans.MutablePropertyValues properties)
Create a new key generator with the specified name. |
protected void |
createKeyGeneratorMethodExecutors()
Add MethodExecutor wrapper around all of the registered CacheKeyGenerators to avoid
creating the wrappers on every use. |
java.io.Serializable |
generateKey(org.aopalliance.intercept.MethodInvocation methodInvocation)
Generates the key for a cache entry. |
java.io.Serializable |
generateKey(java.lang.Object... data)
Generates the key for a cache entry. |
protected org.springframework.expression.EvaluationContext |
getEvaluationContext(org.aopalliance.intercept.MethodInvocation methodInvocation,
java.lang.Object... args)
Get the EvaluationContext to use to evaluate the configured Expression |
protected org.springframework.expression.Expression |
parseExpression(java.lang.String expression)
Parse the specified String into a SpEL Expression |
protected void |
registerDefaultKeyGenerators()
Check that all CacheKeyGenerators defined in the DEFAULT_KEY_GENERATORS Map are registered
in the SpEL context as key functions. |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
|
void |
setExpression(java.lang.String expression)
The SpEL Expression evaluated to generate the cache key. |
void |
setKeyGenerators(java.util.Map<java.lang.String,CacheKeyGenerator<java.io.Serializable>> keyGenerators)
A Map of CacheKeyGenerators to register as functions on the #key object in the SpEL EvaluationContext. |
void |
setReflectionHelper(ReflectionHelper reflectionHelper)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SpELCacheKeyGenerator()
| Method Detail |
|---|
public void setExpression(java.lang.String expression)
Serializable object
public void setKeyGenerators(java.util.Map<java.lang.String,CacheKeyGenerator<java.io.Serializable>> keyGenerators)
CacheKeyGenerators to register as functions on the #key object in the SpEL EvaluationContext.
The map key is used as the function name on the #key object.
public void setReflectionHelper(ReflectionHelper reflectionHelper)
setReflectionHelper in interface ReflectionHelperAware
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
throws org.springframework.beans.BeansException
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAwareorg.springframework.beans.BeansException
public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exceptionprotected final void registerDefaultKeyGenerators()
CacheKeyGenerators defined in the DEFAULT_KEY_GENERATORS Map are registered
in the SpEL context as key functions.
protected final void createKeyGeneratorMethodExecutors()
MethodExecutor wrapper around all of the registered CacheKeyGenerators to avoid
creating the wrappers on every use.
protected CacheKeyGenerator<java.io.Serializable> createKeyGenerator(java.lang.String name,
java.lang.Class<CacheKeyGenerator<java.io.Serializable>> keyGeneratorClass,
org.springframework.beans.MutablePropertyValues properties)
public java.io.Serializable generateKey(org.aopalliance.intercept.MethodInvocation methodInvocation)
CacheKeyGenerator
generateKey in interface CacheKeyGenerator<java.io.Serializable>methodInvocation - the description of an invocation to the intercepted method.
Serializablepublic java.io.Serializable generateKey(java.lang.Object... data)
CacheKeyGenerator
generateKey in interface CacheKeyGenerator<java.io.Serializable>data - the objects to use when generating the key
Serializableprotected org.springframework.expression.Expression parseExpression(java.lang.String expression)
protected org.springframework.expression.EvaluationContext getEvaluationContext(org.aopalliance.intercept.MethodInvocation methodInvocation,
java.lang.Object... args)
EvaluationContext to use to evaluate the configured Expression
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||