geosolutions-it / http-proxy

Lean and Mean HTTP Proxy written in Java
GNU General Public License v3.0
21 stars 31 forks source link

Improve the proxy configuration loading at runtime #6

Open tdipisa opened 12 years ago

tdipisa commented 12 years ago

Now the http proxy reads the .properties file every time a request comes in to check any possible modifications to the configuration performed in this file. This feature is not very powerful, in GeoServer we are File Watcher that you can reuse:

https://svn.codehaus.org/geoserver/trunk/src/main/src/main/java/org/geoserver/security/PropertyFileWatcher.java https://svn.codehaus.org/geoserver/trunk/src/platform/src/main/java/org/geoserver/platform/FileWatcher.java

Every time a property is required we have to check if the file is stale, in order to reload or not the configuration. The code is already optimized to not do too many controls on the file system, even if you call isStale ().