| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jaffa.cache.CacheSourceMonitor
This is a helper class to monitor file(s), which provide data to a cache. The cache will be cleared, whenever any of the source files are modified. Note that any open iterators on the cache will have unpredictable results, whenever the cache is flushed. Create an instance of this class, providing the cache and the file(s) to be monitored. Then invoke the startMonitoring method. This will create a daemon Thread, which will monitor the files for any changes. Invoke the stopMonitoring method to stop the thread.
| Nested Class Summary | |
|  class | CacheSourceMonitor.CacheSourceMonitorThreadThis thread class will monitor the files for any changes. | 
| Constructor Summary | |
| CacheSourceMonitor(ICache cache)Creates a new instance of CacheSourceMonitor. | |
| CacheSourceMonitor(ICache cache,
                                     String file)Creates a new instance of CacheSourceMonitor. | |
| Method Summary | |
|  void | addFile(String file)Add a file to be monitored for changes. | 
|  void | startMonitoring()This will create a daemon Thread for monitoring the files. | 
|  void | startMonitoring(int minutes)This will create a daemon Thread for monitoring the files. | 
|  void | stopMonitoring()This will stop the Thread, that was created by the call to the startMonitoring method. | 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
public CacheSourceMonitor(ICache cache)
cache - The cache to be cleared, if any of the source files are modified.
public CacheSourceMonitor(ICache cache,
                          String file)
cache - The cache to be cleared, if any of the source files are modified.file - The file to be monitored. In case, the input represents a directory, then all the files (one level deep) under that directory will be monitored for any changes.| Method Detail | 
public void addFile(String file)
file - The file to be monitored. In case, the input represents a directory, then all the files (one level deep) under that directory will be monitored for any changes.public void startMonitoring()
public void startMonitoring(int minutes)
minutes - The frequency at which the files will be monitored.public void stopMonitoring()
| 
 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||