public static interface ClientSession.Extension
Extension API for client session.
An extension allows user code to interact with the Bayeux protocol as late as messages are sent or as soon as messages are received.
Messages may be modified, or state held, so that the extension adds a specific behavior simply by observing the flow of Bayeux messages.
ClientSession.addExtension(Extension)
Modifier and Type | Method and Description |
---|---|
default void |
incoming(ClientSession session,
Message.Mutable message,
Promise<Boolean> promise)
Callback method invoked every time a message is incoming.
|
default void |
outgoing(ClientSession session,
Message.Mutable message,
Promise<Boolean> promise)
Callback method invoked every time a message is outgoing.
|
default boolean |
rcv(ClientSession session,
Message.Mutable message)
Callback method invoked every time a normal message is received.
|
default boolean |
rcvMeta(ClientSession session,
Message.Mutable message)
Callback method invoked every time a meta message is received.
|
default boolean |
send(ClientSession session,
Message.Mutable message)
Callback method invoked every time a normal message is being sent.
|
default boolean |
sendMeta(ClientSession session,
Message.Mutable message)
Callback method invoked every time a meta message is being sent.
|
default void incoming(ClientSession session, Message.Mutable message, Promise<Boolean> promise)
Callback method invoked every time a message is incoming.
session
- the session that sent the messagemessage
- the incoming messagepromise
- the promise to notify whether message processing should continuedefault boolean rcv(ClientSession session, Message.Mutable message)
session
- the session object that is receiving the messagemessage
- the message receiveddefault boolean rcvMeta(ClientSession session, Message.Mutable message)
session
- the session object that is receiving the meta messagemessage
- the meta message receiveddefault void outgoing(ClientSession session, Message.Mutable message, Promise<Boolean> promise)
Callback method invoked every time a message is outgoing.
session
- the session that sent the messagemessage
- the outgoing messagepromise
- the promise to notify whether message processing should continuedefault boolean send(ClientSession session, Message.Mutable message)
session
- the session object that is sending the messagemessage
- the message being sentdefault boolean sendMeta(ClientSession session, Message.Mutable message)
session
- the session object that is sending the messagemessage
- the meta message being sentCopyright © 2008–2024 The CometD Project. All rights reserved.