Class CallableWithAbortFactory

java.lang.Object
org.aksw.jena_sparql_api.legacy.CallableWithAbortFactory

public class CallableWithAbortFactory extends Object
This class is a wrapper for a callable. The wrapper introduces an abort method that specifically only interrupts the invocation of the callable. Should the callable return before abort is called then the thread that invoked the callable is not interrupted. The delegate can be exchanged but this must not happen concurrently.
Author:
raven
  • Field Details

    • thread

      protected volatile Thread thread
    • isDone

      protected volatile boolean isDone
    • abortRequested

      protected AtomicBoolean abortRequested
    • isAbortException

      protected Predicate<? super Throwable> isAbortException
  • Constructor Details

    • CallableWithAbortFactory

      public CallableWithAbortFactory(Predicate<? super Throwable> isAbortException)
  • Method Details

    • isDone

      public boolean isDone()
    • abort

      public void abort()
    • setDelegate

      public <T> CallableWithAbort<T> setDelegate(Callable<T> delegate)