|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.sauronsoftware.cron4j.TaskExecutor
public class TaskExecutor
Represents a task executor, which is something similar to threads.
Each time a task is launched, a new executor is spawned, executing and watching the task
Alive task executors can be retrieved with the
Scheduler.getExecutingTasks()
method, and they expose method to
control the ongoing execution.
Scheduler.getExecutingTasks()
Method Summary | |
---|---|
void |
addTaskExecutorListener(TaskExecutorListener listener)
Adds a listener to the executor. |
boolean |
canBePaused()
Checks whether this executor supports pausing. |
boolean |
canBeStopped()
Checks whether this executor supports stopping. |
double |
getCompleteness()
Returns the current completeness value, which is a value between 0 and 1. |
java.lang.String |
getGuid()
Returns a GUID for this executor. |
Scheduler |
getScheduler()
Returns the Scheduler instance whose this executor belongs to. |
long |
getStartTime()
Returns a time stamp reporting the start time of this executor, or a value less than 0 if this executor has not been yet started. |
java.lang.String |
getStatusMessage()
Returns the current status message. |
Task |
getTask()
Returns the representation of the executed task. |
TaskExecutorListener[] |
getTaskExecutorListeners()
Returns an array containing any TaskExecutorListener previously
registered with the
addTaskExecutorListener(TaskExecutorListener)
method. |
boolean |
isAlive()
Tests if this executor is alive. |
boolean |
isPaused()
Tests whether this executor has been paused. |
boolean |
isStopped()
Tests whether this executor has been stopped. |
void |
join()
Waits for this executor to die. |
void |
pause()
Pauses the ongoing execution. |
void |
removeTaskExecutorListener(TaskExecutorListener listener)
Removes a listener from the executor. |
void |
resume()
Resumes the execution after it has been paused. |
void |
stop()
Stops the ongoing execution. |
boolean |
supportsCompletenessTracking()
Checks whether this executor provides completeness tracking informations. |
boolean |
supportsStatusTracking()
Checks whether this executor provides status tracking messages. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void addTaskExecutorListener(TaskExecutorListener listener)
listener
- The listener.public void removeTaskExecutorListener(TaskExecutorListener listener)
listener
- The listener.public TaskExecutorListener[] getTaskExecutorListeners()
TaskExecutorListener
previously
registered with the
addTaskExecutorListener(TaskExecutorListener)
method.
TaskExecutorListener
previously
registered with the
addTaskExecutorListener(TaskExecutorListener)
method.public java.lang.String getGuid()
public Scheduler getScheduler()
Scheduler
instance whose this executor belongs to.
public Task getTask()
public long getStartTime()
public boolean canBePaused()
public boolean canBeStopped()
public boolean supportsCompletenessTracking()
public boolean supportsStatusTracking()
public void pause() throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
- The operation is not supported if
canBePaused()
returns false.public void resume()
public void stop() throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
- The operation is not supported if
canBeStopped()
returns false.public void join() throws java.lang.InterruptedException
java.lang.InterruptedException
- If any thread has interrupted the current thread. The
interrupted status of the current thread is cleared when this
exception is thrown.public boolean isAlive()
public java.lang.String getStatusMessage() throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
- The operation is not supported if
supportsStatusTracking()
returns
false.public double getCompleteness() throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
- The operation is not supported if
supportsCompletenessTracking()
returns
false.public boolean isPaused()
public boolean isStopped()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |