Class ErrorToFutureCompletionHandler<T>

java.lang.Object
com.mysql.cj.protocol.x.ErrorToFutureCompletionHandler<T>
Type Parameters:
T - result type
All Implemented Interfaces:
java.nio.channels.CompletionHandler<T,​java.lang.Void>

public class ErrorToFutureCompletionHandler<T>
extends java.lang.Object
implements java.nio.channels.CompletionHandler<T,​java.lang.Void>
Base class that propagates any error to the given future allowing only implementation of the success callback.
  • Constructor Summary

    Constructors 
    Constructor Description
    ErrorToFutureCompletionHandler​(java.util.concurrent.CompletableFuture<?> future, java.lang.Runnable successCallback)  
  • Method Summary

    Modifier and Type Method Description
    void completed​(T result, java.lang.Void attachment)  
    void failed​(java.lang.Throwable ex, java.lang.Void attachment)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ErrorToFutureCompletionHandler

      public ErrorToFutureCompletionHandler​(java.util.concurrent.CompletableFuture<?> future, java.lang.Runnable successCallback)
  • Method Details

    • completed

      public void completed​(T result, java.lang.Void attachment)
      Specified by:
      completed in interface java.nio.channels.CompletionHandler<T,​java.lang.Void>
    • failed

      public void failed​(java.lang.Throwable ex, java.lang.Void attachment)
      Specified by:
      failed in interface java.nio.channels.CompletionHandler<T,​java.lang.Void>