Class TakenListener<T>

java.lang.Object
org.vibur.objectpool.util.TakenListener<T>
All Implemented Interfaces:
Listener<T>

public class TakenListener<T> extends Object implements Listener<T>
An instance of this class can be supplied to the pool at its creation time, and its methods will be called upon calling the pool take and restore operations. This listener can provide a list of all currently taken objects from the pool, which can be useful for testing and debugging purposes.
Author:
Simeon Malchev
  • Constructor Details

    • TakenListener

      public TakenListener()
    • TakenListener

      public TakenListener(int initialCapacity)
  • Method Details

    • onTake

      public void onTake(T object)
      Specified by:
      onTake in interface Listener<T>
    • onRestore

      public void onRestore(T object, boolean valid)
      Specified by:
      onRestore in interface Listener<T>
    • getTaken

      protected T[] getTaken(T[] a)