deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.io.util
Class FileMonitor

java.lang.Object
  extended by org.deegree.io.util.FileMonitor

public class FileMonitor
extends java.lang.Object

Replaces inner class Reloader in AbstractOGCServlet.

Since:
2.0
Version:
2.0, $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18 Jun 2009) $
Author:
Torsten Friebe , last edited by: $Author: mschneider $
See Also:
AbstractOGCServlet, File.lastModified(), Java Tip 125

Nested Class Summary
(package private)  class FileMonitor.FileMonitorTask
           
 
Constructor Summary
protected FileMonitor()
           
 
Method Summary
 void addFileChangeListener(FileChangeListener listener, java.lang.String fileName, long period)
          Add a monitored file with a FileChangeListener.
protected  void fireFileChangeEvent(FileChangeListener listener, java.lang.String fileName)
           
static FileMonitor getInstance()
          Factory method to get singleton instance.
 void removeFileChangeListener(FileChangeListener listener, java.lang.String fileName)
          Remove the listener from the notification list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileMonitor

protected FileMonitor()
Method Detail

getInstance

public static FileMonitor getInstance()
Factory method to get singleton instance.

Returns:
the instance

addFileChangeListener

public void addFileChangeListener(FileChangeListener listener,
                                  java.lang.String fileName,
                                  long period)
                           throws java.io.FileNotFoundException
Add a monitored file with a FileChangeListener.

Parameters:
listener - listener to notify when the file changed.
fileName - name of the file to monitor.
period - polling period in milliseconds.
Throws:
java.io.FileNotFoundException

removeFileChangeListener

public void removeFileChangeListener(FileChangeListener listener,
                                     java.lang.String fileName)
Remove the listener from the notification list.

Parameters:
listener - the listener to be removed.
fileName -

fireFileChangeEvent

protected void fireFileChangeEvent(FileChangeListener listener,
                                   java.lang.String fileName)

deegree 2.5 (2011/06/29 09:44 build-8-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org