Class FeatureAdvisor

java.lang.Object
org.unleash.features.aop.FeatureAdvisor
All Implemented Interfaces:
org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor

@Component("feature.advisor") public class FeatureAdvisor extends Object implements org.aopalliance.intercept.MethodInterceptor
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • unleash

      private final io.getunleash.Unleash unleash
    • applicationContext

      private final org.springframework.context.ApplicationContext applicationContext
    • contextPreProcessors

      @Autowired(required=false) private List<UnleashContextPreProcessor> contextPreProcessors
  • Constructor Details

    • FeatureAdvisor

      public FeatureAdvisor(io.getunleash.Unleash unleash, org.springframework.context.ApplicationContext applicationContext)
  • Method Details

    • invoke

      public Object invoke(@NotNull org.aopalliance.intercept.MethodInvocation mi) throws Throwable
      Specified by:
      invoke in interface org.aopalliance.intercept.MethodInterceptor
      Throws:
      Throwable
    • checkForFeatureToggle

      private Object checkForFeatureToggle(@NotNull org.aopalliance.intercept.MethodInvocation mi, Toggle toggle, String alterBean, boolean usingAlterBean, String executedBeanName)
    • getVariantBeanName

      private String getVariantBeanName(String featureName, FeatureVariants featureVariants, Optional<io.getunleash.UnleashContext> contextOpt)
    • invokeMethodInvocation

      private Object invokeMethodInvocation(org.aopalliance.intercept.MethodInvocation methodInvocation)
    • invokePreProcessors

      private Object invokePreProcessors(Supplier<Object> supplier)
    • invokeAlterBean

      private Object invokeAlterBean(org.aopalliance.intercept.MethodInvocation mi, String alterBeanName)
    • check

      private boolean check(Toggle toggle, Optional<io.getunleash.UnleashContext> contextOpt)
    • getExecutedBeanName

      private String getExecutedBeanName(org.aopalliance.intercept.MethodInvocation mi)
    • getToggleAnnotation

      private Toggle getToggleAnnotation(org.aopalliance.intercept.MethodInvocation mi)
    • getExecutedClass

      private Class<?> getExecutedClass(org.aopalliance.intercept.MethodInvocation mi)