Examples of LazyLeakyBucket


Examples of be.dnsbelgium.rate.LazyLeakyBucket

          }
        }
      }
    }
    int result = ACCESS_DENIED;
    LazyLeakyBucket bucket = null;
    T key = keyFactory.create(SecurityContextHolder.getContext());
    try {
      bucket = objectPool.borrowObject(key);
      if (bucket.add(amount)) {
        result = ACCESS_GRANTED;
      }
    } catch (IllegalArgumentException iae) {
      // this should never occur since amount is minimum zero (Math.max)
      LOGGER.error(String.format("Illegal amount of tokens added to bucket: %s", amount),iae);
View Full Code Here

Examples of be.dnsbelgium.rate.LazyLeakyBucket

   * @throws Exception
   */
  @Override
  public LazyLeakyBucket makeObject(LazyLeakyBucketKey key) throws Exception {
    LOGGER.debug("Creating LazyLeakyBucket for key {}", key);
    return new LazyLeakyBucket(capacity, rate);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.