Package org.zeroexchange.feature.annotation

Examples of org.zeroexchange.feature.annotation.FeatureMarker


    private FeaturesRegistry featuresRegistry;
   
    @Around("@within(org.zeroexchange.feature.annotation.FeatureMarker)")
    public Object typeInterceptor(final ProceedingJoinPoint joinPoint) throws Throwable {
        Class featuredClass = joinPoint.getTarget().getClass();
        FeatureMarker marker = (FeatureMarker) featuredClass.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();
    }
View Full Code Here


    @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();
    }
View Full Code Here

TOP

Related Classes of org.zeroexchange.feature.annotation.FeatureMarker

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.