public interface StructureJob
StructureJob
is a single one-time or repetitive background task,
run by the StructureJobManager
.
The interface defines the main job()
method that does the work and a few other
methods to provide the lifecycle information for the job manager.
Typically you should extend AbstractStructureJob
to have housekeeping done for you.
All methods of this interface must be implemented in a thread-safe way, because
typically maintenance and running the job happen in different threads. However, the
implementation may be certain the job()
method (or AbstractStructureJob.doJob()
method)
will never be called concurrently in different threads.
AbstractStructureJob
,
StructureJobManager
Modifier and Type | Interface and Description |
---|---|
static class |
StructureJob.State
Simple enumeration of the possible job states
|
Modifier and Type | Method and Description |
---|---|
StructureJob.State |
getState() |
ApplicationUser |
getUser() |
void |
job()
Runs the job in background.
|
void |
reset()
Reset the state of the job so that it becomes
StructureJob.State.PENDING . |
void job() throws Exception
Runs the job in background. Before this method is called, all JIRA thread maintenance is done
and the current user is set up to be what getUser()
returns.
Exception
- any exception thrown by the job will be logged but won't stop job managervoid reset()
Reset the state of the job so that it becomes StructureJob.State.PENDING
. Should not be called
when the job is running.
StructureJob.State getState()
StructureJob.State
ApplicationUser getUser()
Copyright © 2024 Tempo Software. All Rights Reserved.