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
FieldsModifier and TypeFieldDescriptionprivate final org.springframework.context.ApplicationContextprivate List<UnleashContextPreProcessor>private static final org.slf4j.Loggerprivate final io.getunleash.Unleash -
Constructor Summary
ConstructorsConstructorDescriptionFeatureAdvisor(io.getunleash.Unleash unleash, org.springframework.context.ApplicationContext applicationContext) -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanprivate 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, FeatureVariants featureVariants, Optional<io.getunleash.UnleashContext> contextOpt) invoke(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 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
-
-
Constructor Details
-
FeatureAdvisor
public FeatureAdvisor(io.getunleash.Unleash unleash, org.springframework.context.ApplicationContext applicationContext)
-
-
Method Details
-
invoke
- Specified by:
invokein interfaceorg.aopalliance.intercept.MethodInterceptor- Throws:
Throwable
-
checkForFeatureToggle
-
getVariantBeanName
private String getVariantBeanName(String featureName, FeatureVariants featureVariants, Optional<io.getunleash.UnleashContext> contextOpt) -
invokeMethodInvocation
-
invokePreProcessors
-
invokeAlterBean
-
check
-
getExecutedBeanName
-
getToggleAnnotation
-
getExecutedClass
-