com.fasterxml.jackson.core.util

Class RecyclerPool.BoundedPoolBase<P extends RecyclerPool.WithPool<P>>

    • Field Detail

      • DEFAULT_CAPACITY

        public static final int DEFAULT_CAPACITY
        Default capacity which limits number of items that are ever retained for reuse.
        See Also:
        Constant Field Values
    • Constructor Detail

      • BoundedPoolBase

        protected BoundedPoolBase(int capacityAsId)
    • Method Detail

      • acquirePooled

        public P acquirePooled()
        Description copied from interface: RecyclerPool
        Method for sub-classes to implement for actual acquire logic; called by RecyclerPool.acquireAndLinkPooled().
        Returns:
        Instance acquired (pooled or just constructed)
      • releasePooled

        public void releasePooled(P pooled)
        Description copied from interface: RecyclerPool
        Method that should be called when previously acquired (see RecyclerPool.acquireAndLinkPooled()) pooled value that is no longer needed; this lets pool to take ownership for possible reuse.
        Parameters:
        pooled - Pooled instance to release back to pool
      • clear

        public boolean clear()
        Description copied from interface: RecyclerPool
        Optional method that may allow dropping of all pooled Objects; mostly useful for unbounded pool implementations that may retain significant memory and that may then be cleared regularly.
        Returns:
        true If pool supports operation and dropped all pooled Objects; false otherwise.
      • capacity

        public int capacity()

Copyright © 2008–2024 FasterXML. All rights reserved.