Module stormpot
Package stormpot

Class Pooled<T>

  • All Implemented Interfaces:
    java.lang.AutoCloseable, Poolable

    public class Pooled<T>
    extends BasePoolable
    implements Poolable, java.lang.AutoCloseable

    A reference to a pooled object.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      T object
      The object managed by this pooled instance.
    • Constructor Summary

      Constructors 
      Constructor Description
      Pooled​(Slot slot, T object)
      Create a pooled object for the given slot and object to be pooled.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Pooled implements AutoCloseable as a convenient way to release claimed objects back to the pool, using the try-with-resources syntax.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • object

        public final T object

        The object managed by this pooled instance.

    • Constructor Detail

      • Pooled

        public Pooled​(Slot slot,
                      T object)

        Create a pooled object for the given slot and object to be pooled.

        Parameters:
        slot - The slot an object is being allocated for.
        object - The object this pooled instance represents.
    • Method Detail

      • close

        public void close()

        Pooled implements AutoCloseable as a convenient way to release claimed objects back to the pool, using the try-with-resources syntax.

        Specified by:
        close in interface java.lang.AutoCloseable
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object