Package org.cometd.bayeux.server
Interface ServerChannel.MessageListener
-
- All Superinterfaces:
Bayeux.BayeuxListener
,ConfigurableServerChannel.ServerChannelListener
,EventListener
- All Known Implementing Classes:
DataFilterMessageListener
,Oort.CloudListener
,OortMasterLong
,OortMasterService
,OortPrimaryLong
,OortPrimaryService
,OortService
- Enclosing interface:
- ServerChannel
public static interface ServerChannel.MessageListener extends ConfigurableServerChannel.ServerChannelListener
Listeners objects that implement this interface will be notified of message publish.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.cometd.bayeux.server.ConfigurableServerChannel.ServerChannelListener
ConfigurableServerChannel.ServerChannelListener.Weak
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default boolean
onMessage(ServerSession sender, ServerChannel channel, ServerMessage.Mutable message)
Blocking version ofonMessage(ServerSession, ServerChannel, ServerMessage.Mutable, Promise)
.default void
onMessage(ServerSession sender, ServerChannel channel, ServerMessage.Mutable message, Promise<Boolean> promise)
Callback invoked when a message is being published.
-
-
-
Method Detail
-
onMessage
default void onMessage(ServerSession sender, ServerChannel channel, ServerMessage.Mutable message, Promise<Boolean> promise)
Callback invoked when a message is being published.
Implementers can notify the promise with false to signal that the message should not be published.
- Parameters:
sender
- the session that publishes the messagechannel
- the channel the message is published tomessage
- the message to be publishedpromise
- the promise to notify whether the message processing should continue
-
onMessage
default boolean onMessage(ServerSession sender, ServerChannel channel, ServerMessage.Mutable message)
Blocking version of
onMessage(ServerSession, ServerChannel, ServerMessage.Mutable, Promise)
.- Parameters:
sender
- the session that publishes the messagechannel
- the channel the message is published tomessage
- the message to be published- Returns:
- whether the message processing should continue
-
-