Package org.eclipse.jetty.util
Enum Class ConcurrentPool.StrategyType
- All Implemented Interfaces:
Serializable
,Comparable<ConcurrentPool.StrategyType>
,Constable
- Enclosing class:
- ConcurrentPool<P>
The type of the strategy to use for the pool.
The strategy primarily determines where iteration over the pool entries begins.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionA strategy that looks for an entry always starting from the first entry.A strategy that looks for an entry by iterating from a random starting index.A strategy that looks for an entry by iterating from a starting point that is incremented on every search.A strategy that uses theThread.getId()
of the current thread to select a starting point for an entry search. -
Method Summary
Modifier and TypeMethodDescriptionstatic ConcurrentPool.StrategyType
Returns the enum constant of this class with the specified name.static ConcurrentPool.StrategyType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
FIRST
A strategy that looks for an entry always starting from the first entry. It will favour the early entries in the pool, but may contend on them more. -
RANDOM
A strategy that looks for an entry by iterating from a random starting index. No entries are favoured and contention is reduced. -
THREAD_ID
A strategy that uses theThread.getId()
of the current thread to select a starting point for an entry search. No entries are favoured and contention is reduced. -
ROUND_ROBIN
A strategy that looks for an entry by iterating from a starting point that is incremented on every search. This gives similar results to the random strategy but with more predictable behaviour. No entries are favoured and contention is reduced.
-
-
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
-