Class LoggerFilterStore

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<java.lang.Object>, java.util.Collection<java.lang.Object>, java.util.List<java.lang.Object>, java.util.logging.Filter, java.util.RandomAccess

    public final class LoggerFilterStore
    extends java.util.ArrayList<java.lang.Object>
    implements java.util.logging.Filter
    This class abuses the java.util.logging.* API to establish a VM-wide object store.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.util.logging.Logger instance
      Hold the logger to prevent GC, weak-referenced globally.
      • Fields inherited from class java.util.AbstractList

        modCount
    • Constructor Summary

      Constructors 
      Constructor Description
      LoggerFilterStore()
      Creates the store.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object get​(int index)
      Override
      static java.util.ArrayList<java.lang.Object> getStore()
      Returns a store object.
      static void inject()
      Injects the store.
      boolean isLoggable​(java.util.logging.LogRecord record)
      Unused
      • Methods inherited from class java.util.ArrayList

        add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
      • Methods inherited from class java.util.AbstractCollection

        containsAll, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, stream, toArray
      • Methods inherited from interface java.util.List

        containsAll
    • Field Detail

      • instance

        protected static java.util.logging.Logger instance
        Hold the logger to prevent GC, weak-referenced globally.
    • Constructor Detail

      • LoggerFilterStore

        public LoggerFilterStore()
        Creates the store.
    • Method Detail

      • get

        public java.lang.Object get​(int index)
        Override
        Specified by:
        get in interface java.util.List<java.lang.Object>
        Overrides:
        get in class java.util.ArrayList<java.lang.Object>
      • isLoggable

        public boolean isLoggable​(java.util.logging.LogRecord record)
        Unused
        Specified by:
        isLoggable in interface java.util.logging.Filter
      • inject

        public static final void inject()
        Injects the store.
      • getStore

        public static final java.util.ArrayList<java.lang.Object> getStore()
        Returns a store object.
        Parameters:
        i - Store object index.
        clazz - Class marker.
        Returns:
        The object.