Enum Class OverflowStrategy
- All Implemented Interfaces:
Serializable,Comparable<OverflowStrategy>,Constable
Strategy applied when the diagnostic queue is full and a new event arrives.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionBlock the producer thread until space becomes available in the queue.Discard the new event; the queue contents remain unchanged.Remove the oldest element from the head of the queue to make room for the new one. -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanenqueue(DiagnosticEvent event, LinkedBlockingDeque<DiagnosticEvent> deque, DiagnosticQueueMetrics metrics) Place the given event into the deque according to this strategy's overflow semantics.static OverflowStrategyReturns the enum constant of this class with the specified name.static OverflowStrategy[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
DROP_OLDEST
Remove the oldest element from the head of the queue to make room for the new one. -
DROP_NEWEST
Discard the new event; the queue contents remain unchanged. -
BLOCK
Block the producer thread until space becomes available in the queue.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
enqueue
public abstract boolean enqueue(DiagnosticEvent event, LinkedBlockingDeque<DiagnosticEvent> deque, DiagnosticQueueMetrics metrics) Place the given event into the deque according to this strategy's overflow semantics.- Parameters:
event- the event to enqueue; must not benulldeque- the backing dequemetrics- metrics recorder- Returns:
trueif the event was placed in the queue,falseif dropped
-