Home / Class/ AbstractFuture Class — netty Architecture

AbstractFuture Class — netty Architecture

Architecture documentation for the AbstractFuture class in AbstractFuture.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  257b6735_cea9_aad3_44a3_09bf322856a5["AbstractFuture"]
  30aa102a_d48d_f83f_a4e5_2b57acc02025["AbstractFuture.java"]
  257b6735_cea9_aad3_44a3_09bf322856a5 -->|defined in| 30aa102a_d48d_f83f_a4e5_2b57acc02025
  f3d32291_2a28_81ed_679d_c590e580c9d0["V()"]
  257b6735_cea9_aad3_44a3_09bf322856a5 -->|method| f3d32291_2a28_81ed_679d_c590e580c9d0

Relationship Graph

Source Code

common/src/main/java/io/netty/util/concurrent/AbstractFuture.java lines 29–59

public abstract class AbstractFuture<V> implements Future<V> {

    @Override
    public V get() throws InterruptedException, ExecutionException {
        await();

        Throwable cause = cause();
        if (cause == null) {
            return getNow();
        }
        if (cause instanceof CancellationException) {
            throw (CancellationException) cause;
        }
        throw new ExecutionException(cause);
    }

    @Override
    public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
        if (await(timeout, unit)) {
            Throwable cause = cause();
            if (cause == null) {
                return getNow();
            }
            if (cause instanceof CancellationException) {
                throw (CancellationException) cause;
            }
            throw new ExecutionException(cause);
        }
        throw new TimeoutException("timeout after " + timeout + " " + unit.name().toLowerCase(Locale.ENGLISH));
    }
}

Frequently Asked Questions

What is the AbstractFuture class?
AbstractFuture is a class in the netty codebase, defined in common/src/main/java/io/netty/util/concurrent/AbstractFuture.java.
Where is AbstractFuture defined?
AbstractFuture is defined in common/src/main/java/io/netty/util/concurrent/AbstractFuture.java at line 29.

Analyze Your Own Codebase

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

Try Supermodel Free