@ThreadSafe public final class RunningJobImpl extends Object implements RunningJob
| Constructor and Description |
|---|
RunningJobImpl(Date startTime,
JobId jobId,
JobConfig jobConfig) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Requests that the job be cancelled.
|
boolean |
equals(Object o) |
JobConfig |
getJobConfig()
Returns the job's configuration, such as its schedule and parameters.
|
JobId |
getJobId()
Returns the job ID that was used to schedule this job.
|
Date |
getStartTime()
Returns the time at which the job was started.
|
int |
hashCode() |
boolean |
isCancellationRequested()
Returns
true if the job runner should terminate its activities as gracefully as possible
and exit; false to continue running normally. |
String |
toString() |
@Nonnull public Date getStartTime()
JobRunnerRequestRunDetails that stores the
result will use this exact time for RunDetails.getStartTime().getStartTime in interface JobRunnerRequest@Nonnull public JobId getJobId()
JobRunnerRequestgetJobId in interface JobRunnerRequest@Nonnull public JobConfig getJobConfig()
JobRunnerRequestgetJobConfig in interface JobRunnerRequestpublic boolean isCancellationRequested()
JobRunnerRequesttrue if the job runner should terminate its activities as gracefully as possible
and exit; false to continue running normally.
Job cancellation is entirely cooperative. If a job is likely to take longer than a few seconds to complete its work, then it should periodically check this value and react to it. Normally, cancellation is requested because the application is trying to shut down, and continuing to run after this flag has been set increases the chance that the system administrator will grow impatient and forcibly kill the application.
isCancellationRequested in interface JobRunnerRequesttrue if cancellation is requested; false otherwisepublic void cancel()
RunningJob
Calling this method changes the return value of JobRunnerRequest.isCancellationRequested() permanently
to true. It has no other effect; in particular, it does not interrupt the thread that
is running the job. It is the responsibility of the job runner implementation to cooperatively
check for an respond to the JobRunnerRequest.isCancellationRequested() flag.
cancel in interface RunningJobCopyright © 2017 Atlassian. All rights reserved.