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

org.zodiac.autoconfigure.sentinel.feign.DefaultNacosFeignRuleInitializer Maven / Gradle / Ivy

There is a newer version: 1.6.8
Show newest version
package org.zodiac.autoconfigure.sentinel.feign;

import org.springframework.context.ConfigurableApplicationContext;
import org.zodiac.autoconfigure.feign.annotation.EnableFeignConsumers;
import org.zodiac.core.application.ApplicationInfo;
import org.zodiac.sentinel.feign.config.FeignSentinelConfigInfo;
import org.zodiac.sentinel.feign.support.nacos.BaseNacosFeignRuleInitializer;

public class DefaultNacosFeignRuleInitializer extends BaseNacosFeignRuleInitializer {

    public DefaultNacosFeignRuleInitializer(ApplicationInfo applicationInfo,
        FeignSentinelConfigInfo feignSentinelConfigInfo, ConfigurableApplicationContext applicationContext) {
        super(applicationInfo, feignSentinelConfigInfo, applicationContext);
    }

    @Override
    protected boolean isFeignClientEnabled(Class mainClass) {
        EnableFeignConsumers enableFeignConsumersAnnotation = mainClass.getAnnotation(EnableFeignConsumers.class);
        return null != enableFeignConsumersAnnotation;
    }

    @Override
    protected String[] getFeignClientDeclaredPackages(Class mainClass) {
        EnableFeignConsumers enableFeignConsumersAnnotation = mainClass.getAnnotation(EnableFeignConsumers.class);
        String[] feignClientDeclaredPackages = enableFeignConsumersAnnotation.basePackages();
        return feignClientDeclaredPackages;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy