Class 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 Detail

      • LOGGER

        private static final org.slf4j.Logger LOGGER
      • unleash

        private final io.getunleash.Unleash unleash
      • applicationContext

        private final org.springframework.context.ApplicationContext applicationContext
    • Constructor Detail

      • FeatureAdvisor

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

      • 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)
      • invokeMethodInvocation

        private Object invokeMethodInvocation​(org.aopalliance.intercept.MethodInvocation methodInvocation)
      • 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)