Package tigase.xmpp.impl

## Class TokenBucketPool

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

- All Implemented Interfaces:
    `Initializable`, `UnregisterAware`

      public class TokenBucketPool
      extends java.lang.Object
      implements Initializable, UnregisterAware

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `TokenBucketPool.TokenBucket` | Single TokenBucket.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `TokenBucketPool()` |
    `TokenBucketPool​(long rate, long per)` |
    `TokenBucketPool​(long rate, long per, java.util.concurrent.TimeUnit timeUnit)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `beforeUnregister()` | Method called before bean unregister.
    `boolean` | `consume​(java.lang.String key)` |
    `long` | `getDefaultPer()` |
    `long` | `getDefaultRate()` |
    `java.util.concurrent.TimeUnit` | `getTimeUnit()` |
    `void` | `initialize()` | Method will be called, when bean will be created, configured and ready to use.
    `void` | `purge()` |
    `void` | `setAutoPurgeEnabled​(boolean enabled)` |
    `void` | `setDefaultPer​(long defaultPer)` |
    `void` | `setDefaultRate​(long defaultRate)` |
    `void` | `setTimeUnit​(java.util.concurrent.TimeUnit timeUnit)` |

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

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

- - ### Constructor Detail

    - #### TokenBucketPool

          public TokenBucketPool​(long rate,
                                 long per,
                                 java.util.concurrent.TimeUnit timeUnit)

    - #### TokenBucketPool

          public TokenBucketPool​(long rate,
                                 long per)

    - #### TokenBucketPool

          public TokenBucketPool()

  - ### Method Detail

    - #### setAutoPurgeEnabled

          public void setAutoPurgeEnabled​(boolean enabled)

    - #### getTimeUnit

          public java.util.concurrent.TimeUnit getTimeUnit()

    - #### setTimeUnit

          public void setTimeUnit​(java.util.concurrent.TimeUnit timeUnit)

    - #### getDefaultRate

          public long getDefaultRate()

    - #### setDefaultRate

          public void setDefaultRate​(long defaultRate)

    - #### getDefaultPer

          public long getDefaultPer()

    - #### setDefaultPer

          public void setDefaultPer​(long defaultPer)

    - #### consume

          public boolean consume​(java.lang.String key)

    - #### purge

          public void purge()

    - #### beforeUnregister

          public void beforeUnregister()

      Description copied from interface: `UnregisterAware`
      Method called before bean unregister.
      Specified by:
        `beforeUnregister` in interface `UnregisterAware`

    - #### initialize

          public void initialize()

      Description copied from interface: `Initializable`
      Method will be called, when bean will be created, configured and ready to use.
      Specified by:
        `initialize` in interface `Initializable`