Package org.unleash.features.aop
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 Summary
Fields Modifier and Type Field Description private org.springframework.context.ApplicationContextapplicationContextprivate List<UnleashContextPreProcessor>contextPreProcessorsprivate static org.slf4j.LoggerLOGGERprivate io.getunleash.Unleashunleash
-
Constructor Summary
Constructors Constructor Description FeatureAdvisor(io.getunleash.Unleash unleash, org.springframework.context.ApplicationContext applicationContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleancheck(Toggle toggle, Optional<io.getunleash.UnleashContext> contextOpt)private ObjectcheckForFeatureToggle(org.aopalliance.intercept.MethodInvocation mi, Toggle toggle, String alterBean, boolean usingAlterBean, String executedBeanName)private StringgetExecutedBeanName(org.aopalliance.intercept.MethodInvocation mi)private Class<?>getExecutedClass(org.aopalliance.intercept.MethodInvocation mi)private TogglegetToggleAnnotation(org.aopalliance.intercept.MethodInvocation mi)private StringgetVariantBeanName(String featureName, FeatureVariant[] featureVariants, Optional<io.getunleash.UnleashContext> contextOpt)Objectinvoke(org.aopalliance.intercept.MethodInvocation mi)private ObjectinvokeAlterBean(org.aopalliance.intercept.MethodInvocation mi, String alterBeanName)private ObjectinvokeMethodInvocation(org.aopalliance.intercept.MethodInvocation methodInvocation)private ObjectinvokePreProcessors(Supplier<Object> supplier)
-
-
-
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
-
contextPreProcessors
@Autowired(required=false) private List<UnleashContextPreProcessor> contextPreProcessors
-
-
Method Detail
-
invoke
public Object invoke(@NotNull org.aopalliance.intercept.MethodInvocation mi) throws Throwable
- Specified by:
invokein interfaceorg.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, FeatureVariant[] featureVariants, Optional<io.getunleash.UnleashContext> contextOpt)
-
invokeMethodInvocation
private Object invokeMethodInvocation(org.aopalliance.intercept.MethodInvocation methodInvocation)
-
invokeAlterBean
private Object invokeAlterBean(org.aopalliance.intercept.MethodInvocation mi, String alterBeanName)
-
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)
-
-