Package com.fasterxml.jackson.core.util
Class JsonRecyclerPools
- java.lang.Object
-
- com.fasterxml.jackson.core.util.JsonRecyclerPools
-
public final class JsonRecyclerPools extends java.lang.ObjectSet ofRecyclerPoolimplementations to be used by the default JSON-backedJsonFactoryfor recyclingBufferRecyclercontainers.- Since:
- 2.16
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJsonRecyclerPools.BoundedPoolRecyclerPoolimplementation that uses a bounded queue (ArrayBlockingQueuefor recycling instances.static classJsonRecyclerPools.ConcurrentDequePoolRecyclerPoolimplementation that usesConcurrentLinkedDequefor recycling instances.static classJsonRecyclerPools.LockFreePoolRecyclerPoolimplementation that uses a lock free linked list for recycling instances.static classJsonRecyclerPools.NonRecyclingPoolDummyRecyclerPoolimplementation that does not recycle anything but simply creates new instances when asked to acquire items.static classJsonRecyclerPools.ThreadLocalPoolThreadLocal-basedRecyclerPoolimplementation used for recyclingBufferRecyclerinstances: seeRecyclerPool.ThreadLocalPoolBasefor 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()Method to call to get the default recycler pool instance: as of Jackson 2.17.x and earlier (except for 2.17.0) this is same as callingthreadLocalPool()-- 2.17.0 temporarily had this callnewLockFreePool()(but reverted due to problems reported).static RecyclerPool<BufferRecycler>newBoundedPool(int size)Accessor for constructing a new, non-sharedJsonRecyclerPools.BoundedPoolinstance.static RecyclerPool<BufferRecycler>newConcurrentDequePool()Accessor for constructing a new, non-sharedJsonRecyclerPools.ConcurrentDequePoolinstance.static RecyclerPool<BufferRecycler>newLockFreePool()Accessor for constructing a new, non-sharedJsonRecyclerPools.LockFreePoolinstance.static RecyclerPool<BufferRecycler>nonRecyclingPool()Accessor for getting the shared/globalJsonRecyclerPools.NonRecyclingPoolinstance (due to design only one instance ever needed)static RecyclerPool<BufferRecycler>sharedBoundedPool()Accessor for getting the shared/globalJsonRecyclerPools.BoundedPoolinstance.static RecyclerPool<BufferRecycler>sharedConcurrentDequePool()Accessor for getting the shared/globalJsonRecyclerPools.ConcurrentDequePoolinstance.static RecyclerPool<BufferRecycler>sharedLockFreePool()Accessor for getting the shared/globalJsonRecyclerPools.LockFreePoolinstance.static RecyclerPool<BufferRecycler>threadLocalPool()Accessor for getting the shared/globalJsonRecyclerPools.ThreadLocalPoolinstance (due to design only one instance ever needed)
-
-
-
Method Detail
-
defaultPool
public static RecyclerPool<BufferRecycler> defaultPool()
Method to call to get the default recycler pool instance: as of Jackson 2.17.x and earlier (except for 2.17.0) this is same as callingthreadLocalPool()-- 2.17.0 temporarily had this callnewLockFreePool()(but reverted due to problems reported). Will likely be changed in 2.18.0 to something else.- Returns:
- the default
RecyclerPoolimplementation to use if no specific implementation desired.
-
threadLocalPool
public static RecyclerPool<BufferRecycler> threadLocalPool()
Accessor for getting the shared/globalJsonRecyclerPools.ThreadLocalPoolinstance (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.NonRecyclingPoolinstance (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.ConcurrentDequePoolinstance.- Returns:
- Globally shared instance of
JsonRecyclerPools.NonRecyclingPool.
-
newConcurrentDequePool
public static RecyclerPool<BufferRecycler> newConcurrentDequePool()
Accessor for constructing a new, non-sharedJsonRecyclerPools.ConcurrentDequePoolinstance.- Returns:
- Globally shared instance of
JsonRecyclerPools.NonRecyclingPool.
-
sharedLockFreePool
public static RecyclerPool<BufferRecycler> sharedLockFreePool()
Accessor for getting the shared/globalJsonRecyclerPools.LockFreePoolinstance.- Returns:
- Globally shared instance of
JsonRecyclerPools.LockFreePool.
-
newLockFreePool
public static RecyclerPool<BufferRecycler> newLockFreePool()
Accessor for constructing a new, non-sharedJsonRecyclerPools.LockFreePoolinstance.- Returns:
- Globally shared instance of
JsonRecyclerPools.LockFreePool.
-
sharedBoundedPool
public static RecyclerPool<BufferRecycler> sharedBoundedPool()
Accessor for getting the shared/globalJsonRecyclerPools.BoundedPoolinstance.- Returns:
- Globally shared instance of
JsonRecyclerPools.BoundedPool.
-
newBoundedPool
public static RecyclerPool<BufferRecycler> newBoundedPool(int size)
Accessor for constructing a new, non-sharedJsonRecyclerPools.BoundedPoolinstance.- Parameters:
size- Maximum number of values to pool- Returns:
- Globally shared instance of
JsonRecyclerPools.BoundedPool.
-
-