Class AcknowledgedMessagesSessionExtension
- All Implemented Interfaces:
EventListener,Bayeux.BayeuxListener,ServerSession.DeQueueListener,ServerSession.Extension,ServerSession.QueueListener,ServerSession.ServerSessionListener
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddeQueue(ServerSession session, Queue<ServerMessage> queue) Callback invoked to notify that the queue of messages is about to be sent to the remote client.voiddeQueue(ServerSession session, Queue<ServerMessage> queue, List<ServerMessage.Mutable> replies) Callback invoked to notify that the queue of messages and the message replies are about to be sent to the remote client.intprotected voidimportMessages(ServerSessionImpl session) protected voidprocessBatch(long batch) voidqueued(ServerSession sender, ServerMessage message) Callback invoked when a message is queued in the session queue.booleanrcv(ServerSession from, ServerMessage.Mutable message) Blocking version ofServerSession.Extension.incoming(ServerSession, ServerMessage.Mutable, Promise)for non-meta messages.booleanrcvMeta(ServerSession session, ServerMessage.Mutable message) Blocking version ofServerSession.Extension.incoming(ServerSession, ServerMessage.Mutable, Promise)for meta messages.voidsend(ServerSession sender, ServerSession session, ServerMessage message) Blocking version ofServerSession.Extension.outgoing(ServerSession, ServerSession, ServerMessage.Mutable, Promise)for non-meta messages.booleansendMeta(ServerSession sender, ServerSession to, ServerMessage.Mutable message) Blocking version ofServerSession.Extension.outgoing(ServerSession, ServerSession, ServerMessage.Mutable, Promise)for meta messages.voidsetMaxQueueSize(int maxQueueSize) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cometd.bayeux.server.ServerSession.Extension
incoming, outgoing
-
Constructor Details
-
AcknowledgedMessagesSessionExtension
-
-
Method Details
-
addListener
-
removeListener
-
getMaxQueueSize
public int getMaxQueueSize() -
setMaxQueueSize
public void setMaxQueueSize(int maxQueueSize) -
rcv
Description copied from interface:ServerSession.ExtensionBlocking version of
ServerSession.Extension.incoming(ServerSession, ServerMessage.Mutable, Promise)for non-meta messages.- Specified by:
rcvin interfaceServerSession.Extension- Parameters:
from- the session that sent the messagemessage- the incoming message- Returns:
- whether message processing should continue
-
rcvMeta
Description copied from interface:ServerSession.ExtensionBlocking version of
ServerSession.Extension.incoming(ServerSession, ServerMessage.Mutable, Promise)for meta messages.- Specified by:
rcvMetain interfaceServerSession.Extension- Parameters:
session- the session that sent the messagemessage- the incoming message- Returns:
- whether message processing should continue
-
processBatch
protected void processBatch(long batch) -
send
Description copied from interface:ServerSession.ExtensionBlocking version of
ServerSession.Extension.outgoing(ServerSession, ServerSession, ServerMessage.Mutable, Promise)for non-meta messages.- Specified by:
sendin interfaceServerSession.Extension- Parameters:
sender- the session that sent the message or nullsession- the session receiving the messagemessage- the outgoing message- Returns:
- the message to send or null to not send the message
-
queued
Description copied from interface:ServerSession.QueueListenerCallback invoked when a message is queued in the session queue.
- Specified by:
queuedin interfaceServerSession.QueueListener- Parameters:
sender- the ServerSession that sends the message, may be null.message- the message being queued
-
sendMeta
Description copied from interface:ServerSession.ExtensionBlocking version of
ServerSession.Extension.outgoing(ServerSession, ServerSession, ServerMessage.Mutable, Promise)for meta messages.- Specified by:
sendMetain interfaceServerSession.Extension- Parameters:
sender- the session that sent the message or nullto- the session receiving the messagemessage- the outgoing message- Returns:
- whether message processing should continue
-
deQueue
public void deQueue(ServerSession session, Queue<ServerMessage> queue, List<ServerMessage.Mutable> replies) Description copied from interface:ServerSession.DeQueueListenerCallback invoked to notify that the queue of messages and the message replies are about to be sent to the remote client.
This is the last chance to process the queue, to remove duplicates or merge messages, and to process the replies.
- Specified by:
deQueuein interfaceServerSession.DeQueueListener- Parameters:
session- the session whose messages are being sentqueue- the queue of messages to sendreplies- the message replies to send
-
deQueue
Description copied from interface:ServerSession.DeQueueListenerCallback invoked to notify that the queue of messages is about to be sent to the remote client.
This is the last chance to process the queue and remove duplicates or merge messages.
- Specified by:
deQueuein interfaceServerSession.DeQueueListener- Parameters:
session- the session whose messages are being sentqueue- the queue of messages to send
-
importMessages
-