|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.faunos.util.net.http.AbstractResponseFactory
public abstract class AbstractResponseFactory
A skeletal implementation of a ResponseFactory that honors the
server's asynchHint. Instead of implementing ResponseFactory.getResponse(RequestHeader, StageletStack, boolean)
, a
subclass implements prepareResponseImpl(RequestHeader, StageletStack)
: asynchronous processing
hints (i.e. when the asynchHint parameter in a getResponse
invocation is true) are automatically handled by returning a
AsynchStagelet that asynchronously calls prepareResponseImpl
on
init.
prepareResponseImpl(RequestHeader, StageletStack)
Constructor Summary | |
---|---|
AbstractResponseFactory()
|
Method Summary | |
---|---|
protected Stagelet |
badRequest(RequestHeader request,
StageletStack stack)
|
Stagelet |
getResponse(RequestHeader request,
StageletStack stack,
boolean asynchHint)
Returns the implementation-specific stagelet. |
protected Stagelet |
notFound(RequestHeader request,
StageletStack stack)
|
protected abstract Stagelet |
prepareResponseImpl(RequestHeader request,
StageletStack stack)
Returns the factory-specific (i.e. |
protected String |
urlDecode(String value)
URL-decodes and returns the given value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractResponseFactory()
Method Detail |
---|
public Stagelet getResponse(RequestHeader request, StageletStack stack, boolean asynchHint)
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.Stagelet
,
HandletContext.processAsynch()
protected abstract Stagelet prepareResponseImpl(RequestHeader request, StageletStack stack)
protected Stagelet notFound(RequestHeader request, StageletStack stack)
protected Stagelet badRequest(RequestHeader request, StageletStack stack)
protected final String urlDecode(String value)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |