Servertec
Foundation Classes
1.3.3 09/04/2005

stec.sfc.Win32
Class FileSystemChangeListener

java.lang.Object
  extended by stec.sfc.Win32.FileSystemChangeListener
All Implemented Interfaces:
java.lang.Runnable

public final class FileSystemChangeListener
extends java.lang.Object
implements java.lang.Runnable

Used to monitor and dispatch associated FileSystemChangeNotifications.

Since:
1.2.0 12/03/2002
See Also:
FileSystemChangeNotification

Constructor Summary
FileSystemChangeListener(FileSystemChangeNotification change_notification)
          Constructs a new FileSystemChangeListener that monitors the specified FileSystemChangeNotification.
FileSystemChangeListener(FileSystemChangeNotification[] change_notifications)
          Constructs a new FileSystemChangeListener that monitors the specified FileSystemChangeNotifications.
FileSystemChangeListener(FileSystemChangeNotification[] change_notifications, int timeout)
          Constructs a new FileSystemChangeListener that monitors the specified FileSystemChangeNotifications.
FileSystemChangeListener(FileSystemChangeNotification change_notification, int timeout)
          Constructs a new FileSystemChangeListener that monitors the specified FileSystemChangeNotification.
 
Method Summary
 boolean isRunning()
          Returns whether the monitor thread is running.
 void processFailure(java.lang.Throwable throwable)
          Called by the monitor thread when an error occurs while monitoring for change notifications.
 void run()
          Internally called by the monitor thread while running to monitor and dispatch change notifications.
 void stop()
          Used to stop the monitor thread.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSystemChangeListener

public FileSystemChangeListener(FileSystemChangeNotification[] change_notifications)
                         throws java.lang.IllegalArgumentException
Constructs a new FileSystemChangeListener that monitors the specified FileSystemChangeNotifications.

Parameters:
change_notifications - one or more FileSystemChangeNotifications to monitor.
Throws:
java.lang.IllegalArgumentException - if change_notifications was empty
See Also:
FileSystemChangeNotification

FileSystemChangeListener

public FileSystemChangeListener(FileSystemChangeNotification[] change_notifications,
                                int timeout)
                         throws java.lang.IllegalArgumentException
Constructs a new FileSystemChangeListener that monitors the specified FileSystemChangeNotifications.

Parameters:
change_notifications - one or more FileSystemChangeNotifications to monitor.
timeout - the number of milliseconds to wait for a change notification before timing out. -1 for unlimited. Specifying a timeout that is too large may result in thread stalls and may have a negative impact on performance.
Throws:
java.lang.IllegalArgumentException - if change_notifications was empty
See Also:
FileSystemChangeNotification

FileSystemChangeListener

public FileSystemChangeListener(FileSystemChangeNotification change_notification)
Constructs a new FileSystemChangeListener that monitors the specified FileSystemChangeNotification.

Parameters:
change_notification - the FileSystemChangeNotification to monitor.
See Also:
FileSystemChangeNotification

FileSystemChangeListener

public FileSystemChangeListener(FileSystemChangeNotification change_notification,
                                int timeout)
Constructs a new FileSystemChangeListener that monitors the specified FileSystemChangeNotification.

Parameters:
change_notification - the FileSystemChangeNotification to monitor.
timeout - the number of milliseconds to wait for a change notification before timing out. -1 for unlimited. Specifying a timeout that is too large may result in thread stalls and may have a negative impact on performance.
See Also:
FileSystemChangeNotification
Method Detail

run

public final void run()
Internally called by the monitor thread while running to monitor and dispatch change notifications.

Monitors for change notifications and calls appropriate FileSystemChangeHandler.

Specified by:
run in interface java.lang.Runnable
See Also:
FileSystemChangeHandler

stop

public final void stop()
                throws java.lang.IllegalStateException
Used to stop the monitor thread.

Throws:
java.lang.IllegalStateException - if the FileSystemChangeLister thread is not running.

isRunning

public final boolean isRunning()
Returns whether the monitor thread is running.

Returns:
whether the monitor thread is running.

processFailure

public final void processFailure(java.lang.Throwable throwable)
Called by the monitor thread when an error occurs while monitoring for change notifications.

Parameters:
throwable - the error that occurred.

Servertec
Foundation Classes
1.3.3 09/04/2005

Copyright © 2001-2005 Servertec. All rights reserved.