Interface IPool

All Known Implementing Classes:
GenericPool

public interface IPool
A pool of objects.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    checkin(Object object)
    Add an object to the pool.
    checkout(long timeout)
    Get an object from the pool.
    void
    Close the pool.
    void
    destroy(Object object)
    Destroy an object previously allocated from the pool.
  • Method Details

    • checkin

      void checkin(Object object) throws Exception
      Add an object to the pool.
      Parameters:
      object - The object to be added to the pool.
      Throws:
      Exception
    • checkout

      Object checkout(long timeout) throws Exception
      Get an object from the pool.

      This may be a reused object or a new one, up to the pool strategy and size.

      Parameters:
      timeout - The maximum time to wait for an instance to be available in milliseconds. -1 will wait indefinitely, 0 will not wait.
      Returns:
      A new object from the pool.
      Throws:
      Exception
    • close

      void close() throws Exception
      Close the pool.
      Throws:
      Exception
    • destroy

      void destroy(Object object) throws Exception
      Destroy an object previously allocated from the pool.
      Parameters:
      object - The object to be destroyed.
      Throws:
      Exception