|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.faunos.util.net.http.ResponseFactorySwitch
public class ResponseFactorySwitch
A thread-safe, ResponseFactory configuration utility.
ResponseFactoryConfig
Constructor Summary | |
---|---|
ResponseFactorySwitch()
|
Method Summary | |
---|---|
ResponseFactory |
addMapping(String path,
ResponseFactory factory)
Adds the given URI path-to-factory mapping to the current mappings and returns the previous mapped factory, if any. |
void |
addMappings(Map<String,ResponseFactory> mappings)
Adds the given URI path-to-factory mappings to the current mappings. |
ResponseFactory |
getMapping(String path)
Returns the ResponseFactory mapped to the specified path, or null, if nothing is mapped to that path. |
SortedMap<String,ResponseFactory> |
getMappings()
Returns a read-only snapshot of the current path-to-factory mappings. |
Stagelet |
getResponse(RequestHeader request,
StageletStack stack,
boolean asynchHint)
Returns a response stagelet for the given request. |
ResponseFactory |
removeMapping(String path)
Removes the mapping for specified path and returns the old mapped ResponseFactory, if any; null otherwise. |
void |
setMappings(Map<String,ResponseFactory> mappings)
Sets the URI path-to-factory mappings. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResponseFactorySwitch()
Method Detail |
---|
public Stagelet getResponse(RequestHeader request, StageletStack stack, boolean asynchHint)
ResponseFactory
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()
public void setMappings(Map<String,ResponseFactory> mappings)
ResponseFactoryConfig
setMappings
in interface ResponseFactoryConfig
public void addMappings(Map<String,ResponseFactory> mappings)
ResponseFactoryConfig
addMappings
in interface ResponseFactoryConfig
public ResponseFactory addMapping(String path, ResponseFactory factory)
ResponseFactoryConfig
addMapping
in interface ResponseFactoryConfig
public ResponseFactory removeMapping(String path)
ResponseFactoryConfig
removeMapping
in interface ResponseFactoryConfig
public ResponseFactory getMapping(String path)
ResponseFactoryConfig
getMapping
in interface ResponseFactoryConfig
public SortedMap<String,ResponseFactory> getMappings()
ResponseFactoryConfig
getMappings
in interface ResponseFactoryConfig
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |