|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ResponseListener
Interface for monitoring progress of sending HttpResponse. Class that implement this interface can listen
for all HttpResponses being sent to clients. They also can veto or block certain responses during their transmissions
by throwing a java.lang.IOException in the notify method. The
setResponseListener method must be called in order to set
the ResponseListener for a Server.
| Method Summary | |
|---|---|
void |
endTransfer(HttpRequest request,
java.lang.Exception e)
This method is called once the transmission of the HttpResponse has concluded. |
void |
notify(HttpRequest request,
int bytesSent,
int totalLength)
This method is called at regular intervals to notify the progress of a HttpResponse transmission. |
void |
startTransfer(HttpRequest request)
This method is called at the beginning of an HttpRequest. |
| Method Detail |
|---|
void startTransfer(HttpRequest request)
request - the request that is being respond to.
void notify(HttpRequest request,
int bytesSent,
int totalLength)
throws java.io.IOException
request - the request that is being responded to.bytesSent - the amount of data sent so far in bytes. Always be zero or greater.totalLength - the total length of the data being sent in bytes. Can be -1 for an unknown total.
java.io.IOException - throws an IOException if a ResponseListener wishes to interrupt the transmission.
void endTransfer(HttpRequest request,
java.lang.Exception e)
request - the request that is being respond to.e - the exception if there was one that ended the transmission. It is null if it completed successfully.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||