Class SynchronizedStack<T>

java.lang.Object
org.apache.tomcat.util.collections.SynchronizedStack<T>
Type Parameters:
T - The type of object managed by this stack
Direct Known Subclasses:
AbstractProtocol.RecycledProcessors

public class SynchronizedStack<T> extends Object
This is intended as a (mostly) GC-free alternative to Stack when the requirement is to create a pool of re-usable objects with no requirement to shrink the pool. The aim is to provide the bare minimum of required functionality as quickly as possible with minimum garbage.
  • Field Details Link icon

  • Constructor Details Link icon

    • SynchronizedStack Link icon

      public SynchronizedStack()
    • SynchronizedStack Link icon

      public SynchronizedStack(int size, int limit)
  • Method Details Link icon

    • push Link icon

      public boolean push(T obj)
    • pop Link icon

      public T pop()
    • clear Link icon

      public void clear()
    • setLimit Link icon

      public void setLimit(int limit)