Interface Poolable<E extends java.lang.Exception>


  • public interface Poolable<E extends java.lang.Exception>

    Interface for a resource that can be used with an object Pool. Objects can implement this marker interface to expose clean ways to clean up a resource prior to being returned to the pool, and initialize it after its checked out of the pool. Using an object in a Pool does not require implementing this interface, but when this is implemented, the pool implementation can better init and clean up pooled resources. Calls to activate() and {link #deactivate} are paired in that the object, once deactivated, should require activation before it can be used again.

    Since:
    0.6.5
    Version:
    0.6.5
    Author:
    Michael Grove
    • Method Detail

      • activate

        void activate()
               throws E extends java.lang.Exception
        Prepare this object for use.
        Throws:
        E - if the object cannot be acticated
        E extends java.lang.Exception
      • deactivate

        void deactivate()
                 throws E extends java.lang.Exception
        Clean up the state of an object. Should not clean it up to the extend the object can no longer be reused.
        Throws:
        E - if the object could not safely be deactivated
        E extends java.lang.Exception