com.googlecode.ehcache.annotations.resolver
Interface CacheableCacheResolver

All Known Implementing Classes:
SingletonCacheableCacheResolver

public interface CacheableCacheResolver

Used to resolve the cache to use at runtime for Cacheable annotated methods

Version:
$Revision: 656 $
Author:
Eric Dalquist

Method Summary
 net.sf.ehcache.Ehcache resolveCache(java.io.Serializable cacheKey, org.aopalliance.intercept.MethodInvocation invocation)
          Resolve the cache to use to handle the method invocation.
 net.sf.ehcache.Ehcache resolveExceptionCache(java.io.Serializable cacheKey, org.aopalliance.intercept.MethodInvocation invocation, java.lang.Throwable t)
          Resolve the cache to use to handle an exception thrown by the method invocation.
 java.lang.ThreadLocal<org.aopalliance.intercept.MethodInvocation> resolveSelfPopulatingCacheEntryFactory(net.sf.ehcache.Ehcache cache, java.io.Serializable cacheKey, org.aopalliance.intercept.MethodInvocation invocation)
          Resolve the ThreadLocal used to handle the self-populating nature of the cache.
 

Method Detail

resolveCache

net.sf.ehcache.Ehcache resolveCache(java.io.Serializable cacheKey,
                                    org.aopalliance.intercept.MethodInvocation invocation)
Resolve the cache to use to handle the method invocation.

Parameters:
cacheKey - The key generated by the configured CacheKeyGenerator
invocation - The MethodInvocation that is being intercepted
Returns:
The cache to use for handling the invocation, must never return null.

resolveSelfPopulatingCacheEntryFactory

java.lang.ThreadLocal<org.aopalliance.intercept.MethodInvocation> resolveSelfPopulatingCacheEntryFactory(net.sf.ehcache.Ehcache cache,
                                                                                                         java.io.Serializable cacheKey,
                                                                                                         org.aopalliance.intercept.MethodInvocation invocation)
Resolve the ThreadLocal used to handle the self-populating nature of the cache. Returns null if the cache is not self-populating

Parameters:
cacheKey - The key generated by the configured CacheKeyGenerator
invocation - The MethodInvocation that is being intercepted
Returns:
The ThreadLocal to use for handling if the cache is self populating, returns null if the cache is not self populating

resolveExceptionCache

net.sf.ehcache.Ehcache resolveExceptionCache(java.io.Serializable cacheKey,
                                             org.aopalliance.intercept.MethodInvocation invocation,
                                             java.lang.Throwable t)
Resolve the cache to use to handle an exception thrown by the method invocation.

Parameters:
cacheKey - The key generated by the configured CacheKeyGenerator
invocation - The MethodInvocation that is being intercepted
t - The exception thrown by the MethodInvocation
Returns:
The cache to use for handling the exception, if null the exception will not be cached.


Copyright © 2011. All Rights Reserved.