public class TaskDetails extends Object
ExecutorService that implements the ReportingExecutorService interface.BoundedScheduledExecutorService.| Constructor and Description |
|---|
TaskDetails()
Creates a container for the metadata of a task that was scheduled through an
ExecutorService.It is automatically initiated with the calling Thread name, the scheduledForExecution flag being
set to true and the executionCount being set to 0. |
| Modifier and Type | Method and Description |
|---|---|
Long |
getDelay()
Getter for the internal
delay property. |
AtomicInteger |
getExecutionCount()
Getter for the internal
executionCount property.Note: There is no setter for this property because it returns a mutable object that is not supposed be overwritten. |
Long |
getInterval()
Getter for the internal
interval property. |
AtomicBoolean |
getScheduledForExecution()
Getter for the internal
scheduledForExecution property.Note: There is no setter for this property because it returns a mutable object that is not supposed be overwritten. |
String |
getThreadName()
Getter for the internal
threadName property. |
Long |
getTimeout()
Getter for the internal
timeout property. |
TimeUnit |
getTimeUnit()
Getter for the internal
timeUnit property. |
TaskDetails |
setDelay(Long delay)
Setter for the internal
delay property. |
TaskDetails |
setInterval(Long interval)
Setter for the internal
interval property. |
TaskDetails |
setTimeout(Long timeout)
Setter for the internal
timeout property. |
TaskDetails |
setTimeUnit(TimeUnit timeUnit)
Setter for the internal
timeUnit property. |
public TaskDetails()
ExecutorService.Thread name, the scheduledForExecution flag being
set to true and the executionCount being set to 0.public String getThreadName()
threadName property.Thread that scheduled the task.public AtomicBoolean getScheduledForExecution()
scheduledForExecution property.public AtomicInteger getExecutionCount()
executionCount property.public TaskDetails setDelay(Long delay)
delay property.delay - the initial delay that was provided when scheduling the taskpublic Long getDelay()
delay property.null if the task was set to run
immediately)public TaskDetails setInterval(Long interval)
interval property.interval - the interval in which the task is repeated (or null for non-recurring tasks)public Long getInterval()
interval property.null for non-recurring tasks)public TaskDetails setTimeout(Long timeout)
timeout property.timeout - the timeout that a task can take to terminate before it gets interrupted (or null if none
was provided)public Long getTimeout()
timeout property.null if none was
provided)public TaskDetails setTimeUnit(TimeUnit timeUnit)
timeUnit property.timeUnit - the time unit that the other values are denominated in (or null if no time based values
are provided)Copyright © 2019. All rights reserved.