Package tlschannel

Class NeedsTaskException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
tlschannel.TlsChannelFlowControlException
tlschannel.NeedsTaskException
All Implemented Interfaces:
java.io.Serializable

public class NeedsTaskException
extends TlsChannelFlowControlException
This exception signals the caller that the operation could not continue because a CPU-intensive operation (typically a TLS handshaking) needs to be executed and the TlsChannel is configured to not run tasks. This allows the application to run these tasks in some other threads, in order to not slow the selection loop. The method that threw the exception should be retried once the task supplied by getTask() is executed and finished.

This exception is akin to the SSL_ERROR_WANT_ASYNC error code used by OpenSSL (but note that in OpenSSL, the task is executed by the library, while with the TlsChannel, the calling code is responsible for the execution).

See Also:
OpenSSL error documentation, Serialized Form
  • Constructor Summary

    Constructors 
    Constructor Description
    NeedsTaskException​(java.lang.Runnable task)  
  • Method Summary

    Modifier and Type Method Description
    java.lang.Runnable getTask()  

    Methods inherited from class tlschannel.TlsChannelFlowControlException

    fillInStackTrace

    Methods inherited from class java.lang.Throwable

    addSuppressed, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

    Methods inherited from class java.lang.Object

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

  • Method Details

    • getTask

      public java.lang.Runnable getTask()