io.github.resilience4j.micronaut.annotation.Bulkhead Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of resilience4j-micronaut Show documentation
Show all versions of resilience4j-micronaut Show documentation
Resilience4j is a lightweight, easy-to-use fault tolerance library designed for Java8 and functional programming
package io.github.resilience4j.micronaut.annotation;
import io.github.resilience4j.micronaut.bulkhead.BulkheadInterceptor;
import io.micronaut.aop.Around;
import io.micronaut.context.annotation.Executable;
import io.micronaut.context.annotation.Type;
import java.lang.annotation.*;
/**
* This annotation can be applied to a class or a specific method. Applying it on a class is
* equivalent to applying it on all its public methods.
*/
@Retention(value = RetentionPolicy.RUNTIME)
@Target(value = {ElementType.METHOD, ElementType.TYPE})
@Around
@Type({BulkheadInterceptor.class})
@Documented
@Executable
public @interface Bulkhead {
/**
* Name of the bulkhead.
*
* @return the name of the bulkhead
*/
String name();
/**
* fallbackMethod method name.
*
* @return fallbackMethod method name.
*/
String fallbackMethod() default "";
/**
* @return the bulkhead implementation type (SEMAPHORE or THREADPOOL)
*/
Type type() default Type.SEMAPHORE;
/**
* bulkhead implementation types
*
* SEMAPHORE will invoke semaphore based bulkhead implementation THREADPOOL will invoke Thread
* pool based bulkhead implementation
*/
enum Type {
SEMAPHORE, THREADPOOL
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy