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

io.smallrye.faulttolerance.metrics.CdiMeteredOperationImpl Maven / Gradle / Ivy

There is a newer version: 6.6.2
Show newest version
package io.smallrye.faulttolerance.metrics;

import io.smallrye.faulttolerance.SpecCompatibility;
import io.smallrye.faulttolerance.config.FaultToleranceOperation;
import io.smallrye.faulttolerance.core.metrics.MeteredOperation;
import io.smallrye.faulttolerance.internal.InterceptionPoint;

public final class CdiMeteredOperationImpl implements MeteredOperation {
    private final FaultToleranceOperation operation;
    private final InterceptionPoint interceptionPoint;
    private final SpecCompatibility specCompatibility;

    public CdiMeteredOperationImpl(FaultToleranceOperation operation, InterceptionPoint interceptionPoint,
            SpecCompatibility specCompatibility) {
        this.operation = operation;
        this.interceptionPoint = interceptionPoint;
        this.specCompatibility = specCompatibility;
    }

    @Override
    public boolean isAsynchronous() {
        return specCompatibility.isOperationTrulyOrPseudoAsynchronous(operation);
    }

    @Override
    public boolean hasBulkhead() {
        return operation.hasBulkhead();
    }

    @Override
    public boolean hasCircuitBreaker() {
        return operation.hasCircuitBreaker();
    }

    @Override
    public boolean hasFallback() {
        return operation.hasFallback();
    }

    @Override
    public boolean hasRateLimit() {
        return operation.hasRateLimit();
    }

    @Override
    public boolean hasRetry() {
        return operation.hasRetry();
    }

    @Override
    public boolean hasTimeout() {
        return operation.hasTimeout();
    }

    @Override
    public String name() {
        return operation.getName();
    }

    @Override
    public Object cacheKey() {
        return interceptionPoint;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy