com.sun.sgs.kernel.schedule
Interface SchedulerRetryPolicy


public interface SchedulerRetryPolicy

This interface is used to define a retry policy for a scheduler when a transactional task fails.

All implementations must implement a constructor of the form (java.util.Properties).


Method Summary
 SchedulerRetryAction getRetryAction(ScheduledTask task)
          Determines if and how a task should be retried after a failure.
 

Method Detail

getRetryAction

SchedulerRetryAction getRetryAction(ScheduledTask task)
Determines if and how a task should be retried after a failure. This method should be called by a scheduler if a task aborts. This method may modify the given task in order to affect how the scheduler behaves when re-executing.

Note: The Throwable cause of the most recent failure of the given task should always be accessible via the ScheduledTask.getLastFailure() method. This Throwable may implement ExceptionRetryStatus. If it does, care should be taken to abide by the contract specified by the TaskManager with regard to Throwables that implement this interface.

Note: The proper way to drop a task with a custom policy is to return DROP with this method. Implementations should not use a call to cancel on the given task.

Parameters:
task - the task that has been aborted
Returns:
the SchedulerRetryAction that the scheduler should take with respect to retrying the given task
Throws:
IllegalArgumentException - if task is null
IllegalStateException - if the given task's most recent failure is null

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved