com.softicar.platform.common.core.retry.Retrier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of platform-common Show documentation
Show all versions of platform-common Show documentation
The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.
package com.softicar.platform.common.core.retry;
import com.softicar.platform.common.core.interfaces.INullaryVoidFunction;
/**
* Utility class to retry the execution of a {@link INullaryVoidFunction}.
*
* @author Oliver Richers
*/
public class Retrier extends AbstractRetrier implements INullaryVoidFunction {
private final INullaryVoidFunction function;
public Retrier(INullaryVoidFunction function) {
this.function = function;
}
/**
* Starts the execution of the retry loop.
*/
@Override
public void apply() {
super.executeRetryLoop();
}
@Override
protected void executeTry() {
function.apply();
}
@Override
protected Retrier getThis() {
return this;
}
}