Top Description Fields Constructors Methods
ch.qos.logback.core.util

public Class DefaultInvocationGate

extends Object
implements InvocationGate
Class Inheritance
All Implemented Interfaces
ch.qos.logback.core.util.InvocationGate

This class serves as a gateway for invocations of a "costly" operation on a critical execution path.
Author
Ceki Gülcü

Field Summary

Modifier and TypeField and Description
pack-priv static final int
private long
pack-priv long
private volatile long
pack-priv static final int
private static final long
private static final long
private static final int
private long
private long
pack-priv long

Constructor Summary

AccessConstructor and Description
public
public
DefaultInvocationGate(long minDelayThreshold, long maxDelayThreshold, long currentTime)

Method Summary

Modifier and TypeMethod and Description
private void
public long
pack-priv long
private void
public final boolean
isTooSoon(long
can be TIME_UNAVAILABLE (-1) to signal that time is not available
currentTime
)

Implements ch.qos.logback.core.util.InvocationGate.isTooSoon.

The caller of this method can decide to skip further work if the returned value is true.
private void
updateLimits(long currentTime)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_MASKback to summary
pack-priv static final int DEFAULT_MASK
invocationCounterback to summary
private long invocationCounter
lowerLimitForMaskMatchback to summary
pack-priv long lowerLimitForMaskMatch
maskback to summary
private volatile long mask
MASK_DECREASE_RIGHT_SHIFT_COUNTback to summary
pack-priv static final int MASK_DECREASE_RIGHT_SHIFT_COUNT
MASK_DECREASE_THRESHOLDback to summary
private static final long MASK_DECREASE_THRESHOLD
MASK_INCREASE_THRESHOLDback to summary
private static final long MASK_INCREASE_THRESHOLD
MAX_MASKback to summary
private static final int MAX_MASK
maxDelayThresholdback to summary
private long maxDelayThreshold
minDelayThresholdback to summary
private long minDelayThreshold
upperLimitForNoMaskMatchback to summary
pack-priv long upperLimitForNoMaskMatch

Constructor Detail

DefaultInvocationGateback to summary
public DefaultInvocationGate()
DefaultInvocationGateback to summary
public DefaultInvocationGate(long minDelayThreshold, long maxDelayThreshold, long currentTime)

Method Detail

decreaseMaskback to summary
private void decreaseMask()
getInvocationCounterback to summary
public long getInvocationCounter()
getMaskback to summary
pack-priv long getMask()
increaseMaskback to summary
private void increaseMask()
isTooSoonback to summary
public final boolean isTooSoon(long currentTime)

Implements ch.qos.logback.core.util.InvocationGate.isTooSoon.

Doc from ch.qos.logback.core.util.InvocationGate.isTooSoon.

The caller of this method can decide to skip further work if the returned value is true. Implementations should be able to give a reasonable answer even if current time date is unavailable.

Parameters
currentTime:long

can be TIME_UNAVAILABLE (-1) to signal that time is not available

Returns:boolean

if true, caller should skip further work

Annotations
@Override
updateLimitsback to summary
private void updateLimits(long currentTime)