Home / Function/ isNotValidPromise() — netty Function Reference

isNotValidPromise() — netty Function Reference

Architecture documentation for the isNotValidPromise() function in AbstractChannelHandlerContext.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  68df46dc_252a_d030_c949_5bdd54ef8f59["isNotValidPromise()"]
  219fdd98_e8e7_d4f7_fea0_eba60352e3de["AbstractChannelHandlerContext"]
  68df46dc_252a_d030_c949_5bdd54ef8f59 -->|defined in| 219fdd98_e8e7_d4f7_fea0_eba60352e3de
  ecdd9021_5139_5faf_c9e9_00ec51590b75["ChannelFuture()"]
  ecdd9021_5139_5faf_c9e9_00ec51590b75 -->|calls| 68df46dc_252a_d030_c949_5bdd54ef8f59
  7dbc9027_cf83_9c14_3f3e_8458eb46f7b9["validateWrite()"]
  7dbc9027_cf83_9c14_3f3e_8458eb46f7b9 -->|calls| 68df46dc_252a_d030_c949_5bdd54ef8f59
  style 68df46dc_252a_d030_c949_5bdd54ef8f59 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/main/java/io/netty/channel/AbstractChannelHandlerContext.java lines 892–925

    private boolean isNotValidPromise(ChannelPromise promise, boolean allowVoidPromise) {
        ObjectUtil.checkNotNull(promise, "promise");

        if (promise.isDone()) {
            // Check if the promise was cancelled and if so signal that the processing of the operation
            // should not be performed.
            //
            // See https://github.com/netty/netty/issues/2349
            if (promise.isCancelled()) {
                return true;
            }
            throw new IllegalArgumentException("promise already done: " + promise);
        }

        if (promise.channel() != channel()) {
            throw new IllegalArgumentException(String.format(
                    "promise.channel does not match: %s (expected: %s)", promise.channel(), channel()));
        }

        if (promise.getClass() == DefaultChannelPromise.class) {
            return false;
        }

        if (!allowVoidPromise && promise instanceof VoidChannelPromise) {
            throw new IllegalArgumentException(
                    StringUtil.simpleClassName(VoidChannelPromise.class) + " not allowed for this operation");
        }

        if (promise instanceof AbstractChannel.CloseFuture) {
            throw new IllegalArgumentException(
                    StringUtil.simpleClassName(AbstractChannel.CloseFuture.class) + " not allowed in a pipeline");
        }
        return false;
    }

Domain

Subdomains

Frequently Asked Questions

What does isNotValidPromise() do?
isNotValidPromise() is a function in the netty codebase, defined in transport/src/main/java/io/netty/channel/AbstractChannelHandlerContext.java.
Where is isNotValidPromise() defined?
isNotValidPromise() is defined in transport/src/main/java/io/netty/channel/AbstractChannelHandlerContext.java at line 892.
What calls isNotValidPromise()?
isNotValidPromise() is called by 2 function(s): ChannelFuture, validateWrite.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free