Interface Pool<T>

  • All Known Implementing Classes:
    AbstractPool, StrictMaxPool

    public interface Pool<T>
    A pool of stateless objects.

    A pool is linked to an object factory. How this link is established is left beyond scope.

    Version:
    $Revision: $
    Author:
    Carlo de Wolf
    • Method Detail

      • discard

        void discard​(T obj)
        Discard an object. This will be called in case of a system exception.
        Parameters:
        obj - the object
      • get

        T get()
        Get an object from the pool. This will mark the object as being in use.
        Returns:
        the object
      • getAvailableCount

        int getAvailableCount()
      • getCreateCount

        int getCreateCount()
      • getCurrentSize

        int getCurrentSize()
      • getMaxSize

        int getMaxSize()
      • getRemoveCount

        int getRemoveCount()
      • release

        void release​(T obj)
        Release the object from use.
        Parameters:
        obj - the object
      • setMaxSize

        void setMaxSize​(int maxSize)
      • start

        void start()
        Start the pool.
      • stop

        void stop()
        Stop the pool.