ADK CVS

tryllian.afc.task.standard
Class TaskRetryTask

java.lang.Object
  extended bytryllian.afc.task.AbstractTask
      extended bytryllian.afc.task.DefaultTask
          extended bytryllian.afc.task.standard.TaskRetryTask
All Implemented Interfaces:
java.util.EventListener, MessageHandler, java.io.Serializable, Task, TaskListener

public class TaskRetryTask
extends DefaultTask
implements TaskListener

A task that retries (with a given maximum) a task until it succeeds. The task is tried at least one time, and at most the number of retries given.

Succeeds if the task that is retried succeeds.
Fails after a specified number of failures of the task that is tried.

When finished, the finish value is equal to the one of the retried Task.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class tryllian.afc.task.AbstractTask
NL
 
Fields inherited from interface tryllian.afc.task.Task
EMPTY_FINISH_VALUE, FORCED_FINISH_FAILURE, NO_TIME_OUT, TASK_TIMED_OUT
 
Constructor Summary
TaskRetryTask()
          Default constructor (bean) - you have to set the RetryTask before this task is started.
TaskRetryTask(Task retryTask, int nrOfRetries)
          Constructs a TaskRetryTask, specifying the task and the max.
 
Method Summary
 int getRetries()
          Get the number of retries.
 Task getRetryTask()
          Get the task to retry.
 void setRetries(int retries)
          Set the number of retries.
 void setRetryTask(Task task)
          Set the task to retry.
 void taskEnded(TaskEvent event)
          Handle task event for finishing of task to be retried.
 void taskStarted(TaskEvent event)
          Handle task event for starting of task to be retried
 
Methods inherited from class tryllian.afc.task.DefaultTask
addFinishingTask, addTask, getSubtasks, handleHeartbeat, propagateHeartbeat
 
Methods inherited from class tryllian.afc.task.AbstractTask
addTaskListener, fail, fail, finish, finish, finish, forceFinish, forceFinish, getAgentContext, getFinishValue, getState, getSupertask, getTimeOut, handleMessage, heartbeatReceived, logException, messageReceived, removeTaskListener, setAgentContext, setFinishValue, setTimeOut, succeed, succeed, taskAdded, taskEnded, taskRemoved, taskStarted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskRetryTask

public TaskRetryTask()
Default constructor (bean) - you have to set the RetryTask before this task is started.


TaskRetryTask

public TaskRetryTask(Task retryTask,
                     int nrOfRetries)
Constructs a TaskRetryTask, specifying the task and the max. retries.

Parameters:
retryTask - the task that needs to be executed.
nrOfRetries - the maximum number of times this task is retried.
Method Detail

setRetryTask

public void setRetryTask(Task task)
Set the task to retry.

Parameters:
task - the Task to retry

getRetryTask

public Task getRetryTask()
Get the task to retry.

Returns:
the task to retry

setRetries

public void setRetries(int retries)
Set the number of retries.

Parameters:
retries - the number of retries

getRetries

public int getRetries()
Get the number of retries.

Returns:
the number of retries

taskStarted

public final void taskStarted(TaskEvent event)
Handle task event for starting of task to be retried

Specified by:
taskStarted in interface TaskListener

taskEnded

public final void taskEnded(TaskEvent event)
Handle task event for finishing of task to be retried.

Specified by:
taskEnded in interface TaskListener

Copyright 2005, Tryllian Solutions B.V.