org.loom.interceptor
Class CacheInterceptor
java.lang.Object
org.loom.interceptor.CacheInterceptor
- All Implemented Interfaces:
- ExecuteInterceptor, Interceptor, ResolutionInterceptor
public class CacheInterceptor
- extends java.lang.Object
- implements ExecuteInterceptor, ResolutionInterceptor
Intercepts requests and invoke the associated method to get the Cache information.
If the browser cached data is ok, returns a 304 and interupts the workflow, else
let the event execute normally.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CacheInterceptor
public CacheInterceptor()
beforeExecute
public Resolution beforeExecute(ParsedAction action)
- Specified by:
beforeExecute
in interface ExecuteInterceptor
- Parameters:
action
- the action and event that is being executed
- Returns:
- if return value != null, stops the execution of
the workflow and return the provided resolution
calculateCacheControl
protected CacheControl calculateCacheControl(ParsedAction action)
- Execute the method to retrieve the CacheControl instance.
- Parameters:
action
- the current action
- Returns:
- the CacheControl instance.
beforeResolution
public void beforeResolution(ParsedAction action,
Resolution resolution)
- Description copied from interface:
ResolutionInterceptor
- Gets invoked before resolution.resolve()
- Specified by:
beforeResolution
in interface ResolutionInterceptor
- Parameters:
action
- the action and event that is being executedresolution
- the action and event that is being executed
getCacheMethod
public java.lang.reflect.Method getCacheMethod()
setCacheMethod
public void setCacheMethod(java.lang.reflect.Method cacheMethod)