public class PollingResponseHandler extends Object
限定符和类型 | 字段和说明 |
---|---|
protected static int |
FAILURE_MESSAGE |
protected static int |
FINISH_MESSAGE |
protected static int |
START_MESSAGE |
protected static int |
SUCCESS_MESSAGE |
构造器和说明 |
---|
PollingResponseHandler() |
限定符和类型 | 方法和说明 |
---|---|
protected void |
handleFailureMessage(Throwable e,
String responseBody) |
protected void |
handleFinishMessage(int execTimes,
String responseBody) |
protected void |
handleMessage(Message msg) |
protected void |
handleStartMessage() |
protected void |
handleSuccessMessage(int statusCode,
String responseBody) |
boolean |
isFailResponse(String content)
是否结束请求
|
protected Message |
obtainMessage(int responseMessage,
Object response) |
void |
onFailure(Throwable error,
String content)
轮询失败
|
void |
onPollingFinish(int execTimes,
String content)
轮询结束
|
void |
onStart()
启动开始
|
void |
onSuccess(int statusCode,
String content)
轮询成功
|
protected void |
sendFailureMessage(IOException e,
String responseBody) |
protected void |
sendFinishMessage(int execTimes) |
protected void |
sendMessage(Message msg) |
protected boolean |
sendResponseMessage(Response response) |
protected void |
sendStartMessage() |
protected void |
sendSuccessMessage(int statusCode,
String responseBody) |
protected static final int START_MESSAGE
protected static final int SUCCESS_MESSAGE
protected static final int FAILURE_MESSAGE
protected static final int FINISH_MESSAGE
public boolean isFailResponse(String content)
content
- public void onStart()
public void onPollingFinish(int execTimes, String content)
execTimes
- content
- public void onSuccess(int statusCode, String content)
statusCode
- content
- protected void sendStartMessage()
protected void sendFinishMessage(int execTimes)
protected void sendSuccessMessage(int statusCode, String responseBody)
protected void sendFailureMessage(IOException e, String responseBody)
protected boolean sendResponseMessage(Response response)
protected void handleMessage(Message msg)
protected void handleStartMessage()
protected void handleFinishMessage(int execTimes, String responseBody)
protected void handleSuccessMessage(int statusCode, String responseBody)
protected void sendMessage(Message msg)
protected Message obtainMessage(int responseMessage, Object response)