com.googlecode.ehcache.annotations.resolver
Class SingletonCacheableCacheResolver

java.lang.Object
  extended by com.googlecode.ehcache.annotations.resolver.SingletonCacheableCacheResolver
All Implemented Interfaces:
CacheableCacheResolver

public class SingletonCacheableCacheResolver
extends java.lang.Object
implements CacheableCacheResolver

Resolver that returns the Ehcaches provided to the constructor, no resolution logic is performed.

Version:
$Revision: 656 $
Author:
Eric Dalquist

Constructor Summary
SingletonCacheableCacheResolver(net.sf.ehcache.Ehcache cache, java.lang.ThreadLocal<org.aopalliance.intercept.MethodInvocation> selfPopulatingEntryFactory)
           
SingletonCacheableCacheResolver(net.sf.ehcache.Ehcache cache, java.lang.ThreadLocal<org.aopalliance.intercept.MethodInvocation> selfPopulatingEntryFactory, net.sf.ehcache.Ehcache exceptionCache)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingletonCacheableCacheResolver

public SingletonCacheableCacheResolver(net.sf.ehcache.Ehcache cache,
                                       java.lang.ThreadLocal<org.aopalliance.intercept.MethodInvocation> selfPopulatingEntryFactory)

SingletonCacheableCacheResolver

public SingletonCacheableCacheResolver(net.sf.ehcache.Ehcache cache,
                                       java.lang.ThreadLocal<org.aopalliance.intercept.MethodInvocation> selfPopulatingEntryFactory,
                                       net.sf.ehcache.Ehcache exceptionCache)
Method Detail

resolveCache

public net.sf.ehcache.Ehcache resolveCache(java.io.Serializable cacheKey,
                                           org.aopalliance.intercept.MethodInvocation invocation)
Description copied from interface: CacheableCacheResolver
Resolve the cache to use to handle the method invocation.

Specified by:
resolveCache in interface CacheableCacheResolver
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

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

Specified by:
resolveSelfPopulatingCacheEntryFactory in interface CacheableCacheResolver
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

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

Specified by:
resolveExceptionCache in interface CacheableCacheResolver
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.