|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectHTTPClient.RetryModule
This module handles request retries when a connection closes prematurely. It is triggered by the RetryException thrown by the StreamDemultiplexor.
This module is somewhat unique in that it doesn't strictly limit itself to the HTTPClientModule interface and its return values. That is, it sends request directly using the HTTPConnection.sendRequest() method. This is necessary because this module will not only resend its request but it also resend all other requests in the chain. Also, it rethrows the RetryException in Phase1 to restart the processing of the modules.
| Field Summary | |
static int |
CD_0
|
static int |
CD_CHUNKED
|
static int |
CD_CLOSE
|
static int |
CD_CONTLEN
|
static int |
CD_HDRS
|
static int |
CD_MP_BR
|
static int |
CD_NONE
Content delimiters |
static int |
HTTP
possible http protocols we (might) handle |
static int |
HTTP_1_0
some known http versions |
static int |
HTTP_1_1
|
static int |
HTTP_NG
|
static int |
HTTPS
|
static int |
SHTTP
|
| Fields inherited from interface HTTPClient.HTTPClientModuleConstants |
REQ_CONTINUE, REQ_NEWCON_RST, REQ_NEWCON_SND, REQ_RESPONSE, REQ_RESTART, REQ_RETURN, REQ_SHORTCIRC, RSP_CONTINUE, RSP_NEWCON_REQ, RSP_NEWCON_SND, RSP_REQUEST, RSP_RESTART, RSP_SEND, RSP_SHORTCIRC |
| Constructor Summary | |
(package private) |
RetryModule()
|
| Method Summary | |
int |
requestHandler(Request req,
Response[] resp)
Invoked by the HTTPClient. |
void |
responsePhase1Handler(Response resp,
RoRequest roreq)
Invoked by the HTTPClient. |
int |
responsePhase2Handler(Response resp,
Request req)
Invoked by the HTTPClient. |
void |
responsePhase3Handler(Response resp,
RoRequest req)
Invoked by the HTTPClient. |
void |
trailerHandler(Response resp,
RoRequest req)
Invoked by the HTTPClient. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int HTTP
public static final int HTTPS
public static final int SHTTP
public static final int HTTP_NG
public static final int HTTP_1_0
public static final int HTTP_1_1
public static final int CD_NONE
public static final int CD_HDRS
public static final int CD_0
public static final int CD_CLOSE
public static final int CD_CONTLEN
public static final int CD_CHUNKED
public static final int CD_MP_BR
| Constructor Detail |
RetryModule()
| Method Detail |
public int requestHandler(Request req,
Response[] resp)
requestHandler in interface HTTPClientModulereq - the request - may be modified as neededresp - the response if the status is REQ_RESPONSE or REQ_RETURN
public void responsePhase1Handler(Response resp,
RoRequest roreq)
throws IOException,
ModuleException
responsePhase1Handler in interface HTTPClientModuleresp - the response - may be modifiedroreq - the original request
ModuleException - if an exception occurs during the handling
of the response
IOException - if an IOException occurs on the socket
public int responsePhase2Handler(Response resp,
Request req)
responsePhase2Handler in interface HTTPClientModuleresp - the response - may be modifiedreq - the request; if the status is RSP_REQUEST then this
must contain the new request; however do not modify
this if you don't return a RSP_REQUEST status.
public void responsePhase3Handler(Response resp,
RoRequest req)
responsePhase3Handler in interface HTTPClientModuleresp - the response - may be modifiedreq - the original request
public void trailerHandler(Response resp,
RoRequest req)
trailerHandler in interface HTTPClientModuleresp - the responsereq - the request
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||