Class LeakTrackingByteBufferPool

  • All Implemented Interfaces:
    ByteBufferPool, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.LifeCycle

    public class LeakTrackingByteBufferPool
    extends org.eclipse.jetty.util.component.ContainerLifeCycle
    implements ByteBufferPool
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopException
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container

        org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

        org.eclipse.jetty.util.component.LifeCycle.Listener
    • Field Summary

      • Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        FAILED, STARTED, STARTING, STOPPED, STOPPING
      • Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

        KEY
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.nio.ByteBuffer acquire​(int size, boolean direct)
      Requests a ByteBuffer of the given size.
      void clearTracking()  
      long getLeakedAcquires()  
      long getLeakedReleases()  
      long getLeakedResources()  
      protected void leaked​(org.eclipse.jetty.util.LeakDetector.LeakInfo leakInfo)  
      void release​(java.nio.ByteBuffer buffer)
      Returns a ByteBuffer, usually obtained with ByteBufferPool.acquire(int, boolean) (but not necessarily), making it available for recycling and reuse.
      • Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle

        addBean, addBean, addEventListener, addManaged, contains, destroy, doStart, doStop, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans
      • Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.eclipse.jetty.util.component.Container

        getCachedBeans, getEventListeners
      • Methods inherited from interface org.eclipse.jetty.util.component.Dumpable

        dumpSelf
    • Constructor Detail

      • LeakTrackingByteBufferPool

        public LeakTrackingByteBufferPool​(ByteBufferPool delegate)
    • Method Detail

      • acquire

        public java.nio.ByteBuffer acquire​(int size,
                                           boolean direct)
        Description copied from interface: ByteBufferPool

        Requests a ByteBuffer of the given size.

        The returned buffer may have a bigger capacity than the size being requested but it will have the limit set to the given size.

        Specified by:
        acquire in interface ByteBufferPool
        Parameters:
        size - the size of the buffer
        direct - whether the buffer must be direct or not
        Returns:
        the requested buffer
        See Also:
        ByteBufferPool.release(ByteBuffer)
      • clearTracking

        public void clearTracking()
      • getLeakedAcquires

        public long getLeakedAcquires()
        Returns:
        count of BufferPool.acquire() calls that detected a leak
      • getLeakedReleases

        public long getLeakedReleases()
        Returns:
        count of BufferPool.release() calls that detected a leak
      • getLeakedResources

        public long getLeakedResources()
        Returns:
        count of resources that were acquired but not released
      • leaked

        protected void leaked​(org.eclipse.jetty.util.LeakDetector.LeakInfo leakInfo)