|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.riotfamily.cachius.spring.CacheableControllerHandlerAdapter
public class CacheableControllerHandlerAdapter
Adapter that handles cacheable controllers
.
The adapter checks if a Controller is cacheable and whether there is
an up-to-date cache item which can be served. If not, the controller's
handleRequest()
method is invoked and the output is captured
and written to the cache.
Since 6.5 the adapter does no longer support regular controllers. In order
to support both cacheable and non-cacheable controllers you have to add
a SimpleControllerHandlerAdapter
to your context manually.
Field Summary |
---|
Fields inherited from interface org.springframework.core.Ordered |
---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
Constructor Summary | |
---|---|
CacheableControllerHandlerAdapter(CacheService cacheService)
|
|
CacheableControllerHandlerAdapter(CacheService cacheService,
CacheKeyAugmentor cacheKeyAugmentor)
|
Method Summary | |
---|---|
protected String |
getCacheKey(CacheableController controller,
HttpServletRequest request)
|
long |
getLastModified(HttpServletRequest request,
Object handler)
Returns the lastModified date as reported by the CacheService. |
int |
getOrder()
Returns the order in which this HandlerAdapter is processed. |
ModelAndView |
handle(HttpServletRequest request,
HttpServletResponse response,
Object handler)
|
void |
setApplicationContext(ApplicationContext context)
|
void |
setCacheKeyAugmentor(CacheKeyAugmentor cacheKeyAugmentor)
|
void |
setOrder(int order)
Set the order in which this HandlerAdapter is processed. |
boolean |
supports(Object handler)
Returns true if handler implements the
CacheableController interface. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CacheableControllerHandlerAdapter(CacheService cacheService)
public CacheableControllerHandlerAdapter(CacheService cacheService, CacheKeyAugmentor cacheKeyAugmentor)
Method Detail |
---|
public int getOrder()
getOrder
in interface Ordered
public void setOrder(int order)
public void setApplicationContext(ApplicationContext context)
setApplicationContext
in interface ApplicationContextAware
public void setCacheKeyAugmentor(CacheKeyAugmentor cacheKeyAugmentor)
public boolean supports(Object handler)
true
if handler implements the
CacheableController
interface.
supports
in interface HandlerAdapter
public final ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception
handle
in interface HandlerAdapter
Exception
public final long getLastModified(HttpServletRequest request, Object handler)
getLastModified
in interface HandlerAdapter
protected final String getCacheKey(CacheableController controller, HttpServletRequest request)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |