public static Resilience createRunOnceResilience ( int retry_count , int retry_interval ) { Resilience resilience = new RunOnlyOnce ( ) ; RunFiniteTimes failure_occurrence = new RunFiniteTimes ( retry_count ) ; resilience . setFailureSchedule ( failure_occurrence ) ; for ( int i = 0 ; i < retry_count ; i ++ ) { RelativeScheduleBuilder rsb = failure_occurrence . newRelativeScheduleBuilder ( ) ; rsb . setRunDelayMinutes ( retry_interval * ( i + 1 ) ) ; rsb . createSchedule ( ) ; } return resilience ; }
create a simple Resilience object so process can restart - runs once with retries as parameters