com.googlecode.objectify.cache
Class AsyncCacheFilter

java.lang.Object
  extended by com.googlecode.objectify.cache.AsyncCacheFilter
All Implemented Interfaces:
javax.servlet.Filter

public class AsyncCacheFilter
extends java.lang.Object
implements javax.servlet.Filter

This Filter is a companion to the CachingAsyncDatastoreService, and must be installed any time the CachingAsyncDatastoreService is used.

This Filter is a temporary measure until Google provides a hook that lets us intercept the raw Future calls at the end of a request. At that point this filter can be eliminated in favor of the hook.

In your web.xml:
       <filter>
              <filter-name>AsyncCacheFilter</filter-name>
              <filter-class>com.googlecode.objectify.cache.AsyncCacheFilter</filter-class>
      </filter>
      <filter-mapping>
              <filter-name>AsyncCacheFilter</filter-name>
              <url-pattern>/*</url-pattern>
      </filter-mapping>
Or, if you use Guice:
      filter("/*").through(AsyncCacheFilter.class);

Author:
Jeff Schnitzer

Constructor Summary
AsyncCacheFilter()
           
 
Method Summary
 void destroy()
           
 void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
           
 void init(javax.servlet.FilterConfig config)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncCacheFilter

public AsyncCacheFilter()
Method Detail

init

public void init(javax.servlet.FilterConfig config)
          throws javax.servlet.ServletException
Specified by:
init in interface javax.servlet.Filter
Throws:
javax.servlet.ServletException

destroy

public void destroy()
Specified by:
destroy in interface javax.servlet.Filter

doFilter

public void doFilter(javax.servlet.ServletRequest request,
                     javax.servlet.ServletResponse response,
                     javax.servlet.FilterChain chain)
              throws java.io.IOException,
                     javax.servlet.ServletException
Specified by:
doFilter in interface javax.servlet.Filter
Throws:
java.io.IOException
javax.servlet.ServletException


Copyright © 2011 Jeff Schnitzer and a gang of pirates. All Rights Reserved. Build version: 3.1