public class CompositePoolLimitDeterminationStrategy extends java.lang.Object implements PoolLimitDeterminationStrategy
NO_DURATION, NO_ERROR, NO_TIME_UNIT, NO_VALUE| Constructor and Description |
|---|
CompositePoolLimitDeterminationStrategy(PoolLimitDeterminationStrategy... strategies) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acquireCreationPermit(long acquireStartTime,
java.util.concurrent.TimeUnit timeUnit)
Attempts to acquire a creation permit.
|
int |
getAvailablePermits()
Returns the minimum number of permits available across all strategies.
|
void |
onCompleted()
Marks the end of all event callbacks.
|
void |
onEvent(ClientMetricsEvent<?> event,
long duration,
java.util.concurrent.TimeUnit timeUnit,
java.lang.Throwable throwable,
java.lang.Object value)
Event callback for any
MetricsEvent. |
void |
onSubscribe()
A callback when this listener is subscribed to a
MetricEventsPublisher. |
public CompositePoolLimitDeterminationStrategy(PoolLimitDeterminationStrategy... strategies)
public boolean acquireCreationPermit(long acquireStartTime,
java.util.concurrent.TimeUnit timeUnit)
PoolLimitDeterminationStrategyacquireCreationPermit in interface PoolLimitDeterminationStrategyacquireStartTime - The start time for the acquire process in milliseconds since epoch.timeUnit - The timeunit for the acquire start time.true if the permit was acquired, false otherwise.public int getAvailablePermits()
getAvailablePermits in interface PoolLimitDeterminationStrategypublic void onEvent(ClientMetricsEvent<?> event, long duration, java.util.concurrent.TimeUnit timeUnit, java.lang.Throwable throwable, java.lang.Object value)
MetricEventsListenerMetricsEvent. The parameters passed are all the contextual information possible for
any event. There presence or absence will depend on the type of event.onEvent in interface MetricEventsListener<ClientMetricsEvent<?>>event - Event for which this callback has been invoked. This will never be nullduration - If the passed event is MetricsEvent.isTimed() then the actual duration, else
MetricEventsListener.NO_DURATIONtimeUnit - The time unit for the duration, if exists, else MetricEventsListener.NO_TIME_UNITthrowable - If the passed event is MetricsEvent.isError() then the cause of the error, else
MetricEventsListener.NO_ERRORvalue - If the passed event requires custom object to be passed, then that object, else MetricEventsListener.NO_VALUEpublic void onCompleted()
MetricEventsListeneronCompleted in interface MetricEventsListener<ClientMetricsEvent<?>>public void onSubscribe()
MetricEventsListenerMetricEventsPublisher.onSubscribe in interface MetricEventsListener<ClientMetricsEvent<?>>