|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.util.Dictionary
java.util.Hashtable
java.util.Properties
org.jcomet.dynamic.DynamicProperties
This object can monitor its source configuration file and reload when even it is modified. It is also provides the ability to register listeners that are notified when properties change.
| Field Summary |
| Fields inherited from class java.util.Properties |
defaults |
| Constructor Summary | |
DynamicProperties()
|
|
| Method Summary | |
void |
fileChanged(java.io.File file)
Internal use - do not invoke |
protected void |
finalize()
Internal use - do not invoke |
PropertyChangedListener |
getPropertyChangedListener()
Returns the PropertyChangedListener of this object |
void |
load(java.io.File propFile)
Creates a DynamicProperties that does not monitor its source file. |
void |
load(java.io.File propFile,
long monitorInterval)
Once loaded this object will monitor and reload every change to its source file. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
same as super but with a notification addon |
void |
reload()
Forces this Object to reload all its source files and notify the listener of any change in them |
void |
setPropertyChangedListener(PropertyChangedListener propertyChangedListener)
Sets the PropertyChangedListener of this object, application should use this method to register themselves as listeners |
| Methods inherited from class java.util.Properties |
getProperty, getProperty, list, list, load, propertyNames, save, setProperty, store |
| Methods inherited from class java.util.Hashtable |
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, putAll, rehash, remove, size, toString, values |
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public DynamicProperties()
| Method Detail |
public void load(java.io.File propFile)
throws java.io.IOException
java.io.IOException
public void load(java.io.File propFile,
long monitorInterval)
throws java.io.IOException
monitorInterval - -1 for "do not monitor", greater then 0 for "monitor every monitorInterval" (milli)
java.io.IOExceptionpublic void reload()
reload in interface Reloadable
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
put in interface java.util.Map
public void fileChanged(java.io.File file)
throws java.io.IOException
fileChanged in interface FileChangeListenerfile - the file that was changed
java.io.IOException
protected void finalize()
throws java.lang.Throwable
java.lang.Throwablepublic PropertyChangedListener getPropertyChangedListener()
public void setPropertyChangedListener(PropertyChangedListener propertyChangedListener)
propertyChangedListener - PropertyChangedListener of this object
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||