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

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

Deprecated Since 2.18: use other implementations instead
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 to use if no specific implementation desired.
defaultPool
()

Method to call to get the default recycler pool instance: as of Jackson 2.18 this is same as calling threadLocalPool(): Jackson 2.17.0 instead had this call newLockFreePool() but this was reverted due to problems reported.

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
()
Deprecated Since 2.18: use one of other implementations instead; see LockFreePool Javadocs for details

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
()
Deprecated Since 2.18: use one of other implementations instead; see LockFreePool Javadocs for details

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()

Method to call to get the default recycler pool instance: as of Jackson 2.18 this is same as calling threadLocalPool(): Jackson 2.17.0 instead had this call newLockFreePool() but this was reverted due to problems reported.

Default pool will likely be changed in Jackson 3.0 to something else.

Returns:RecyclerPool<BufferRecycler>

the default RecyclerPool implementation to use if no specific implementation desired.

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()

Deprecated

Since 2.18: use one of other implementations instead; see LockFreePool Javadocs for details

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

Returns:RecyclerPool<BufferRecycler>

Globally shared instance of LockFreePool.

Annotations
@Deprecated
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()

Deprecated

Since 2.18: use one of other implementations instead; see LockFreePool Javadocs for details

Accessor for getting the shared/global LockFreePool instance.

Returns:RecyclerPool<BufferRecycler>

Globally shared instance of LockFreePool.

Annotations
@Deprecated
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
Annotations
@Deprecated

Deprecated

Since 2.18: use other implementations instead

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

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

Note

serious issues found with 2.17.0 lead to deprecation of this implementation -- basically it is possible to have unbalanced acquire/release success rate lead to excessive growth of pooled instances. See jackson-core#1260 for details.

Field Summary

Modifier and TypeField and Description
protected static final JsonRecyclerPools.LockFreePool
GLOBAL

References Deprecated JsonRecyclerPools.LockFreePool is deprecated or references (maybe indirectly) at least one deprecated element.
private static final long

Constructor Summary

AccessConstructor and Description
protected
LockFreePool(int serialization)

Method Summary

Modifier and TypeMethod and Description
public static JsonRecyclerPools.LockFreePool
construct()
References Deprecated JsonRecyclerPools.LockFreePool is deprecated or references (maybe indirectly) at least one deprecated element.

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

References Deprecated

JsonRecyclerPools.LockFreePool is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

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()

References Deprecated

JsonRecyclerPools.LockFreePool is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

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()