Package org.kohsuke.file_leak_detector
Class Listener
java.lang.Object
org.kohsuke.file_leak_detector.Listener
Intercepted JDK calls land here.
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Record of opened file.static final class
static class
Remembers who/where/when opened a file.static final class
static final class
Record of opened server socket.static final class
static final class
Record of opened SocketChannel.static final class
Record of opened socket.static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic PrintWriter
Trace the "too many open files" error hereAllows to provide stacktrace-lines which cause the element to be excludedstatic int
If the table size grows beyond this, report the tablestatic PrintWriter
Trace the open/close op -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Called when a file is closed.static void
dump
(OutputStream out) Dumps all files that are currently open.static void
static List<Listener.Record>
static boolean
Returns true if the leak detector agent is running.static void
static void
Called when a new file is opened.static void
Called when a new path is opened.static void
openDirectoryStream
(DirectoryStream<?> directoryStream, Path path) static void
openFileChannel
(FileChannel fileChannel, Path path) static void
openFileChannel
(SeekableByteChannel byteChannel, Path path) static void
openFileString
(Object _this, FileDescriptor fileDescriptor, String path) static void
Called when a pipe is opened, e.g.static void
openSelector
(Object _this) static void
openSocket
(Object _this) Called when a socket is opened.static void
Called when the system has too many open files.
-
Field Details
-
TRACE
Trace the open/close op -
ERROR
Trace the "too many open files" error here -
EXCLUDES
Allows to provide stacktrace-lines which cause the element to be excluded -
THRESHOLD
public static int THRESHOLDIf 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
Called when a new file is opened.- Parameters:
_this
-FileInputStream
,FileOutputStream
,RandomAccessFile
, orZipFile
.f
- File being opened.
-
open
Called when a new path is opened.- Parameters:
_this
-FileInputStream
,FileOutputStream
,RandomAccessFile
, orZipFile
.p
- Path being opened.
-
openFileString
-
openPipe
Called when a pipe is opened, e.g. via SelectorProvider- Parameters:
_this
-SelectorProvider
-
openFileChannel
-
openFileChannel
-
openDirectoryStream
-
openSelector
-
openSocket
Called when a socket is opened. -
getCurrentOpenFiles
-
close
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
, orZipFile
.
-
dump
Dumps all files that are currently open. -
dump
-
outOfDescriptors
public static void outOfDescriptors()Called when the system has too many open files.
-