Annotation Interface BucketToken
Annotation indicating that the current annotated method or all methods of the
annotated class are protected with "Token-bucket" rate-limiting algorithm. If
no fallback method was specified, the exception
NoEnoughTokensAvailable
will be thrown.- Since:
- 1.9.0
- See Also:
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionName of the fallback method to use when "Token-bucket" rate-limiting algorithm block access to the protected method.intNumber of token to consume to execute protected method.
-
Element Details
-
value
String valueName of the bucket to be used. Bucket must be configured or an exception will be thrown.- Returns:
- Name of the bucket to be used
- Since:
- 1.9.0
-
-
-
fallbackMethod
String fallbackMethodName of the fallback method to use when "Token-bucket" rate-limiting algorithm block access to the protected method. If there are multiple methods matching given name, the method that has the most-closest match will be invoked. The method could have no arguments or only one: the exceptionNoEnoughTokensAvailable.- Returns:
- Name of the fallback method
- Since:
- 1.9.0
- See Also:
- Default:
- ""
-
tokenToConsume
int tokenToConsumeNumber of token to consume to execute protected method.- Returns:
- Number of token to consume
- Since:
- 1.9.0
- Default:
- 1
-