Class ThreadScopeCallable<V>

  • Type Parameters:
    V - the result type of the given Callable
    All Implemented Interfaces:
    java.util.concurrent.Callable<V>

    public class ThreadScopeCallable<V>
    extends java.lang.Object
    implements java.util.concurrent.Callable<V>
    Runnable that ensures that the thread scope is destroyed afterwards.
    Since:
    2.0.0
    Author:
    Oliver Libutzki <[email protected]>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.concurrent.Callable<V> target  
    • Constructor Summary

      Constructors 
      Constructor Description
      ThreadScopeCallable​(java.util.concurrent.Callable<V> target)  
    • Method Summary

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

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

      • target

        protected java.util.concurrent.Callable<V> target
        Since:
        2.0.0
    • Constructor Detail

      • ThreadScopeCallable

        public ThreadScopeCallable​(java.util.concurrent.Callable<V> target)
        Parameters:
        target - the callable to be executed within the thread scope
        Since:
        2.0.0
    • Method Detail

      • call

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