Class Listener

java.lang.Object
org.kohsuke.file_leak_detector.Listener

public class Listener extends Object
Intercepted JDK calls land here.
Author:
Kohsuke Kawaguchi
  • Field Details

    • TRACE

      public static PrintWriter TRACE
      Trace the open/close op
    • ERROR

      public static PrintWriter ERROR
      Trace the "too many open files" error here
    • EXCLUDES

      public static final List<String> EXCLUDES
      Allows to provide stacktrace-lines which cause the element to be excluded
    • THRESHOLD

      public static int THRESHOLD
      If the table size grows beyond this, report the table
  • Constructor Details

    • Listener

      public Listener()
  • Method Details

    • isAgentInstalled

      public static boolean isAgentInstalled()
      Returns true if the leak detector agent is running.
    • makeStrong

      public static void makeStrong()
    • open

      public static void open(Object _this, File f)
      Called when a new file is opened.
      Parameters:
      _this - FileInputStream, FileOutputStream, RandomAccessFile, or ZipFile.
      f - File being opened.
    • open

      public static void open(Object _this, Path p)
      Called when a new path is opened.
      Parameters:
      _this - FileInputStream, FileOutputStream, RandomAccessFile, or ZipFile.
      p - Path being opened.
    • openFileString

      public static void openFileString(Object _this, FileDescriptor fileDescriptor, String path)
    • openPipe

      public static void openPipe(Object _this)
      Called when a pipe is opened, e.g. via SelectorProvider
      Parameters:
      _this - SelectorProvider
    • openFileChannel

      public static void openFileChannel(FileChannel fileChannel, Path path)
    • openFileChannel

      public static void openFileChannel(SeekableByteChannel byteChannel, Path path)
    • openDirectoryStream

      public static void openDirectoryStream(DirectoryStream<?> directoryStream, Path path)
    • openSelector

      public static void openSelector(Object _this)
    • openSocket

      public static void openSocket(Object _this)
      Called when a socket is opened.
    • getCurrentOpenFiles

      public static List<Listener.Record> getCurrentOpenFiles()
    • close

      public static void close(Object _this)
      Called when a file is closed. This method tolerates a double-close where a close method is called on an already closed object.
      Parameters:
      _this - FileInputStream, FileOutputStream, RandomAccessFile, Socket, ServerSocket, or ZipFile.
    • dump

      public static void dump(OutputStream out)
      Dumps all files that are currently open.
    • dump

      public static void dump(Writer w)
    • outOfDescriptors

      public static void outOfDescriptors()
      Called when the system has too many open files.