Class EnsureAsync<T>

  • Type Parameters:
    T - Return type for the decorated callable
    All Implemented Interfaces:
    java.util.concurrent.Callable<T>

    public class EnsureAsync<T>
    extends java.lang.Object
    implements java.util.concurrent.Callable<T>
    Decorator for Callable ensuring that the decorated interface runs in a way that let the VM run other green threads.

    Use "com.microej.crypto.test.ensureasync.thresholdms" to configure the threshold (in milliseconds): execution under this threshold are not required to have yield execution to other threads.
    Defaults to 30L.
    Set to 0 to disable the check.

    • Constructor Summary

      Constructors 
      Constructor Description
      EnsureAsync​(java.util.concurrent.Callable<T> decorated)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T call()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • THRESHOLD_MS_PROPERTY

        public static final java.lang.String THRESHOLD_MS_PROPERTY
        See Also:
        Constant Field Values
    • Constructor Detail

      • EnsureAsync

        public EnsureAsync​(java.util.concurrent.Callable<T> decorated)
    • Method Detail

      • call

        public T call()
               throws java.lang.Exception
        Specified by:
        call in interface java.util.concurrent.Callable<T>
        Throws:
        java.lang.Exception