Package org.cometd.client.transport
Interface TransportListener
- All Superinterfaces:
EventListener
Abstracts the communication between BayeuxClient and ClientTransport.
A TransportListener is associated to every batch of messages being sent,
and notified when responses for those messages come back, or a failure occurs.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidCallback method invoked when a failure to send or receive messages occurs.default voidonMessages(List<org.cometd.bayeux.Message.Mutable> messages) Callback method invoked when a batch of message is received.default voidCallback method invoked when the batch of messages is being sent.default voidonTimeout(List<? extends org.cometd.bayeux.Message> messages, org.cometd.bayeux.Promise<Long> promise) Callback method invoked when the send of a batch of messages expires before receiving a response from the server, controlled by themaxNetworkDelayoption.
-
Method Details
-
onSending
Callback method invoked when the batch of messages is being sent.- Parameters:
messages- the batch of messages being sent
-
onMessages
Callback method invoked when a batch of message is received.- Parameters:
messages- the batch of messages received
-
onFailure
Callback method invoked when a failure to send or receive messages occurs.- Parameters:
failure- the failure occurredmessages- the batch of messages being sent
-
onTimeout
default void onTimeout(List<? extends org.cometd.bayeux.Message> messages, org.cometd.bayeux.Promise<Long> promise) Callback method invoked when the send of a batch of messages expires before receiving a response from the server, controlled by the
maxNetworkDelayoption.Implementations may extend the wait by succeeding the promise with the number of milliseconds of the extended wait.
Succeeding the callback with
0or a negative value confirms the expiration, which will eventually callonFailure(Throwable, List)with aTimeoutException.- Parameters:
messages- the batch of messages sentpromise- the promise to complete
-