Package tigase.xmpp.impl

# Class TokenBucketPool.TokenBucket

java.lang.Object
tigase.xmpp.impl.TokenBucketPool.TokenBucket

Enclosing class:
  TokenBucketPool

public static class TokenBucketPool.TokenBucket extends Object
Single TokenBucket.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TokenBucket(long rate, long per)`
  Create Token Bucket.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `consume()`
  Consume token if available.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### TokenBucket

    public TokenBucket(long rate, long per)
    Create Token Bucket.
    Parameters:
      `rate` - amount of available tokens
      `per` - per nanosecond!

- ## Method Details

  - ### consume

    public boolean consume()
    Consume token if available.
    Returns:
      `true` if token was available.