|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ScheduledTask
This interface represents a single task that has been accepted by a
scheduler. It is used by implementations of SchedulerQueue
to manage the tasks in the queue.
| Field Summary | |
|---|---|
static int |
NON_RECURRING
Identifier that represents a non-recurring task. |
static int |
UNBOUNDED
Identifier that represents an unbounded timeout. |
| Method Summary | |
|---|---|
boolean |
cancel(boolean block)
Cancel this ScheduledTask. |
Throwable |
getLastFailure()
Returns the Throwable that was the last failure of this task
or null if it has never been run or never failed. |
Identity |
getOwner()
Returns the owner. |
long |
getPeriod()
Returns the period for the task if it's recurring, or NON_RECURRING if this is not a recurring task. |
Priority |
getPriority()
Returns the priority. |
RecurringTaskHandle |
getRecurringTaskHandle()
Returns the RecurringTaskHandle associated with this task if
this task is recurring, or null if this is not recurring. |
long |
getStartTime()
Returns the time at which this task is scheduled to start. |
KernelRunnable |
getTask()
Returns the task. |
long |
getTimeout()
Returns the transaction timeout. |
int |
getTryCount()
Returns the try count (the number of times that this task has been attempted). |
boolean |
isCancelled()
Returns whether this task has been cancelled. |
boolean |
isRecurring()
Returns whether this is a recurring task. |
void |
setPriority(Priority priority)
Sets the priority for this task. |
void |
setTimeout(long timeout)
Sets the transaction timeout for this task. |
| Field Detail |
|---|
static final int NON_RECURRING
static final int UNBOUNDED
| Method Detail |
|---|
KernelRunnable getTask()
KernelRunnable to runIdentity getOwner()
Identity that owns the taskPriority getPriority()
Prioritylong getStartTime()
long getPeriod()
NON_RECURRING if this is not a recurring task.
int getTryCount()
long getTimeout()
Throwable getLastFailure()
Throwable that was the last failure of this task
or null if it has never been run or never failed.
Throwable that was the cause of the last failurevoid setPriority(Priority priority)
priority - the new priority for this taskvoid setTimeout(long timeout)
timeout - the new transaction timeout for this taskboolean isRecurring()
getPeriod should always return NON_RECURRING.
true if this task is a recurring task,
false otherwise.RecurringTaskHandle getRecurringTaskHandle()
RecurringTaskHandle associated with this task if
this task is recurring, or null if this is not recurring.
RecurringTaskHandle or nullboolean isCancelled()
true if this ScheduledTask has been cancelled,
false otherwiseboolean cancel(boolean block)
ScheduledTask. Note that if the task is already
running then calling this method may not have any affect. Also note
that this method should never be called with a value of true
for the block parameter if the calling thread is also currently
running this ScheduledTask.
block - if true, this call will block until the task is
cancelled or has completed, if false, it will not
block
true if the task was cancelled by this call,
false otherwise
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||