org.kohsuke.file_leak_detector
Class ActivityListener

java.lang.Object
  extended by 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
static List<ActivityListener> LIST
          These listeners get called.
 
Constructor Summary
ActivityListener()
           
 
Method Summary
 void close(Object obj)
          Called when a file is closed.
 void open(Object obj, File file)
          Called when a new file is opened.
 void openSocket(Object obj)
          Called when a new socket is opened.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LIST

public static final List<ActivityListener> LIST
These listeners get called.

Constructor Detail

ActivityListener

public ActivityListener()
Method Detail

open

public void open(Object obj,
                 File file)
Called when a new file is opened.

Parameters:
obj - FileInputStream, FileOutputStream, RandomAccessFile, or ZipFile.
file - File being opened.

openSocket

public void openSocket(Object obj)
Called when a new socket is opened.

Parameters:
obj - Socket, ServerSocket or SocketChannel

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, or ZipFile.


Copyright © 2014. All rights reserved.