Interface TaskWrapper

    • Method Detail

      • wrap

        Runnable wrap​(Runnable runnable)
        Wrap the given Runnable and add custom logic.

        Use cases include injection of state into the thread-local context, or more fine granular error handling.

        Note that when modifying state in ThreadLocal it must be reset properly in a try/finally block.

        Parameters:
        runnable - the task as generated by the FedX engine
        Returns:
        the wrapped Runnable
      • wrap

        <T> Callable<T> wrap​(Callable<T> callable)
        Wrap the given Callable and add custom logic.

        Use cases include injection of state into the thread-local context, or more fine granular error handling.

        Note that when modifying state in ThreadLocal it must be reset properly in a try/finally block.

        Parameters:
        callable - the task as generated by the FedX engine
        Returns:
        the wrapped Callable