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
Nested ClassesModifier 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
Deprecated.Since 2.18: use other implementations insteadstatic 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RecyclerPool
<BufferRecycler> Method to call to get the default recycler pool instance: as of Jackson 2.18 this is same as callingthreadLocalPool()
: Jackson 2.17.0 instead had this callnewLockFreePool()
but this was reverted due to problems reported.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> Deprecated.Since 2.18: use one of other implementations instead; seeJsonRecyclerPools.LockFreePool
Javadocs for detailsstatic 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> Deprecated.Since 2.18: use one of other implementations instead; seeJsonRecyclerPools.LockFreePool
Javadocs for detailsstatic 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
Method to call to get the default recycler pool instance: as of Jackson 2.18 this is same as callingthreadLocalPool()
: Jackson 2.17.0 instead had this callnewLockFreePool()
but this was reverted due to problems reported.Default pool will likely be changed in Jackson 3.0 to something else.
- Returns:
- the default
RecyclerPool
implementation to use if no specific implementation desired.
-
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
Deprecated.Since 2.18: use one of other implementations instead; seeJsonRecyclerPools.LockFreePool
Javadocs for detailsAccessor 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
.
-