org.zodiac.autoconfigure.eureka.condition.ConditionalOnEurekaEnabled Maven / Gradle / Ivy
package org.zodiac.autoconfigure.eureka.condition;
import org.springframework.boot.autoconfigure.condition.AllNestedConditions;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Conditional;
import org.zodiac.eureka.base.constants.EurekaBaseSystemPropertiesConstants;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
@Conditional({ConditionalOnEurekaEnabled.OnEurekaEnabledCondition.class})
public @interface ConditionalOnEurekaEnabled {
class OnEurekaEnabledCondition extends AllNestedConditions {
public OnEurekaEnabledCondition() {
super(ConfigurationPhase.REGISTER_BEAN);
}
@ConditionalOnClass(com.netflix.discovery.EurekaClientConfig.class)
static class FoundClass {
}
@ConditionalOnProperty(value = EurekaBaseSystemPropertiesConstants.EUREKA_ENABLED, havingValue = "true")
static class FoundProperty {
}
}
}