Class CompressionPool<T>

java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.compression.CompressionPool<T>
All Implemented Interfaces:
LifeCycle
Direct Known Subclasses:
DeflaterPool, InflaterPool

public abstract class CompressionPool<T> extends AbstractLifeCycle
  • Field Details

  • Constructor Details

    • CompressionPool

      public CompressionPool(int capacity)
      Create a Pool of CompressionPool instances. If given a capacity equal to zero the Objects will not be pooled and will be created on acquire and ended on release. If given a negative capacity equal to zero there will be no size restrictions on the Pool
      Parameters:
      capacity - maximum number of Objects which can be contained in the pool
  • Method Details

    • getCapacity

      public int getCapacity()
    • setCapacity

      public void setCapacity(int capacity)
    • newPooled

      protected abstract T newPooled()
    • end

      protected abstract void end(T object)
    • reset

      protected abstract void reset(T object)
    • acquire

      public CompressionPool<T>.Entry acquire()
      Returns:
      Object taken from the pool if it is not empty or a newly created Object
    • release

      public void release(CompressionPool<T>.Entry entry)
      Parameters:
      entry - returns this Object to the pool or calls end(Object) if the pool is full.
    • doStart

      protected void doStart() throws Exception
      Description copied from class: AbstractLifeCycle
      Method to override to start the lifecycle
      Overrides:
      doStart in class AbstractLifeCycle
      Throws:
      AbstractLifeCycle.StopException - If thrown, the lifecycle will immediately be stopped.
      Exception - If there was a problem starting. Will cause a transition to FAILED state
    • doStop

      public void doStop() throws Exception
      Description copied from class: AbstractLifeCycle
      Method to override to stop the lifecycle
      Overrides:
      doStop in class AbstractLifeCycle
      Throws:
      Exception - If there was a problem stopping. Will cause a transition to FAILED state
    • toString

      public String toString()
      Overrides:
      toString in class AbstractLifeCycle