org.glassfish.grizzly.web.standalone
Class StaticHandler

java.lang.Object
  extended by org.glassfish.grizzly.web.standalone.StaticHandler
All Implemented Interfaces:
Interceptor<Request>

public class StaticHandler
extends Object
implements Interceptor<Request>

This Interceptor is invoked after the request line has been parsed.

Author:
Jeanfrancois Arcand

Field Summary
protected  FileCache fileCache
          The FileCache mechanism used to cache static resources.
 
Fields inherited from interface org.glassfish.grizzly.web.container.util.Interceptor
BREAK, CONTINUE, REQUEST_BUFFERED, REQUEST_LINE_PARSED, RESPONSE_PROCEEDED
 
Constructor Summary
StaticHandler(WebFilter webFilter)
           
 
Method Summary
 void attach(StreamReader reader, StreamWriter writer)
          The StreamReader and StreamWriter, associated with this handler.
protected  int findBytes(ByteChunk bc, byte[] b)
          Specialized utility method: find a sequence of lower case bytes inside a ByteChunk.
 int handle(Request req, int handlerCode)
          Intercept the request and decide if we cache the static resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileCache

protected FileCache fileCache
The FileCache mechanism used to cache static resources.

Constructor Detail

StaticHandler

public StaticHandler(WebFilter webFilter)
Method Detail

attach

public void attach(StreamReader reader,
                   StreamWriter writer)
The StreamReader and StreamWriter, associated with this handler.

Specified by:
attach in interface Interceptor<Request>

handle

public int handle(Request req,
                  int handlerCode)
           throws IOException
Intercept the request and decide if we cache the static resource. If the static resource is already cached, return it.

Specified by:
handle in interface Interceptor<Request>
Returns:
Throws:
IOException

findBytes

protected int findBytes(ByteChunk bc,
                        byte[] b)
Specialized utility method: find a sequence of lower case bytes inside a ByteChunk.



Copyright © 2009 SUN Microsystems. All Rights Reserved.