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-62 Show documentation
Show all versions of hypersistence-utils-hibernate-62 Show documentation
Utilities for Spring and Hibernate ORM 6.2 or newer
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;
}