Package com.fasterxml.jackson.core.util
Class JsonRecyclerPools
java.lang.Object
com.fasterxml.jackson.core.util.JsonRecyclerPools
Set of
RecyclerPool
implementations to be used by the default
JSON-backed JsonFactory
for recycling BufferRecycler
containers.- Since:
- 2.16
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
RecyclerPool
implementation that uses a bounded queue (ArrayBlockingQueue
for recycling instances.static class
RecyclerPool
implementation that usesConcurrentLinkedDeque
for recycling instances.static class
RecyclerPool
implementation that uses a lock free linked list for recycling instances.static class
DummyRecyclerPool
implementation that does not recycle anything but simply creates new instances when asked to acquire items.static class
ThreadLocal
-basedRecyclerPool
implementation used for recyclingBufferRecycler
instances: seeRecyclerPool.ThreadLocalPoolBase
for full explanation of functioning. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic RecyclerPool<BufferRecycler>
static RecyclerPool<BufferRecycler>
newBoundedPool
(int size) Accessor for constructing a new, non-sharedJsonRecyclerPools.BoundedPool
instance.static RecyclerPool<BufferRecycler>
Accessor for constructing a new, non-sharedJsonRecyclerPools.ConcurrentDequePool
instance.static RecyclerPool<BufferRecycler>
Accessor for constructing a new, non-sharedJsonRecyclerPools.LockFreePool
instance.static RecyclerPool<BufferRecycler>
Accessor for getting the shared/globalJsonRecyclerPools.NonRecyclingPool
instance (due to design only one instance ever needed)static RecyclerPool<BufferRecycler>
Accessor for getting the shared/globalJsonRecyclerPools.BoundedPool
instance.static RecyclerPool<BufferRecycler>
Accessor for getting the shared/globalJsonRecyclerPools.ConcurrentDequePool
instance.static RecyclerPool<BufferRecycler>
Accessor for getting the shared/globalJsonRecyclerPools.LockFreePool
instance.static RecyclerPool<BufferRecycler>
Accessor for getting the shared/globalJsonRecyclerPools.ThreadLocalPool
instance (due to design only one instance ever needed)
-
Constructor Details
-
JsonRecyclerPools
public JsonRecyclerPools()
-
-
Method Details
-
defaultPool
- Returns:
- the default
RecyclerPool
implementation which is the thread local based one: basically alias tothreadLocalPool()
).
-
threadLocalPool
Accessor for getting the shared/globalJsonRecyclerPools.ThreadLocalPool
instance (due to design only one instance ever needed)- Returns:
- Globally shared instance of
JsonRecyclerPools.ThreadLocalPool
-
nonRecyclingPool
Accessor for getting the shared/globalJsonRecyclerPools.NonRecyclingPool
instance (due to design only one instance ever needed)- Returns:
- Globally shared instance of
JsonRecyclerPools.NonRecyclingPool
.
-
newConcurrentDequePool
Accessor for constructing a new, non-sharedJsonRecyclerPools.ConcurrentDequePool
instance.- Returns:
- Globally shared instance of
JsonRecyclerPools.NonRecyclingPool
.
-
newLockFreePool
Accessor for constructing a new, non-sharedJsonRecyclerPools.LockFreePool
instance.- Returns:
- Globally shared instance of
JsonRecyclerPools.LockFreePool
.
-
newBoundedPool
Accessor for constructing a new, non-sharedJsonRecyclerPools.BoundedPool
instance.- Parameters:
size
- Maximum number of values to pool- Returns:
- Globally shared instance of
JsonRecyclerPools.BoundedPool
.
-