org.loom.interceptor
Class CacheInterceptor

java.lang.Object
  extended by 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.


Constructor Summary
CacheInterceptor()
           
 
Method Summary
 Resolution beforeExecute(ParsedAction action)
           
 void beforeResolution(ParsedAction action, Resolution resolution)
          Gets invoked before resolution.resolve()
protected  CacheControl calculateCacheControl(ParsedAction action)
          Execute the method to retrieve the CacheControl instance.
 java.lang.reflect.Method getCacheMethod()
           
 void setCacheMethod(java.lang.reflect.Method cacheMethod)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheInterceptor

public CacheInterceptor()
Method Detail

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 executed
resolution - the action and event that is being executed

getCacheMethod

public java.lang.reflect.Method getCacheMethod()

setCacheMethod

public void setCacheMethod(java.lang.reflect.Method cacheMethod)