Interface ThreadLocalExecutor

All Known Implementing Classes:
JiraThreadLocalExecutor

public interface ThreadLocalExecutor
All background calls should be run through the ThreadLocalExecutor. It allows for calls to be mocked as a specific user, but also ensures that all thread local caches are cleaned up properly.
  • Method Details

    • executeAs

      void executeAs(String traceId, String actorKey, Runnable task)
      Runs the task as a particular actor
      Parameters:
      actorKey - the user key of the actor to execute as
      task - The task to execute in the context of the actor
    • executeAsWithResult

      <V> V executeAsWithResult(String traceId, String actorKey, Callable<V> task)
      Runs the task as a particular actor and returns result.
      Parameters:
      actorKey - the user key of the actor to execute as
      task - The task to execute in the context of the actor
      Returns:
      the result of the task
    • executeAsSynchronous

      void executeAsSynchronous(String traceId, @Nullable String actorKey, Runnable runnable)
      Runs the task as a particular actor in synchronous context. Doesn't do any thread clean up
      Parameters:
      actorKey - the user key of the actor to execute as
      runnable - The task to execute in the context of the actor