Class Cleaners


  • public class Cleaners
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.slf4j.Logger sLogger  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.ref.Cleaner.Cleanable cleanByteArray​(java.lang.Object container, byte[] ba, java.lang.Class<?>... excludeClasses)  
      static java.lang.ref.Cleaner.Cleanable cleanByteBuffer​(java.lang.Object container, java.nio.ByteBuffer bb, java.lang.Class<?>... excludeClasses)
      Mark a ByteBuffer to be released to the SoftCache when the given container object is garbage collected.
      • Methods inherited from class java.lang.Object

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

      • sLogger

        public static final org.slf4j.Logger sLogger
    • Method Detail

      • cleanByteBuffer

        public static java.lang.ref.Cleaner.Cleanable cleanByteBuffer​(java.lang.Object container,
                                                                      java.nio.ByteBuffer bb,
                                                                      java.lang.Class<?>... excludeClasses)
        Mark a ByteBuffer to be released to the SoftCache when the given container object is garbage collected. The return value must be stored in a field of the container object in order to trigger this operation.
        Parameters:
        container - The object that uses a ByteBuffer internally.
        bb - The ByteBuffer to be recycled when the object disappears.
        Returns:
        The triggering Cleanable that must be held by the container.
      • cleanByteArray

        public static java.lang.ref.Cleaner.Cleanable cleanByteArray​(java.lang.Object container,
                                                                     byte[] ba,
                                                                     java.lang.Class<?>... excludeClasses)