Interface TaskFactory

  • All Known Implementing Classes:
    TaskFactory.LocalAware, TaskFactory.Standard

    public interface TaskFactory
    A simple mechanism to impose our desired semantics on the execution of a task without requiring a specialised executor service. We wrap tasks in a suitable FutureTask or encapsulating Runnable.

    The encapsulations handle any exceptions in our standard way, as well as ensuring ExecutorLocals are propagated in the case of localAware()

    • Method Detail

      • toExecute

        java.lang.Runnable toExecute​(java.lang.Runnable runnable)
      • toSubmit

        <T> RunnableFuture<T> toSubmit​(java.lang.Runnable runnable)
      • toSubmit

        <T> RunnableFuture<T> toSubmit​(java.lang.Runnable runnable,
                                       T result)
      • toSubmit

        <T> RunnableFuture<T> toSubmit​(java.util.concurrent.Callable<T> callable)
      • toExecute

        java.lang.Runnable toExecute​(WithResources withResources,
                                     java.lang.Runnable runnable)