cometd-java/cometd-java-api/cometd-java-api-server/src/main/java/org/cometd/bayeux/server/ServerSession.java
/**
         * <p>Callback method invoked every time a message is outgoing.</p>
         *
         * @param sender  the session that sent the message or null
         * @param session the session receiving the message
         * @param message the outgoing message
         * @param promise the promise to notify with the message to send or null to not send the message
         */
Callback method invoked every time a message is outgoing.
@param sender  the session that sent the message or null
@param session the session receiving the message
@param message the outgoing message
@param promise the promise to notify with the message to send or null to not send the message
Callback method invoked every time a message is outgoing . @param sender the session that sent the message or null @param session the session receiving the message @param message the outgoing message @param promise the promise to notify with the message to send or null to not send the message
public default void outgoing(ServerSession sender, ServerSession session, ServerMessage.Mutable message, Promise<ServerMessage.Mutable> promise) {
            if (message.isMeta()) {
                promise.succeed(sendMeta(sender, session, message) ? message : null);
            } else {
                ServerMessage result = send(sender, session, message);
                if (result instanceof ServerMessage.Mutable) {
                    promise.succeed((ServerMessage.Mutable)result);
                } else if (result == null) {
                    promise.succeed(null);
                } else {
                    promise.fail(new IllegalArgumentException());
                }
            }
        }
public default void outgoing ( ServerSession sender , ServerSession session , ServerMessage . Mutable message , Promise < ServerMessage . Mutable > promise ) { if ( message . isMeta ( ) ) { promise . succeed ( sendMeta ( sender , session , message ) ? message : null ) ; } else { ServerMessage result = send ( sender , session , message ) ; if ( result instanceof ServerMessage . Mutable ) { promise . succeed ( ( ServerMessage . Mutable ) result ) ; } else if ( result == null ) { promise . succeed ( null ) ; } else { promise . fail ( new IllegalArgumentException ( ) ) ; } } }
<p>Callback method invoked every time a message is outgoing.</p>
 @param sender  the session that sent the message or null
 @param session the session receiving the message
 @param message the outgoing message
 @param promise the promise to notify with the message to send or null to not send the message
<p > Callback method invoked every time a message is outgoing . < / p > @param sender the session that sent the message or null @param session the session receiving the message @param message the outgoing message @param promise the promise to notify with the message to send or null to not send the message