Top Description Fields Constructors Methods
com.mysql.cj.protocol.x

public Class ErrorToFutureCompletionHandler<T>

extends Object
implements CompletionHandler<T, Void>
Class Inheritance
All Implemented Interfaces
java.nio.channels.CompletionHandler
Type Parameters
<T>
result type
Imports
java.nio.channels.CompletionHandler, java.util.concurrent.CompletableFuture

Base class that propagates any error to the given future allowing only implementation of the success callback.

Field Summary

Modifier and TypeField and Description
private CompletableFuture<?>
private Runnable

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
completed(T
The result of the I/O operation.
result
,
Void
The object attached to the I/O operation when it was initiated.
attachment
)

Implements java.nio.channels.CompletionHandler.completed.

Invoked when an operation has completed.

public void
failed(Throwable
The exception to indicate why the I/O operation failed
ex
,
Void
The object attached to the I/O operation when it was initiated.
attachment
)

Implements java.nio.channels.CompletionHandler.failed.

Invoked when an operation fails.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

futureback to summary
private CompletableFuture<?> future
successCallbackback to summary
private Runnable successCallback

Constructor Detail

ErrorToFutureCompletionHandlerback to summary
public ErrorToFutureCompletionHandler(CompletableFuture<?> future, Runnable successCallback)

Method Detail

completedback to summary
public void completed(T result, Void attachment)

Implements java.nio.channels.CompletionHandler.completed.

Doc from java.nio.channels.CompletionHandler.completed.

Invoked when an operation has completed.

Parameters
result:T

The result of the I/O operation.

attachment:Void

The object attached to the I/O operation when it was initiated.

Annotations
@Override
failedback to summary
public void failed(Throwable ex, Void attachment)

Implements java.nio.channels.CompletionHandler.failed.

Doc from java.nio.channels.CompletionHandler.failed.

Invoked when an operation fails.

Parameters
ex:Throwable

The exception to indicate why the I/O operation failed

attachment:Void

The object attached to the I/O operation when it was initiated.

Annotations
@Override