com.scooterframework.admin
Class PropertyFileChangeMonitor

java.lang.Object
  extended by com.scooterframework.admin.PropertyFileChangeMonitor

public class PropertyFileChangeMonitor
extends java.lang.Object

PropertyFileChangeMonitor class monitors property file changes and also notifies the changes to associated observers.

The default monitor interval is 2000 milliseconds. This can be changed by System property property.load.interval.

ApplicationConfig.getInstance() must be called before this class can be used.


Nested Class Summary
 class PropertyFileChangeMonitor.PropertyFileChangeMonitorTimerTask
          FileChangeMonitorTimerTask is responsible for scanning files.
 
Method Summary
 java.lang.String getFullFileName(java.lang.String fileName)
           
static PropertyFileChangeMonitor getInstance()
           
 void registerObserver(java.util.Observer observer, java.io.File file)
           
 void registerObserver(java.util.Observer observer, java.lang.String fileName)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static PropertyFileChangeMonitor getInstance()

start

public void start()

stop

public void stop()

registerObserver

public void registerObserver(java.util.Observer observer,
                             java.lang.String fileName)

registerObserver

public void registerObserver(java.util.Observer observer,
                             java.io.File file)

getFullFileName

public java.lang.String getFullFileName(java.lang.String fileName)