PromiseNotificationUtil Class — netty Architecture
Architecture documentation for the PromiseNotificationUtil class in PromiseNotificationUtil.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 4db353b5_b84b_a5f5_1955_3d37fb42003e["PromiseNotificationUtil"] 70ad9c2d_31db_f1a2_c2e9_0c5c84ec28c7["PromiseNotificationUtil.java"] 4db353b5_b84b_a5f5_1955_3d37fb42003e -->|defined in| 70ad9c2d_31db_f1a2_c2e9_0c5c84ec28c7 dc0d3cdc_a62a_9758_4493_37541aff391c["PromiseNotificationUtil()"] 4db353b5_b84b_a5f5_1955_3d37fb42003e -->|method| dc0d3cdc_a62a_9758_4493_37541aff391c 5a2ea6ba_7807_ec41_025e_babb950d78d6["tryCancel()"] 4db353b5_b84b_a5f5_1955_3d37fb42003e -->|method| 5a2ea6ba_7807_ec41_025e_babb950d78d6 738e53db_fa0c_bab7_c0bc_3e1950d94c3f["trySuccess()"] 4db353b5_b84b_a5f5_1955_3d37fb42003e -->|method| 738e53db_fa0c_bab7_c0bc_3e1950d94c3f 7098ae12_530a_d31b_af6a_0655ec6df5ae["tryFailure()"] 4db353b5_b84b_a5f5_1955_3d37fb42003e -->|method| 7098ae12_530a_d31b_af6a_0655ec6df5ae
Relationship Graph
Source Code
common/src/main/java/io/netty/util/internal/PromiseNotificationUtil.java lines 24–76
public final class PromiseNotificationUtil {
private PromiseNotificationUtil() { }
/**
* Try to cancel the {@link Promise} and log if {@code logger} is not {@code null} in case this fails.
*/
public static void tryCancel(Promise<?> p, InternalLogger logger) {
if (!p.cancel(false) && logger != null) {
Throwable err = p.cause();
if (err == null) {
logger.warn("Failed to cancel promise because it has succeeded already: {}", p);
} else {
logger.warn(
"Failed to cancel promise because it has failed already: {}, unnotified cause:",
p, err);
}
}
}
/**
* Try to mark the {@link Promise} as success and log if {@code logger} is not {@code null} in case this fails.
*/
public static <V> void trySuccess(Promise<? super V> p, V result, InternalLogger logger) {
if (!p.trySuccess(result) && logger != null) {
Throwable err = p.cause();
if (err == null) {
logger.warn("Failed to mark a promise as success because it has succeeded already: {}", p);
} else {
logger.warn(
"Failed to mark a promise as success because it has failed already: {}, unnotified cause:",
p, err);
}
}
}
/**
* Try to mark the {@link Promise} as failure and log if {@code logger} is not {@code null} in case this fails.
*/
public static void tryFailure(Promise<?> p, Throwable cause, InternalLogger logger) {
if (!p.tryFailure(cause) && logger != null) {
Throwable err = p.cause();
if (err == null) {
logger.warn("Failed to mark a promise as failure because it has succeeded already: {}", p, cause);
} else if (logger.isWarnEnabled()) {
logger.warn(
"Failed to mark a promise as failure because it has failed already: {}, unnotified cause:",
p, cause);
}
}
}
}
Source
Frequently Asked Questions
What is the PromiseNotificationUtil class?
PromiseNotificationUtil is a class in the netty codebase, defined in common/src/main/java/io/netty/util/internal/PromiseNotificationUtil.java.
Where is PromiseNotificationUtil defined?
PromiseNotificationUtil is defined in common/src/main/java/io/netty/util/internal/PromiseNotificationUtil.java at line 24.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free