@Around("@annotation(org.zeroexchange.feature.annotation.FeatureMarker)")
public Object methodInterceptor(final ProceedingJoinPoint joinPoint) throws Throwable {
Class targetClass = joinPoint.getTarget().getClass();
Method proxiedMethod = ((MethodSignature)joinPoint.getSignature()).getMethod();
Method targetMethod = targetClass.getMethod(proxiedMethod.getName(), proxiedMethod.getParameterTypes());
FeatureMarker marker = (FeatureMarker) targetMethod.getAnnotation(FeatureMarker.class);
if(!featuresRegistry.isFeatureEnabled(marker.value())) {
log.error("The feature '" + marker.value() + "' is not enabled");
throw new FeatureAccessException("The feature '" + marker.value() + "' is not enabled!");
}
return joinPoint.proceed();
}