All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.softicar.platform.common.core.retry.Retrier Maven / Gradle / Ivy

Go to download

The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.

There is a newer version: 50.0.0
Show newest version
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;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy