Package org.kohsuke.file_leak_detector
Class ActivityListener
- java.lang.Object
-
- org.kohsuke.file_leak_detector.ActivityListener
-
public abstract class ActivityListener extends Object
Allows user programs to receive callbacks for file open/close activities.Instantiate this class and put it into
LIST
to start receiving callbacks. Listeners must be concurrent and re-entrant safe.- Author:
- Michal Linhard (michal@linhard.sk), Kohsuke Kawaguchi
-
-
Field Summary
Fields Modifier and Type Field Description static List<ActivityListener>
LIST
These listeners get called.
-
Constructor Summary
Constructors Constructor Description ActivityListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close(Object obj)
Called when a file is closed.void
fd_open(Object obj)
void
open(Object obj, File file)
Called when a new file is opened.void
open(Object obj, Path file)
void
openSocket(Object obj)
Called when a new socket is opened.
-
-
-
Field Detail
-
LIST
public static final List<ActivityListener> LIST
These listeners get called.
-
-
Method Detail
-
open
public void open(Object obj, File file)
Called when a new file is opened.- Parameters:
obj
-FileInputStream
,FileOutputStream
,RandomAccessFile
, orZipFile
.file
- File being opened.
-
openSocket
public void openSocket(Object obj)
Called when a new socket is opened.- Parameters:
obj
-Socket
,ServerSocket
orSocketChannel
-
close
public void close(Object obj)
Called when a file is closed. This method tolerates a double-close where a close method is called on an already closed object.- Parameters:
obj
-FileInputStream
,FileOutputStream
,RandomAccessFile
,Socket
,ServerSocket
, orZipFile
.
-
fd_open
public void fd_open(Object obj)
-
-