Top Description Inners Constructors Methods
com.fasterxml.jackson.core.util

public final Class JsonRecyclerPools

extends Object
Class Inheritance
Imports
java.util.concurrent.ArrayBlockingQueue, .ConcurrentLinkedDeque, com.fasterxml.jackson.core.JsonFactory, com.fasterxml.jackson.core.util.RecyclerPool.BoundedPoolBase, .RecyclerPool.ConcurrentDequePoolBase, .RecyclerPool.LockFreePoolBase

Set of RecyclerPool implementations to be used by the default JSON-backed JsonFactory for recycling BufferRecycler containers.
Since
2.16

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
JsonRecyclerPools.BoundedPool

RecyclerPool implementation that uses a bounded queue (ArrayBlockingQueue for recycling instances.

public static class
JsonRecyclerPools.ConcurrentDequePool

RecyclerPool implementation that uses ConcurrentLinkedDeque for recycling instances.

public static class
JsonRecyclerPools.LockFreePool

RecyclerPool implementation that uses a lock free linked list for recycling instances.

public static class
JsonRecyclerPools.NonRecyclingPool

Dummy RecyclerPool implementation that does not recycle anything but simply creates new instances when asked to acquire items.

public static class
JsonRecyclerPools.ThreadLocalPool

ThreadLocal-based RecyclerPool implementation used for recycling BufferRecycler instances: see RecyclerPool.ThreadLocalPoolBase for full explanation of functioning.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static RecyclerPool<BufferRecycler>

Returns:

the default RecyclerPool implementation which is the thread local based one: basically alias to threadLocalPool()).
defaultPool
()

public static RecyclerPool<BufferRecycler>

Returns:

Globally shared instance of BoundedPool.
newBoundedPool
(int
Maximum number of values to pool
size
)

Accessor for constructing a new, non-shared BoundedPool instance.

public static RecyclerPool<BufferRecycler>

Returns:

Globally shared instance of NonRecyclingPool.
newConcurrentDequePool
()

Accessor for constructing a new, non-shared ConcurrentDequePool instance.

public static RecyclerPool<BufferRecycler>

Returns:

Globally shared instance of LockFreePool.
newLockFreePool
()

Accessor for constructing a new, non-shared LockFreePool instance.

public static RecyclerPool<BufferRecycler>

Returns:

Globally shared instance of NonRecyclingPool.
nonRecyclingPool
()

Accessor for getting the shared/global NonRecyclingPool instance (due to design only one instance ever needed)

public static RecyclerPool<BufferRecycler>

Returns:

Globally shared instance of BoundedPool.
sharedBoundedPool
()

Accessor for getting the shared/global BoundedPool instance.

public static RecyclerPool<BufferRecycler>

Returns:

Globally shared instance of NonRecyclingPool.
sharedConcurrentDequePool
()

Accessor for getting the shared/global ConcurrentDequePool instance.

public static RecyclerPool<BufferRecycler>

Returns:

Globally shared instance of LockFreePool.
sharedLockFreePool
()

Accessor for getting the shared/global LockFreePool instance.

public static RecyclerPool<BufferRecycler>

Returns:

Globally shared instance of ThreadLocalPool
threadLocalPool
()

Accessor for getting the shared/global ThreadLocalPool instance (due to design only one instance ever needed)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

JsonRecyclerPoolsback to summary
public JsonRecyclerPools()

Method Detail

defaultPoolback to summary
public static RecyclerPool<BufferRecycler> defaultPool()
Returns:RecyclerPool<BufferRecycler>

the default RecyclerPool implementation which is the thread local based one: basically alias to threadLocalPool()).

newBoundedPoolback to summary
public static RecyclerPool<BufferRecycler> newBoundedPool(int size)

Accessor for constructing a new, non-shared BoundedPool instance.

Parameters
size:int

Maximum number of values to pool

Returns:RecyclerPool<BufferRecycler>

Globally shared instance of BoundedPool.

newConcurrentDequePoolback to summary
public static RecyclerPool<BufferRecycler> newConcurrentDequePool()

Accessor for constructing a new, non-shared ConcurrentDequePool instance.

Returns:RecyclerPool<BufferRecycler>

Globally shared instance of NonRecyclingPool.

newLockFreePoolback to summary
public static RecyclerPool<BufferRecycler> newLockFreePool()

Accessor for constructing a new, non-shared LockFreePool instance.

Returns:RecyclerPool<BufferRecycler>

Globally shared instance of LockFreePool.

nonRecyclingPoolback to summary
public static RecyclerPool<BufferRecycler> nonRecyclingPool()

Accessor for getting the shared/global NonRecyclingPool instance (due to design only one instance ever needed)

Returns:RecyclerPool<BufferRecycler>

Globally shared instance of NonRecyclingPool.

sharedBoundedPoolback to summary
public static RecyclerPool<BufferRecycler> sharedBoundedPool()

Accessor for getting the shared/global BoundedPool instance.

Returns:RecyclerPool<BufferRecycler>

Globally shared instance of BoundedPool.

sharedConcurrentDequePoolback to summary
public static RecyclerPool<BufferRecycler> sharedConcurrentDequePool()

Accessor for getting the shared/global ConcurrentDequePool instance.

Returns:RecyclerPool<BufferRecycler>

Globally shared instance of NonRecyclingPool.

sharedLockFreePoolback to summary
public static RecyclerPool<BufferRecycler> sharedLockFreePool()

Accessor for getting the shared/global LockFreePool instance.

Returns:RecyclerPool<BufferRecycler>

Globally shared instance of LockFreePool.

threadLocalPoolback to summary
public static RecyclerPool<BufferRecycler> threadLocalPool()

Accessor for getting the shared/global ThreadLocalPool instance (due to design only one instance ever needed)

Returns:RecyclerPool<BufferRecycler>

Globally shared instance of ThreadLocalPool

com.fasterxml.jackson.core.util back to summary

public Class JsonRecyclerPools.BoundedPool

extends RecyclerPool.BoundedPoolBase<BufferRecycler>
Class Inheritance

RecyclerPool implementation that uses a bounded queue (ArrayBlockingQueue for recycling instances. This is "bounded" pool since it will never hold on to more BufferRecycler instances than its size configuration: the default size is BoundedPoolBase#DEFAULT_CAPACITY.

Field Summary

Modifier and TypeField and Description
protected static final JsonRecyclerPools.BoundedPool
private static final long
Inherited from com.fasterxml.jackson.core.util.RecyclerPool.BoundedPoolBase:
DEFAULT_CAPACITY

Constructor Summary

AccessConstructor and Description
protected
BoundedPool(int capacityAsId)

Method Summary

Modifier and TypeMethod and Description
public static JsonRecyclerPools.BoundedPool
construct(int capacity)

public BufferRecycler
protected Object
Inherited from com.fasterxml.jackson.core.util.RecyclerPool.BoundedPoolBase:
acquirePooledcapacityreleasePooled

Field Detail

GLOBALback to summary
protected static final JsonRecyclerPools.BoundedPool GLOBAL
serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.core.util.RecyclerPool.BoundedPoolBase.serialVersionUID.

Constructor Detail

BoundedPoolback to summary
protected BoundedPool(int capacityAsId)

Method Detail

constructback to summary
public static JsonRecyclerPools.BoundedPool construct(int capacity)
createPooledback to summary
public BufferRecycler createPooled()

Implements abstract com.fasterxml.jackson.core.util.RecyclerPool.StatefulImplBase.createPooled.

Annotations
@Override
readResolveback to summary
protected Object readResolve()
com.fasterxml.jackson.core.util back to summary

public Class JsonRecyclerPools.ConcurrentDequePool

extends RecyclerPool.ConcurrentDequePoolBase<BufferRecycler>
Class Inheritance

RecyclerPool implementation that uses ConcurrentLinkedDeque for recycling instances.

Pool is unbounded: see RecyclerPool what this means.

Field Summary

Modifier and TypeField and Description
protected static final JsonRecyclerPools.ConcurrentDequePool
private static final long
Inherited from com.fasterxml.jackson.core.util.RecyclerPool.ConcurrentDequePoolBase:
pool

Constructor Summary

AccessConstructor and Description
protected
ConcurrentDequePool(int serialization)

Method Summary

Modifier and TypeMethod and Description
public static JsonRecyclerPools.ConcurrentDequePool
public BufferRecycler
protected Object
Inherited from com.fasterxml.jackson.core.util.RecyclerPool.ConcurrentDequePoolBase:
acquirePooledreleasePooled

Field Detail

GLOBALback to summary
protected static final JsonRecyclerPools.ConcurrentDequePool GLOBAL
serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.core.util.RecyclerPool.ConcurrentDequePoolBase.serialVersionUID.

Constructor Detail

ConcurrentDequePoolback to summary
protected ConcurrentDequePool(int serialization)

Method Detail

constructback to summary
public static JsonRecyclerPools.ConcurrentDequePool construct()
createPooledback to summary
public BufferRecycler createPooled()

Implements abstract com.fasterxml.jackson.core.util.RecyclerPool.StatefulImplBase.createPooled.

Annotations
@Override
readResolveback to summary
protected Object readResolve()
com.fasterxml.jackson.core.util back to summary

public Class JsonRecyclerPools.LockFreePool

extends RecyclerPool.LockFreePoolBase<BufferRecycler>
Class Inheritance

RecyclerPool implementation that uses a lock free linked list for recycling instances.

Pool is unbounded: see RecyclerPool for details on what this means.

Field Summary

Modifier and TypeField and Description
protected static final JsonRecyclerPools.LockFreePool
private static final long

Constructor Summary

AccessConstructor and Description
protected
LockFreePool(int serialization)

Method Summary

Modifier and TypeMethod and Description
public static JsonRecyclerPools.LockFreePool
public BufferRecycler
protected Object
Inherited from com.fasterxml.jackson.core.util.RecyclerPool.LockFreePoolBase:
acquirePooledreleasePooled

Field Detail

GLOBALback to summary
protected static final JsonRecyclerPools.LockFreePool GLOBAL
serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.core.util.RecyclerPool.LockFreePoolBase.serialVersionUID.

Constructor Detail

LockFreePoolback to summary
protected LockFreePool(int serialization)

Method Detail

constructback to summary
public static JsonRecyclerPools.LockFreePool construct()
createPooledback to summary
public BufferRecycler createPooled()

Implements abstract com.fasterxml.jackson.core.util.RecyclerPool.StatefulImplBase.createPooled.

Annotations
@Override
readResolveback to summary
protected Object readResolve()
com.fasterxml.jackson.core.util back to summary

public Class JsonRecyclerPools.NonRecyclingPool

extends RecyclerPool.NonRecyclingPoolBase<BufferRecycler>
Class Inheritance

Dummy RecyclerPool implementation that does not recycle anything but simply creates new instances when asked to acquire items.

Field Summary

Modifier and TypeField and Description
protected static final JsonRecyclerPools.NonRecyclingPool
private static final long

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public BufferRecycler
protected Object
Inherited from com.fasterxml.jackson.core.util.RecyclerPool.NonRecyclingPoolBase:
acquireAndLinkPooledreleasePooled

Field Detail

GLOBALback to summary
protected static final JsonRecyclerPools.NonRecyclingPool GLOBAL
serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.core.util.RecyclerPool.NonRecyclingPoolBase.serialVersionUID.

Constructor Detail

NonRecyclingPoolback to summary
protected NonRecyclingPool()

Method Detail

acquirePooledback to summary
public BufferRecycler acquirePooled()

Implements abstract com.fasterxml.jackson.core.util.RecyclerPool.NonRecyclingPoolBase.acquirePooled.

Implements com.fasterxml.jackson.core.util.RecyclerPool.acquirePooled.

Doc from com.fasterxml.jackson.core.util.RecyclerPool.acquirePooled.

Method for sub-classes to implement for actual acquire logic; called by acquireAndLinkPooled().

Returns:BufferRecycler

Instance acquired (pooled or just constructed)

Annotations
@Override
readResolveback to summary
protected Object readResolve()
com.fasterxml.jackson.core.util back to summary

public Class JsonRecyclerPools.ThreadLocalPool

extends RecyclerPool.ThreadLocalPoolBase<BufferRecycler>
Class Inheritance

ThreadLocal-based RecyclerPool implementation used for recycling BufferRecycler instances: see RecyclerPool.ThreadLocalPoolBase for full explanation of functioning.

Field Summary

Modifier and TypeField and Description
protected static final JsonRecyclerPools.ThreadLocalPool
private static final long

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public BufferRecycler
protected Object
Inherited from com.fasterxml.jackson.core.util.RecyclerPool.ThreadLocalPoolBase:
acquireAndLinkPooledreleasePooled

Field Detail

GLOBALback to summary
protected static final JsonRecyclerPools.ThreadLocalPool GLOBAL
serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.core.util.RecyclerPool.ThreadLocalPoolBase.serialVersionUID.

Constructor Detail

ThreadLocalPoolback to summary
private ThreadLocalPool()

Method Detail

acquirePooledback to summary
public BufferRecycler acquirePooled()

Implements abstract com.fasterxml.jackson.core.util.RecyclerPool.ThreadLocalPoolBase.acquirePooled.

Implements com.fasterxml.jackson.core.util.RecyclerPool.acquirePooled.

Doc from com.fasterxml.jackson.core.util.RecyclerPool.acquirePooled.

Method for sub-classes to implement for actual acquire logic; called by acquireAndLinkPooled().

Returns:BufferRecycler

Instance acquired (pooled or just constructed)

Annotations
@SuppressWarnings:deprecation
@Override
readResolveback to summary
protected Object readResolve()