Interface ObjectPoolHandler<T>


  • public interface ObjectPoolHandler<T>
    • Method Detail

      • validate

        ObjectPoolConfiguration validate​(ObjectPoolConfiguration original)
        Validates, copies and updates the original ObjectPoolConfiguration.

        This class can validate and if necessary it changes the original configuration.

        Parameters:
        original - custom configured instance.
        Returns:
        new instance of the original config.
      • makeObject

        T makeObject()
        Makes a new instance of the pooled object.

        This method is called whenever a new instance is needed.

        Returns:
        new instance of T.
      • testObject

        void testObject​(T object)
        Tests the borrowed object.

        This method is invoked on head instances to make sure they can be borrowed from the pool.

        Parameters:
        object - the pooled object.
      • disposeObject

        void disposeObject​(T object)
        Disposes the object.

        This method is invoked on every instance when it is being "dropped" from the pool (whether due to the response from testObject(Object), or for reasons specific to the pool implementation.)

        Parameters:
        object - The "dropped" object.
      • shutdown

        void shutdown()
        Releases any allocated resources.

        Existing active objects will remain alive and be allowed to shutdown gracefully, but no more objects will be allocated.