public interface HttpSenderListener
Modifier and Type | Method and Description |
---|---|
int |
getListenerOrder()
Gets the order of when this listener should be notified.
|
void |
onHttpRequestSend(HttpMessage msg,
int initiator,
HttpSender sender)
Notifies the listener that a new request was received from the client and is ready to be
forwarded to the server.
|
void |
onHttpResponseReceive(HttpMessage msg,
int initiator,
HttpSender sender)
Notifies the listener that a new response was received from the server and is ready to be
forwarded to the client.
|
int getListenerOrder()
The listeners are ordered in a natural order, the greater the order the later it will be notified.
Note: If two or more listeners have the same order, the order that those listeners will be notified is undefined.
int
with the value of the order that this listener should be notified
aboutvoid onHttpRequestSend(HttpMessage msg, int initiator, HttpSender sender)
The HttpMessage
msg
can be modified (only the request should be modified).
If the return value is true
the message may be forwarded and the following
listeners will be notified, if the value is false
the message will not be
forwarded and no more listeners will be notified.
Note: In the presence of more than one listener there are no guarantees that:
HttpMessage
msg
is equal to the one forwarded to the server, as the
following listeners may modify it;
true
, as the following listeners may return false
.
int
initiator
as defined in the HttpSender
class.
msg
- the HttpMessage
that may be forwarded to the serverinitiator
- the ID of the entity that's sending the messagesender
- the sender of the messagevoid onHttpResponseReceive(HttpMessage msg, int initiator, HttpSender sender)
The HttpMessage
msg
can be modified (only the response should be
modified). If the return value is true
the message may be forwarded and the
following listeners will be notified, if the value is false
the message will
not be forwarded and no more listeners will be notified.
Note: In the presence of more than one listener there are no guarantees that:
HttpMessage
msg
is equal to the one forwarded to the client, as the
following listeners may modify it;
true
, as the following listeners may return false
.
int
initiator
as defined in the HttpSender
class.
msg
- the HttpMessage
that may be forwarded to the clientinitiator
- the ID of the entity that's sending the messagesender
- the sender of the message