Class AckExtension
- All Implemented Interfaces:
ClientSession.Extension
public class AckExtension extends ClientSession.Extension.Adapter
This client-side extension enables the client to acknowledge to the server the messages that the client has received.
For the acknowledgement to work, the server must be configured with the correspondent server-side ack extension. If both client and server support the ack extension, then the ack functionality will take place automatically. By enabling this extension, all messages arriving from the server will arrive via the long poll, so the comet communication will be slightly chattier. The fact that all messages will return via long poll means also that the messages will arrive with total order, which is not guaranteed if messages can arrive via both long poll and normal response. Messages are not acknowledged one by one, but instead a group of messages is acknowledged when long poll returns.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cometd.bayeux.client.ClientSession.Extension
ClientSession.Extension.Adapter
-
Field Summary
-
Constructor Summary
Constructors Constructor Description AckExtension()
-
Method Summary
Modifier and Type Method Description boolean
rcvMeta(ClientSession session, Message.Mutable message)
Callback method invoked every time a meta message is received.boolean
sendMeta(ClientSession session, Message.Mutable message)
Callback method invoked every time a meta message is being sent.
-
Field Details
-
ACK_FIELD
- See Also:
- Constant Field Values
-
-
Constructor Details
-
AckExtension
public AckExtension()
-
-
Method Details
-
rcvMeta
Description copied from interface:ClientSession.Extension
Callback method invoked every time a meta message is received.- Specified by:
rcvMeta
in interfaceClientSession.Extension
- Overrides:
rcvMeta
in classClientSession.Extension.Adapter
- Parameters:
session
- the session object that is receiving the meta messagemessage
- the meta message received- Returns:
- true if message processing should continue, false if it should stop
-
sendMeta
Description copied from interface:ClientSession.Extension
Callback method invoked every time a meta message is being sent.- Specified by:
sendMeta
in interfaceClientSession.Extension
- Overrides:
sendMeta
in classClientSession.Extension.Adapter
- Parameters:
session
- the session object that is sending the messagemessage
- the meta message being sent- Returns:
- true if message processing should continue, false if it should stop
-