|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.appserv.web.cache.filter.CachingFilter
public class CachingFilter
| Constructor Summary | |
|---|---|
CachingFilter()
|
|
| Method Summary | |
|---|---|
void |
cacheManagerDisabled()
cache manager listener method |
void |
cacheManagerEnabled()
cache manager listener method |
void |
destroy()
Called by the web container to indicate to a filter that it is being taken out of service. |
void |
doFilter(javax.servlet.ServletRequest srequest,
javax.servlet.ServletResponse sresponse,
javax.servlet.FilterChain chain)
The doFilter method of the Filter is called by the
container each time a request/response pair is passed through the
chain due to a client request for a resource at the end of the chain. |
void |
init(javax.servlet.FilterConfig filterConfig)
Called by the web container to indicate to a filter that it is being placed into service. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CachingFilter()
| Method Detail |
|---|
public void init(javax.servlet.FilterConfig filterConfig)
throws javax.servlet.ServletException
init in interface javax.servlet.FilterfilterConfig - filter config
javax.servlet.ServletException
public void doFilter(javax.servlet.ServletRequest srequest,
javax.servlet.ServletResponse sresponse,
javax.servlet.FilterChain chain)
throws java.io.IOException,
javax.servlet.ServletException
doFilter method of the Filter is called by the
container each time a request/response pair is passed through the
chain due to a client request for a resource at the end of the chain.
The FilterChain passed in to this method allows the Filter to pass on
the request and response to the next entity in the chain.
doFilter in interface javax.servlet.Filtersrequest - the runtime requestsresponse - the runtime responsechain - the filter chain to in the request processing
IOException, - ServletException
- First check if this HTTP method permits caching (using helper)
if not, call the downstream filter and return.
- Otherwise, get the key based on the request (using helper).
- Check if we have a response entry in the cache already.
- If there is entry and is valid, write out the response from that
entry.
- create a CachingResponse and CachingOutputStream wrappers and call
the downstream filter
java.io.IOException
javax.servlet.ServletExceptionpublic void cacheManagerEnabled()
cacheManagerEnabled in interface CacheManagerListenerpublic void cacheManagerDisabled()
cacheManagerDisabled in interface CacheManagerListenerpublic void destroy()
destroy in interface javax.servlet.Filter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||