Package org.cometd.bayeux.client
Interface ClientSession.Extension
- All Known Implementing Classes:
AckExtension,BinaryExtension,ClientSession.Extension.Adapter,TimestampClientExtension,TimesyncClientExtension
- Enclosing interface:
- ClientSession
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.
- See Also:
ClientSession.addExtension(Extension)
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classClientSession.Extension.AdapterEmpty implementation ofClientSession.Extension. -
Method Summary
Modifier and Type Method Description booleanrcv(ClientSession session, Message.Mutable message)Callback method invoked every time a normal message is received.booleanrcvMeta(ClientSession session, Message.Mutable message)Callback method invoked every time a meta message is received.booleansend(ClientSession session, Message.Mutable message)Callback method invoked every time a normal message is being sent.booleansendMeta(ClientSession session, Message.Mutable message)Callback method invoked every time a meta message is being sent.
-
Method Details
-
rcv
Callback method invoked every time a normal message is received.- Parameters:
session- the session object that is receiving the messagemessage- the message received- Returns:
- true if message processing should continue, false if it should stop
-
rcvMeta
Callback method invoked every time a meta message is received.- 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
-
send
Callback method invoked every time a normal message is being sent.- Parameters:
session- the session object that is sending the messagemessage- the message being sent- Returns:
- true if message processing should continue, false if it should stop
-
sendMeta
Callback method invoked every time a meta message is being sent.- 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
-