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 Summary
Modifier and TypeMethodDescriptionvoidRuns the task as a particular actorvoidexecuteAsSynchronous(String traceId, String actorKey, Runnable runnable) Runs the task as a particular actor in synchronous context.<V> VexecuteAsWithResult(String traceId, String actorKey, Callable<V> task) Runs the task as a particular actor and returns result.
-
Method Details
-
executeAs
Runs the task as a particular actor- Parameters:
actorKey- the user key of the actor to execute astask- The task to execute in the context of the actor
-
executeAsWithResult
Runs the task as a particular actor and returns result.- Parameters:
actorKey- the user key of the actor to execute astask- The task to execute in the context of the actor- Returns:
- the result of the task
-
executeAsSynchronous
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 asrunnable- The task to execute in the context of the actor
-