Interface ThreadContextService

  • All Superinterfaces:
    ThreadContext
    All Known Implementing Classes:
    DefaultThreadContextService

    public interface ThreadContextService
    extends ThreadContext
    The ThreadContextService supports executing code in a thread context and also getting and setting attribute values in the current thread context.
    • Method Detail

      • executeInContext

        <R,​T extends java.lang.Throwable> R executeInContext​(ThreadContextService.Executor<R,​T> wrapper)
                                                            throws T extends java.lang.Throwable
        Execute the wrapper code in the context of the specified user
        Type Parameters:
        R - The type of the return value
        T - The type of the exception thrown by the wrapper
        Parameters:
        wrapper - The code to execute in that context
        Returns:
        The result of method being executed
        Throws:
        T - The exception thrown by the wrapper if an error occurs
        T extends java.lang.Throwable