org.gcube.contentmanagement.contentmanager.publishers
Class ResilientScheduler

java.lang.Object
  extended by 
      extended by org.gcube.contentmanagement.contentmanager.publishers.ResilientScheduler

public class ResilientScheduler
extends

A GCUBEScheduledHandler which tolerates failure for a maximum number of times.

Author:
Fabio Simeoni (University of Strathclyde)

Constructor Summary
ResilientScheduler(long interval, Mode mode)
          Creates an instance with a given execution mode, time interval, and scheduled handler.
 
Method Summary
 int getAttempts()
          Returns the number of publication attempts.
 long getDelay()
          Returns the interval between publication attempts.
 void setAttempts(int attempts)
          Sets the number of publication attempts;
 void setDelay(long delay)
          Sets the interval between publication attempts.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResilientScheduler

public ResilientScheduler(long interval,
                          Mode mode)
Creates an instance with a given execution mode, time interval, and scheduled handler.

Parameters:
interval - the time interval in seconds.
mode - the execution mode.
handler - (optional) the scheduled handler.
Method Detail

getAttempts

public int getAttempts()
Returns the number of publication attempts.

Returns:
the attempts.

setAttempts

public void setAttempts(int attempts)
Sets the number of publication attempts;

Parameters:
attempts - the attempts.

getDelay

public long getDelay()
Returns the interval between publication attempts.

Returns:
the delay.

setDelay

public void setDelay(long delay)
Sets the interval between publication attempts.

Parameters:
delay - the delay