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