Module 
Package org.xnio

Interface Pooled<T>

  • Type Parameters:
    T - the pooled resource type
    All Superinterfaces:
    java.lang.AutoCloseable

    public interface Pooled<T>
    extends java.lang.AutoCloseable
    Deprecated.
    A resource which is pooled.
    Author:
    David M. Lloyd
    • Method Detail

      • discard

        void discard()
        Deprecated.
        Discard this resource. Any backing resources corresponding to this pooled resource will be rendered unavailable until the pooled resource has been garbage-collected.
      • free

        void free()
        Deprecated.
        Free this resource for immediate re-use. The resource must not be accessed again after calling this method; if it is possible that an instance is still in use, you must call discard() instead.
      • getResource

        T getResource()
               throws java.lang.IllegalStateException
        Deprecated.
        Get the pooled resource.
        Returns:
        the pooled resource
        Throws:
        java.lang.IllegalStateException - if the resource has been freed or discarded already
      • close

        void close()
        Deprecated.
        Delegates to free().
        Specified by:
        close in interface java.lang.AutoCloseable