Package com.atlassian.jira.util.thread
Interface OffRequestThreadExecutor
- All Superinterfaces:
Executor
- All Known Implementing Classes:
OffRequestThreadExecutorImpl
If you ever need to run code in JIRA off a HTTP request thread then you can sue this class to help setup and clean up
the thread environment.
JIRA uses a fair few ThreadLocal variables setup during HTTP requests to contain common information such as
the logged in user and their Locale and so on say via JiraAuthenticationContext
This class will help you run the off request thread code and clean up after it properly.
- Since:
- v6.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(ApplicationUser runAsUser, Runnable command) Executes the code with the specified user in context viaJiraAuthenticationContextvoidExecutes the code with No user in context viaJiraAuthenticationContext
-
Method Details
-
execute
Executes the code with No user in context viaJiraAuthenticationContext -
execute
Executes the code with the specified user in context viaJiraAuthenticationContext- Parameters:
runAsUser- the user to run the code ascommand- the code to run
-