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 classRecord of opened file.static final classstatic classRemembers who/where/when opened a file.static final classstatic final classRecord of opened server socket.static final classstatic final classRecord of opened SocketChannel.static final classRecord of opened socket.static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic PrintWriterTrace the "too many open files" error hereAllows to provide stacktrace-lines which cause the element to be excludedstatic intIf the table size grows beyond this, report the tablestatic PrintWriterTrace the open/close op -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidCalled when a file is closed.static voiddump(OutputStream out) Dumps all files that are currently open.static voidstatic List<Listener.Record>static booleanReturns true if the leak detector agent is running.static voidstatic voidCalled when a new file is opened.static voidCalled when a new path is opened.static voidopenDirectoryStream(DirectoryStream<?> directoryStream, Path path) static voidopenFileChannel(FileChannel fileChannel, Path path) static voidopenFileChannel(SeekableByteChannel byteChannel, Path path) static voidopenFileString(Object _this, FileDescriptor fileDescriptor, String path) static voidCalled when a pipe is opened, e.g.static voidopenSelector(Object _this) static voidopenSocket(Object _this) Called when a socket is opened.static voidCalled 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.
-