public interface IJob extends Runnable
Modifier and Type | Method and Description |
---|---|
IJob |
cancel() |
Date |
getCancelledOn()
Returns the time this job instance was cancelled.
|
IJob |
getChild()
Returns the thread-local child job of this one while this job is running.
|
Date |
getCreatedOn()
Returns the time this job instance was created.
|
DataException |
getException()
Returns the last exception thrown while running.
|
Date |
getFinishedOn()
Returns the time this job finished running.
|
String |
getName()
Returns the name assigned to this job or its default name if one was not assigned.
|
IJob |
getParent()
Returns the thread-local job that ran this one while this job is running.
|
Date |
getPausedOn()
Returns the time this job was paused or
null if this job is not currently paused. |
long |
getRunningTime()
Returns the number of milliseconds this job was (or has been) running for or zero (0) if it hasn't yet started running.
|
String |
getRunningTimeAsString()
Returns the time this job was (or has been) running in long form as a human readable string (2 Years, 1 Second, 12 Millisecond) or
null if it hasn't yet started running. |
String |
getRunningTimeAsString(boolean shortForm)
Returns the time this job was (or has been) running as a human readable string in long form (2 Years, 1 Second, 12 Millisecond) or short form (2y 1s 12ms) or
null if it hasn't yet started running. |
Thread |
getRunThread()
Returns the thread currently executing this job or
null if the job is not running. |
Date |
getStartedOn()
Returns the time this job instance started running.
|
UUID |
getUuid()
Returns the universally unique identifier (UUID) for this job.
|
boolean |
isCancelled()
Returns
true if this job was cancelled. |
boolean |
isFailed()
Returns
true if this job has completed unsuccessfully. |
boolean |
isFinished()
Returns
true if this job has finished running. |
boolean |
isPaused()
Returns
true if this job is currently paused. |
boolean |
isRunning()
Returns
true if this job is currently running. |
IJob |
pause() |
IJob |
resume() |
void |
run()
Executes this job in the current thread.
|
IJob |
runAsync()
Executes this job in a new thread.
|
IJob |
setName(String name)
Assigns a new name to this job.
|
IJob |
waitUntilFinished()
Waits for this job to complete.
|
IJob |
waitUntilFinished(long timeout)
Waits up to
timeout milliseconds for this job to complete or throws InterruptedException . |
IJob |
waitUntilStarted()
Waits for this job to start.
|
IJob |
waitUntilStarted(long timeout)
Waits up to
timeout milliseconds for this job to start or throws InterruptedException . |
IJob getParent()
IJob getChild()
UUID getUuid()
String getName()
Date getCreatedOn()
Date getStartedOn()
Date getCancelledOn()
boolean isCancelled()
true
if this job was cancelled.Date getPausedOn()
null
if this job is not currently paused.boolean isPaused()
true
if this job is currently paused.Date getFinishedOn()
boolean isFinished()
true
if this job has finished running.DataException getException()
boolean isFailed()
true
if this job has completed unsuccessfully.Thread getRunThread()
null
if the job is not running.boolean isRunning()
true
if this job is currently running.long getRunningTime()
String getRunningTimeAsString()
null
if it hasn't yet started running.String getRunningTimeAsString(boolean shortForm)
null
if it hasn't yet started running.IJob pause()
IJob resume()
IJob cancel()
void run()
IJob runAsync()
IJob waitUntilStarted() throws InterruptedException
InterruptedException
IJob waitUntilStarted(long timeout) throws InterruptedException
timeout
milliseconds for this job to start or throws InterruptedException
.InterruptedException
IJob waitUntilFinished() throws InterruptedException
InterruptedException
IJob waitUntilFinished(long timeout) throws InterruptedException
timeout
milliseconds for this job to complete or throws InterruptedException
.InterruptedException
Copyright (c) 2006-2024 North Concepts Inc. All Rights Reserved.