juju.reattore.server.intercept.impl
Class CachingInterceptor

java.lang.Object
  |
  +--juju.reattore.server.intercept.impl.CachingInterceptor
All Implemented Interfaces:
Cache, Interceptor

public class CachingInterceptor
extends java.lang.Object
implements Interceptor, Cache

Interceptor that may cache the response from a lower level interceptor.

See Also:
Cache, CachableSource

Constructor Summary
CachingInterceptor()
           
 
Method Summary
 void addChild(Interceptor child)
          Set the child to cache.
 boolean onClose(CachableSource so)
          Called by a registered source when the source is about to be closed.
 boolean process(HttpRequest req, HttpResponse resp)
          Process an incoming HTTP request if possible, filling in the given response as it goes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachingInterceptor

public CachingInterceptor()
Method Detail

addChild

public void addChild(Interceptor child)
Set the child to cache.

Parameters:
child - The child tree to wrap.

onClose

public boolean onClose(CachableSource so)
Description copied from interface: Cache
Called by a registered source when the source is about to be closed. The cache can cancel the close.

Specified by:
onClose in interface Cache
Parameters:
so - The calling source.
Returns:
true if the close should proceed, false if the source has been pulled into the cache.
See Also:
Cache

process

public boolean process(HttpRequest req,
                       HttpResponse resp)
Description copied from interface: Interceptor
Process an incoming HTTP request if possible, filling in the given response as it goes. An interceptor may have side effects without actually performing the main processing and may pass it on to another interceptor. A authentication interceptor is a good example.

Specified by:
process in interface Interceptor
Parameters:
req - HTTP request to process
resp - Response to fill in
Returns:
true if the request was recognised and processed.
See Also:
Interceptor


Copyright © 2002-2003 Michael Hope. All Rights Reserved.