Interface ServerChannel.MessageListener

All Superinterfaces:
org.cometd.bayeux.Bayeux.BayeuxListener, ConfigurableServerChannel.ServerChannelListener, EventListener
Enclosing interface:
ServerChannel

public static interface ServerChannel.MessageListener extends ConfigurableServerChannel.ServerChannelListener

Listeners objects that implement this interface will be notified of message publish.

  • Method Details

    • onMessage

      default void onMessage(ServerSession sender, ServerChannel channel, ServerMessage.Mutable message, org.cometd.bayeux.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 message
      channel - the channel the message is published to
      message - the message to be published
      promise - the promise to notify whether the message processing should continue
    • onMessage

      default boolean onMessage(ServerSession sender, ServerChannel channel, ServerMessage.Mutable message)
      Parameters:
      sender - the session that publishes the message
      channel - the channel the message is published to
      message - the message to be published
      Returns:
      whether the message processing should continue