Class AbstractPool<I,O>
- java.lang.Object
-
- org.apache.activemq.artemis.utils.AbstractPool<I,O>
-
- Direct Known Subclasses:
SimpleString.StringSimpleStringPool
public abstract class AbstractPool<I,O> extends java.lang.ObjectThread-safe<T>interner.Differently from
String.intern()it contains a fixed amount of entries and when used by concurrent threads it doesn't ensure the uniqueness of the entries ie the same entry could be allocated multiple times by concurrent calls.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_POOL_CAPACITY
-
Constructor Summary
Constructors Constructor Description AbstractPool()AbstractPool(int capacity)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Ocreate(I value)Create a new entry.OgetOrCreate(I value)Returns and interned entry if possible, a new one otherwise.protected inthashCode(I value)protected abstract booleanisEqual(O entry, I value)Returnstrueif theentrycontent is equal tovalue;
-
-
-
Field Detail
-
DEFAULT_POOL_CAPACITY
public static final int DEFAULT_POOL_CAPACITY
- See Also:
- Constant Field Values
-
-