Class ResourceFileMonitor

  extended bycom.anthonyeden.lib.resource.ResourceFileMonitor
All Implemented Interfaces:
ResourceMonitor, java.lang.Runnable

public class ResourceFileMonitor
extends java.lang.Object
implements java.lang.Runnable, ResourceMonitor

Monitors the given File for changes.

Anthony Eden

Constructor Summary
ResourceFileMonitor( file, int delay, ResourceRecipient handler)
          Construct a ResourceFileMonitor for the given file.
Method Summary
 void run()
          The thread's run method.
 void startMonitor()
          Start the monitoring thread.
 void stopMonitor()
          Stop the monitoring thread.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public ResourceFileMonitor( file,
                           int delay,
                           ResourceRecipient handler)
Construct a ResourceFileMonitor for the given file.

file - The file
delay - The delay
handler - The handler ?
Method Detail


public void startMonitor()
Start the monitoring thread. If the thread is already running then this method will not attempt to start a new thread.

Specified by:
startMonitor in interface ResourceMonitor


public void stopMonitor()
Stop the monitoring thread. If the monitoring thread is not running then this method will do nothing.

Specified by:
stopMonitor in interface ResourceMonitor


public void run()
The thread's run method. This method should not be executed directly nor should a thread be manually created, rather the startMonitor() and stopMonitor() methods should be used to start and stop the monitor.

Specified by:
run in interface java.lang.Runnable

Copyright (c) 2000-2003 Anthony Eden. All Rights Reserved.