com.faunos.util.net.http
Class NotFoundResponseFactory

java.lang.Object
  extended by com.faunos.util.net.http.NotFoundResponseFactory
All Implemented Interfaces:
ResponseFactory

public class NotFoundResponseFactory
extends Object
implements ResponseFactory

A utility ResponseFactory that always returns 404 (Not Found).

Author:
Babak Farhang

Field Summary
static ResponseFactory INSTANCE
          Since the base class is stateless, a global instance is provided.
 
Constructor Summary
NotFoundResponseFactory()
           
 
Method Summary
 Stagelet getResponse(RequestHeader request, StageletStack stack, boolean asynchHint)
          Returns a response stagelet for the given request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final ResponseFactory INSTANCE
Since the base class is stateless, a global instance is provided.

Constructor Detail

NotFoundResponseFactory

public NotFoundResponseFactory()
Method Detail

getResponse

public Stagelet getResponse(RequestHeader request,
                            StageletStack stack,
                            boolean asynchHint)
Description copied from interface: ResponseFactory
Returns a response stagelet for the given request. At minimum, the implementation returns a header stage that writes out the HTTP response headers. More typically, the returned stagelet will itself be only responsible for writing the response content; for the HTTP response headers, it will first push a ResponseHeaderStage on the given stack. (Per the stagelet contract, it must wait to push this header stage after its init method is invoked.

Specified by:
getResponse in interface ResponseFactory
stack - if the returned stagelet is itself stack-aware, then it will push additional stagelets (e.g. the header response stage) onto the given stack. The rules for when and how stagelets can be pushed on the stack are described in the Stagelet interface.
asynchHint - if true, then the response stagelet should try to process non-network I/O based tasks asynchronously.
See Also:
Stagelet, HandletContext.processAsynch()


SourceForge.net Logo