Interface FaultToleranceConfig

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface FaultToleranceConfig
    Encapsulates all properties extracted from FT annotations and the Config so that the processing can be declared independent of the actual resolution mechanism. A configuration is bound to a specific invocation context which is not an argument to each of the provided methods but passed to the implementation upon construction. For another invocation another configuration instance is bound.
    Author:
    Jan Bernitt
    • Field Detail

      • ALTERNATIVE_ASYNCHRONOUS_ANNNOTATIONS_PROPERTY

        static final String ALTERNATIVE_ASYNCHRONOUS_ANNNOTATIONS_PROPERTY
        A payara specific feature that allows to specify a list of annotation classes that have a similar effect as Asynchronous.
        See Also:
        Constant Field Values
      • NO_ALTERNATIVE_ANNOTATIONS

        static final Class<? extends Annotation>[] NO_ALTERNATIVE_ANNOTATIONS
    • Method Detail

      • getAnnotation

        <A extends Annotation> A getAnnotation​(Class<A> annotationType)
        Returns the value of the given annotation type for the invocation context was bound to upon construction.
        Parameters:
        annotationType - type to lookup
        Returns:
        the annotation of the given type if present or null otherwise
      • isNonFallbackEnabled

        default boolean isNonFallbackEnabled()
        Check global generic annotation switch.
        Returns:
        true if (in addition to Fallback, which is always enabled) the other FT annotations are as well (default). Mostly used to disable these which will not disable Fallback.
      • isEnabled

        default boolean isEnabled​(Class<? extends Annotation> annotationType)
        Check global annotation specific annotation switch.
        Parameters:
        annotationType - the annotation type to check
        Returns:
        true if the given annotation type is globally enabled, false if it is globally disabled
      • isMetricsEnabled

        default boolean isMetricsEnabled()
        Check for global metrics switch.
        Returns:
        true if metrics are enabled, false otherwise.
      • isAlternativeAsynchronousAnnoationPresent

        default boolean isAlternativeAsynchronousAnnoationPresent()
      • maxRetries

        default int maxRetries​(org.eclipse.microprofile.faulttolerance.Retry annotation)
      • delay

        default long delay​(org.eclipse.microprofile.faulttolerance.Retry annotation)
      • delayUnit

        default ChronoUnit delayUnit​(org.eclipse.microprofile.faulttolerance.Retry annotation)
      • maxDuration

        default long maxDuration​(org.eclipse.microprofile.faulttolerance.Retry annotation)
      • durationUnit

        default ChronoUnit durationUnit​(org.eclipse.microprofile.faulttolerance.Retry annotation)
      • jitter

        default long jitter​(org.eclipse.microprofile.faulttolerance.Retry annotation)
      • jitterDelayUnit

        default ChronoUnit jitterDelayUnit​(org.eclipse.microprofile.faulttolerance.Retry annotation)
      • retryOn

        default Class<? extends Throwable>[] retryOn​(org.eclipse.microprofile.faulttolerance.Retry annotation)
      • abortOn

        default Class<? extends Throwable>[] abortOn​(org.eclipse.microprofile.faulttolerance.Retry annotation)
      • failOn

        default Class<? extends Throwable>[] failOn​(org.eclipse.microprofile.faulttolerance.CircuitBreaker annotation)
      • skipOn

        default Class<? extends Throwable>[] skipOn​(org.eclipse.microprofile.faulttolerance.CircuitBreaker annotation)
      • delay

        default long delay​(org.eclipse.microprofile.faulttolerance.CircuitBreaker annotation)
      • delayUnit

        default ChronoUnit delayUnit​(org.eclipse.microprofile.faulttolerance.CircuitBreaker annotation)
      • requestVolumeThreshold

        default int requestVolumeThreshold​(org.eclipse.microprofile.faulttolerance.CircuitBreaker annotation)
      • failureRatio

        default double failureRatio​(org.eclipse.microprofile.faulttolerance.CircuitBreaker annotation)
      • successThreshold

        default int successThreshold​(org.eclipse.microprofile.faulttolerance.CircuitBreaker annotation)
      • value

        default int value​(org.eclipse.microprofile.faulttolerance.Bulkhead annotation)
      • waitingTaskQueue

        default int waitingTaskQueue​(org.eclipse.microprofile.faulttolerance.Bulkhead annotation)
      • value

        default long value​(org.eclipse.microprofile.faulttolerance.Timeout annotation)
      • unit

        default ChronoUnit unit​(org.eclipse.microprofile.faulttolerance.Timeout annotation)
      • value

        default Class<? extends org.eclipse.microprofile.faulttolerance.FallbackHandler<?>> value​(org.eclipse.microprofile.faulttolerance.Fallback annotation)
      • fallbackMethod

        default String fallbackMethod​(org.eclipse.microprofile.faulttolerance.Fallback annotation)
      • applyOn

        default Class<? extends Throwable>[] applyOn​(org.eclipse.microprofile.faulttolerance.Fallback annotation)
      • skipOn

        default Class<? extends Throwable>[] skipOn​(org.eclipse.microprofile.faulttolerance.Fallback annotation)