public static enum Pool.StrategyType extends java.lang.Enum<Pool.StrategyType>
Enum Constant and Description |
---|
FIRST
A strategy that looks for an entry always starting from the first entry.
|
RANDOM
A strategy that looks for an entry by iterating from a random starting
index.
|
ROUND_ROBIN
A strategy that looks for an entry by iterating from a starting point
that is incremented on every search.
|
THREAD_ID
A strategy that uses the
Thread.getId() of the current thread
to select a starting point for an entry search. |
Modifier and Type | Method and Description |
---|---|
static Pool.StrategyType |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Pool.StrategyType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Pool.StrategyType FIRST
public static final Pool.StrategyType RANDOM
public static final Pool.StrategyType THREAD_ID
Thread.getId()
of the current thread
to select a starting point for an entry search. Whilst not as performant as
using the ThreadLocal
cache, it may be suitable when the pool is substantially smaller
than the number of available threads.
No entries are favoured and contention is reduced.public static final Pool.StrategyType ROUND_ROBIN
public static Pool.StrategyType[] values()
for (Pool.StrategyType c : Pool.StrategyType.values()) System.out.println(c);
public static Pool.StrategyType valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullCopyright © 1995–2021 Webtide. All rights reserved.