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

io.hypersistence.utils.spring.annotation.Retry Maven / Gradle / Ivy

There is a newer version: 3.7.6
Show newest version
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[] on();

    /**
     * The number of retry attempts
     *
     * @return retry attempts
     */
    int times() default 1;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy