com.googlecode.ehcache.annotations.resolver
Class DefaultCacheResolverFactory

java.lang.Object
  extended by com.googlecode.ehcache.annotations.resolver.DefaultCacheResolverFactory
All Implemented Interfaces:
CacheResolverFactory

public class DefaultCacheResolverFactory
extends java.lang.Object
implements CacheResolverFactory

Cache resolver that simply looks up the specified caches by name and returns SingletonCacheableCacheResolver or SingletonTriggersRemoveCacheResolver instances.

Version:
$Revision: 659 $
Author:
Eric Dalquist

Nested Class Summary
protected static class DefaultCacheResolverFactory.SelfPopulatingCacheTracker
           
 
Field Summary
protected  org.slf4j.Logger logger
          Logger available to subclasses.
 
Constructor Summary
DefaultCacheResolverFactory(net.sf.ehcache.CacheManager cacheManager)
           
 
Method Summary
protected  DefaultCacheResolverFactory.SelfPopulatingCacheTracker createSelfPopulatingCache(net.sf.ehcache.Ehcache cache, int timeout, DecoratedCacheType type, long refreshinterval)
          Create a new SelfPopulatingCache and corresponding CacheEntryFactory
protected  DefaultCacheResolverFactory.SelfPopulatingCacheTracker createSelfPopulatingCacheInternal(net.sf.ehcache.Ehcache cache, int timeout, DecoratedCacheType type, long refreshinterval)
          Creates or retrieves a SelfPopulatingCacheTracker for the specified cache depending on the configured SelfPopulatingCacheScope
protected  net.sf.ehcache.Ehcache getCache(java.lang.String cacheName)
           
protected  net.sf.ehcache.CacheManager getCacheManager()
           
 CacheableCacheResolver getCacheResolver(Cacheable cacheable, java.lang.reflect.Method method)
          Get a resolver for the specified annotation and annotated method
 TriggersRemoveCacheResolver getCacheResolver(TriggersRemove triggersRemove, java.lang.reflect.Method method)
          Get a resolver for the specified annotation and annotated method
 boolean isCreateCaches()
           
 void setCreateCaches(boolean createCaches)
           
 void setExecutor(org.springframework.scheduling.SchedulingTaskExecutor executor)
           
 void setScheduler(TaskSchedulerAdapter scheduler)
           
 void setSelfPopulatingCacheScope(SelfPopulatingCacheScope selfPopulatingCacheScope)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.slf4j.Logger logger
Logger available to subclasses.

Constructor Detail

DefaultCacheResolverFactory

public DefaultCacheResolverFactory(net.sf.ehcache.CacheManager cacheManager)
Method Detail

setScheduler

public void setScheduler(TaskSchedulerAdapter scheduler)

setExecutor

public void setExecutor(org.springframework.scheduling.SchedulingTaskExecutor executor)

isCreateCaches

public boolean isCreateCaches()

setCreateCaches

public void setCreateCaches(boolean createCaches)

setSelfPopulatingCacheScope

public void setSelfPopulatingCacheScope(SelfPopulatingCacheScope selfPopulatingCacheScope)

getCacheManager

protected net.sf.ehcache.CacheManager getCacheManager()

getCacheResolver

public CacheableCacheResolver getCacheResolver(Cacheable cacheable,
                                               java.lang.reflect.Method method)
Description copied from interface: CacheResolverFactory
Get a resolver for the specified annotation and annotated method

Specified by:
getCacheResolver in interface CacheResolverFactory

getCacheResolver

public TriggersRemoveCacheResolver getCacheResolver(TriggersRemove triggersRemove,
                                                    java.lang.reflect.Method method)
Description copied from interface: CacheResolverFactory
Get a resolver for the specified annotation and annotated method

Specified by:
getCacheResolver in interface CacheResolverFactory

getCache

protected net.sf.ehcache.Ehcache getCache(java.lang.String cacheName)

createSelfPopulatingCacheInternal

protected final DefaultCacheResolverFactory.SelfPopulatingCacheTracker createSelfPopulatingCacheInternal(net.sf.ehcache.Ehcache cache,
                                                                                                         int timeout,
                                                                                                         DecoratedCacheType type,
                                                                                                         long refreshinterval)
Creates or retrieves a SelfPopulatingCacheTracker for the specified cache depending on the configured SelfPopulatingCacheScope

Parameters:
cache - The cache to create a self populating instance of
Returns:
The SelfPopulatingCache and corresponding factory object to use

createSelfPopulatingCache

protected DefaultCacheResolverFactory.SelfPopulatingCacheTracker createSelfPopulatingCache(net.sf.ehcache.Ehcache cache,
                                                                                           int timeout,
                                                                                           DecoratedCacheType type,
                                                                                           long refreshinterval)
Create a new SelfPopulatingCache and corresponding CacheEntryFactory



Copyright © 2011. All Rights Reserved.