io.hypersistence.utils.spring.annotation.Retry Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hypersistence-utils-hibernate-52 Show documentation
Show all versions of hypersistence-utils-hibernate-52 Show documentation
Utilities for Spring and Hibernate ORM 5.2 to 5.4
package io.hypersistence.utils.spring.annotation;
import java.lang.annotation.*;
/**
* The Retry annotation instructs Spring to retry
* a method execution when catching a given {@link Throwable}.
*
* @author Vlad Mihalcea
* @since 3.1.0
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@Inherited
public @interface Retry {
/**
* Declare the throwable types the retry will be executed for.
*
* @return throwable types triggering a retry
*/
Class extends Throwable>[] on();
/**
* The number of retry attempts
*
* @return retry attempts
*/
int times() default 1;
}