public class AcknowledgedMessagesSessionExtension extends Object implements ServerSession.Extension, ServerSession.DeQueueListener, ServerSession.QueueListener
Constructor and Description |
---|
AcknowledgedMessagesSessionExtension(ServerSession session) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
incoming, outgoing
public AcknowledgedMessagesSessionExtension(ServerSession session)
public void addListener(AcknowledgedMessagesExtension.Listener listener)
public void removeListener(AcknowledgedMessagesExtension.Listener listener)
public boolean rcv(ServerSession from, ServerMessage.Mutable message)
ServerSession.Extension
Blocking version of ServerSession.Extension.incoming(ServerSession, ServerMessage.Mutable, Promise)
for non-meta messages.
rcv
in interface ServerSession.Extension
from
- the session that sent the messagemessage
- the incoming messagepublic boolean rcvMeta(ServerSession session, ServerMessage.Mutable message)
ServerSession.Extension
Blocking version of ServerSession.Extension.incoming(ServerSession, ServerMessage.Mutable, Promise)
for meta messages.
rcvMeta
in interface ServerSession.Extension
session
- the session that sent the messagemessage
- the incoming messageprotected void processBatch(long batch)
public ServerMessage send(ServerSession sender, ServerSession session, ServerMessage message)
ServerSession.Extension
Blocking version of ServerSession.Extension.outgoing(ServerSession, ServerSession, ServerMessage.Mutable, Promise)
for non-meta messages.
send
in interface ServerSession.Extension
sender
- the session that sent the message or nullsession
- the session receiving the messagemessage
- the outgoing messagepublic void queued(ServerSession sender, ServerMessage message)
ServerSession.QueueListener
Callback invoked when a message is queued in the session queue.
queued
in interface ServerSession.QueueListener
sender
- the ServerSession that sends the message, may be null.message
- the message being queuedpublic boolean sendMeta(ServerSession sender, ServerSession to, ServerMessage.Mutable message)
ServerSession.Extension
Blocking version of ServerSession.Extension.outgoing(ServerSession, ServerSession, ServerMessage.Mutable, Promise)
for meta messages.
sendMeta
in interface ServerSession.Extension
sender
- the session that sent the message or nullto
- the session receiving the messagemessage
- the outgoing messagepublic void deQueue(ServerSession session, Queue<ServerMessage> queue, List<ServerMessage.Mutable> replies)
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.
deQueue
in interface ServerSession.DeQueueListener
session
- the session whose messages are being sentqueue
- the queue of messages to sendreplies
- the message replies to sendpublic void deQueue(ServerSession session, Queue<ServerMessage> queue)
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.
deQueue
in interface ServerSession.DeQueueListener
session
- the session whose messages are being sentqueue
- the queue of messages to sendprotected void importMessages(ServerSessionImpl session)
Copyright © 2008–2024 The CometD Project. All rights reserved.