public class SharedLimiterFactory<S extends ScopeType<S>> extends Object implements SharedResourceFactory<Limiter,SharedLimiterKey,S>
SharedResourceFactory to create shared Limiters using a SharedResourcesBroker.
The factory creates a MultiLimiter combining a Limiter at the indicated scope with the
Limiter at all immediate parent scopes (obtained from the broker itself). The factory reads the property
LIMITER_CLASS_KEY from the input ConfigView to determine the class of Limiter to create
at the indicated scope. If the key is not found, a NoopLimiter is generated instead (to combine with
parent Limiters).
| Modifier and Type | Field and Description |
|---|---|
static String |
FAIL_IF_NO_GLOBAL_LIMITER_KEY |
static String |
FAIL_ON_UNKNOWN_RESOURCE_ID |
static String |
LIMITER_CLASS_KEY |
static String |
NAME |
static String |
SKIP_GLOBAL_LIMITER_KEY
Skip use of global limiter.
|
| Constructor and Description |
|---|
SharedLimiterFactory() |
| Modifier and Type | Method and Description |
|---|---|
SharedResourceFactoryResponse<Limiter> |
createResource(SharedResourcesBroker<S> broker,
ScopedConfigView<S,SharedLimiterKey> configView) |
S |
getAutoScope(SharedResourcesBroker<S> broker,
ConfigView<S,SharedLimiterKey> config) |
String |
getName() |
public static final String NAME
public static final String LIMITER_CLASS_KEY
public static final String FAIL_IF_NO_GLOBAL_LIMITER_KEY
public static final String SKIP_GLOBAL_LIMITER_KEY
public static final String FAIL_ON_UNKNOWN_RESOURCE_ID
public String getName()
getName in interface SharedResourceFactory<Limiter,SharedLimiterKey,S extends ScopeType<S>>public SharedResourceFactoryResponse<Limiter> createResource(SharedResourcesBroker<S> broker, ScopedConfigView<S,SharedLimiterKey> configView) throws NotConfiguredException
createResource in interface SharedResourceFactory<Limiter,SharedLimiterKey,S extends ScopeType<S>>NotConfiguredExceptionpublic S getAutoScope(SharedResourcesBroker<S> broker, ConfigView<S,SharedLimiterKey> config)
getAutoScope in interface SharedResourceFactory<Limiter,SharedLimiterKey,S extends ScopeType<S>>