Package com.ccbill.clessidra.annotations

Examples of com.ccbill.clessidra.annotations.RateLimited


    // extract MethodSignature
    MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
    logger.debug("Intercepted a method call on " + methodSignature.toString());

    // find the RateLimited annotation, method gets priority over class
    RateLimited annotation = methodSignature.getMethod().getAnnotation(RateLimited.class);
    if (annotation == null) {
      annotation = (RateLimited) joinPoint.getSourceLocation().getWithinType().getAnnotation(RateLimited.class);
    }

    // resolve method group name based on the methodGrouping in the annotation
    String methodGroupName = null;
    switch (annotation.methodGrouping()) {
    case GROUPED:
      methodGroupName = annotation.groupName();
      break;
    case UNGROUPED:
      methodGroupName = methodSignature.toString();
      break;
    default:
      methodGroupName = methodSignature.toString();
      break;
    }

    // get the limiter strategy chain from the spring context
    AbstractLimiterStrategy limiterStrategyChain = (AbstractLimiterStrategy) applicationContext.getBean(annotation.limiterBean());

    // generate a uuid to be used later on if rollback is required
    UUID methodInvocationUUID = UUIDGenerator.generateUUID();

    // run through the limiter strategy chain and get the conclusion
View Full Code Here

TOP

Related Classes of com.ccbill.clessidra.annotations.RateLimited

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.