Package org.cometd.server.ext
Class BinaryExtension
java.lang.Object
org.cometd.bayeux.server.BayeuxServer.Extension.Adapter
org.cometd.server.ext.BinaryExtension
- All Implemented Interfaces:
BayeuxServer.Extension
public class BinaryExtension extends BayeuxServer.Extension.Adapter
A server extension that encodes byte[]
or ByteBuffer
into a BinaryData
object using the Z85
format for outgoing messages, and decodes BinaryData
objects back into byte[]
or ByteBuffer
for incoming messages.
- See Also:
BinarySessionExtension
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cometd.bayeux.server.BayeuxServer.Extension
BayeuxServer.Extension.Adapter
-
Constructor Summary
Constructors Constructor Description BinaryExtension()
BinaryExtension(boolean decodeToByteBuffer)
-
Method Summary
Modifier and Type Method Description boolean
rcv(ServerSession from, ServerMessage.Mutable message)
Callback method invoked every time a normal message is incoming.boolean
send(ServerSession from, ServerSession to, ServerMessage.Mutable message)
Callback method invoked every time a normal message is outgoing.Methods inherited from class org.cometd.bayeux.server.BayeuxServer.Extension.Adapter
rcvMeta, sendMeta
-
Constructor Details
-
BinaryExtension
public BinaryExtension() -
BinaryExtension
public BinaryExtension(boolean decodeToByteBuffer)
-
-
Method Details
-
rcv
Description copied from interface:BayeuxServer.Extension
Callback method invoked every time a normal message is incoming.
- Specified by:
rcv
in interfaceBayeuxServer.Extension
- Overrides:
rcv
in classBayeuxServer.Extension.Adapter
- Parameters:
from
- the session that sent the messagemessage
- the incoming message- Returns:
- true if message processing should continue, false if it should stop
-
send
Description copied from interface:BayeuxServer.Extension
Callback method invoked every time a normal message is outgoing.
- Specified by:
send
in interfaceBayeuxServer.Extension
- Overrides:
send
in classBayeuxServer.Extension.Adapter
- Parameters:
from
- the session that sent the message or nullto
- the session the message is sent to, or null for a publish.message
- the outgoing message- Returns:
- true if message processing should continue, false if it should stop
-