Class AcknowledgedMessagesSessionExtension
- All Implemented Interfaces:
EventListener
,Bayeux.BayeuxListener
,ServerSession.DeQueueListener
,ServerSession.Extension
,ServerSession.QueueListener
,ServerSession.ServerSessionListener
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
deQueue
(ServerSession session, Queue<ServerMessage> queue) Callback invoked to notify that the queue of messages is about to be sent to the remote client.void
deQueue
(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.protected void
importMessages
(ServerSessionImpl session) protected void
processBatch
(long batch) void
queued
(ServerSession sender, ServerMessage message) Callback invoked when a message is queued in the session queue.boolean
rcv
(ServerSession from, ServerMessage.Mutable message) Blocking version ofServerSession.Extension.incoming(ServerSession, ServerMessage.Mutable, Promise)
for non-meta messages.boolean
rcvMeta
(ServerSession session, ServerMessage.Mutable message) Blocking version ofServerSession.Extension.incoming(ServerSession, ServerMessage.Mutable, Promise)
for meta messages.void
send
(ServerSession sender, ServerSession session, ServerMessage message) Blocking version ofServerSession.Extension.outgoing(ServerSession, ServerSession, ServerMessage.Mutable, Promise)
for non-meta messages.boolean
sendMeta
(ServerSession sender, ServerSession to, ServerMessage.Mutable message) Blocking version ofServerSession.Extension.outgoing(ServerSession, ServerSession, ServerMessage.Mutable, Promise)
for meta messages.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.cometd.bayeux.server.ServerSession.Extension
incoming, outgoing
-
Constructor Details
-
AcknowledgedMessagesSessionExtension
-
-
Method Details
-
addListener
-
removeListener
-
rcv
Description copied from interface:ServerSession.Extension
Blocking version of
ServerSession.Extension.incoming(ServerSession, ServerMessage.Mutable, Promise)
for non-meta messages.- Specified by:
rcv
in 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.Extension
Blocking version of
ServerSession.Extension.incoming(ServerSession, ServerMessage.Mutable, Promise)
for meta messages.- Specified by:
rcvMeta
in 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.Extension
Blocking version of
ServerSession.Extension.outgoing(ServerSession, ServerSession, ServerMessage.Mutable, Promise)
for non-meta messages.- Specified by:
send
in 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.QueueListener
Callback invoked when a message is queued in the session queue.
- Specified by:
queued
in interfaceServerSession.QueueListener
- Parameters:
sender
- the ServerSession that sends the message, may be null.message
- the message being queued
-
sendMeta
Description copied from interface:ServerSession.Extension
Blocking version of
ServerSession.Extension.outgoing(ServerSession, ServerSession, ServerMessage.Mutable, Promise)
for meta messages.- Specified by:
sendMeta
in 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.DeQueueListener
Callback 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:
deQueue
in 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.DeQueueListener
Callback 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:
deQueue
in interfaceServerSession.DeQueueListener
- Parameters:
session
- the session whose messages are being sentqueue
- the queue of messages to send
-
importMessages
-
getBatchArrayQueue
-