com.sun.grizzly.standalone
Class StaticHandler

java.lang.Object
  extended by com.sun.grizzly.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 com.sun.grizzly.util.Interceptor
BREAK, CONTINUE, REQUEST_BUFFERED, REQUEST_LINE_PARSED, RESPONSE_PROCEEDED
 
Constructor Summary
StaticHandler()
           
 
Method Summary
 void attachChannel(SocketChannel socketChannel)
          Attach a SocketChannel to this object.
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()
Method Detail

attachChannel

public void attachChannel(SocketChannel socketChannel)
Attach a SocketChannel to this object.

Specified by:
attachChannel 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 © 2011 SUN Microsystems. All Rights Reserved.