Package net.n2oapp.properties
Class ReloadableProperties
- java.lang.Object
-
- java.util.Dictionary<K,V>
-
- java.util.Hashtable<java.lang.Object,java.lang.Object>
-
- java.util.Properties
-
- net.n2oapp.properties.OverrideProperties
-
- net.n2oapp.properties.ReloadableProperties
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.util.Map<java.lang.Object,java.lang.Object>
- Direct Known Subclasses:
ServletPathProperties
public class ReloadableProperties extends OverrideProperties
ReloadableProperties reads values from .properties file everycacheTimeseconds User: operhod Date: 10.10.13 Time: 17:05- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ReloadableProperties()ReloadableProperties(java.net.URI uri)ReloadableProperties(org.springframework.core.io.Resource resource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectget(java.lang.Object key)intgetCacheTime()java.lang.StringgetCurrentLvlProperty(java.lang.String key)org.springframework.core.io.ResourcegetResource()booleanisExists()booleanisExpired()java.util.Enumeration<java.lang.Object>keys()voidload(java.io.InputStream inStream)voidload(java.io.Reader reader)voidloadFromXML(java.io.InputStream in)java.util.Enumeration<?>propertyNames()java.lang.Objectput(java.lang.Object key, java.lang.Object value)java.lang.Objectremove(java.lang.Object key)voidremoveProperty(java.lang.Object key)voidsetCacheTime(int cacheTime)voidsetResource(org.springframework.core.io.Resource resource)java.util.Set<java.lang.String>stringPropertyNames()java.lang.StringsuperGetProperty(java.lang.String key)получить property текущего уровня, без учета наследованияvoidupdateProperty(java.lang.Object key, java.lang.Object value)-
Methods inherited from class net.n2oapp.properties.OverrideProperties
contains, containsKey, containsValue, getBaseProperties, getProperty, setBaseProperties, size
-
Methods inherited from class java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, elements, entrySet, equals, forEach, getOrDefault, getProperty, hashCode, isEmpty, keySet, list, list, merge, putAll, putIfAbsent, rehash, remove, replace, replace, replaceAll, save, setProperty, store, store, storeToXML, storeToXML, storeToXML, toString, values
-
-
-
-
Constructor Detail
-
ReloadableProperties
public ReloadableProperties(java.net.URI uri) throws java.net.MalformedURLException- Throws:
java.net.MalformedURLException
-
ReloadableProperties
public ReloadableProperties(org.springframework.core.io.Resource resource)
-
ReloadableProperties
public ReloadableProperties()
-
-
Method Detail
-
stringPropertyNames
public java.util.Set<java.lang.String> stringPropertyNames()
- Overrides:
stringPropertyNamesin classOverrideProperties
-
propertyNames
public java.util.Enumeration<?> propertyNames()
- Overrides:
propertyNamesin classjava.util.Properties
-
keys
public java.util.Enumeration<java.lang.Object> keys()
- Overrides:
keysin classOverrideProperties
-
superGetProperty
public java.lang.String superGetProperty(java.lang.String key)
Description copied from class:OverridePropertiesполучить property текущего уровня, без учета наследования- Overrides:
superGetPropertyin classOverrideProperties
-
get
public java.lang.Object get(java.lang.Object key)
- Specified by:
getin interfacejava.util.Map<java.lang.Object,java.lang.Object>- Overrides:
getin classOverrideProperties
-
put
public java.lang.Object put(java.lang.Object key, java.lang.Object value)- Specified by:
putin interfacejava.util.Map<java.lang.Object,java.lang.Object>- Overrides:
putin classjava.util.Properties
-
remove
public java.lang.Object remove(java.lang.Object key)
- Specified by:
removein interfacejava.util.Map<java.lang.Object,java.lang.Object>- Overrides:
removein classjava.util.Properties
-
getCurrentLvlProperty
public java.lang.String getCurrentLvlProperty(java.lang.String key)
- Overrides:
getCurrentLvlPropertyin classOverrideProperties
-
updateProperty
public void updateProperty(java.lang.Object key, java.lang.Object value)
-
removeProperty
public void removeProperty(java.lang.Object key)
-
isExists
public boolean isExists()
-
isExpired
public boolean isExpired()
-
load
public void load(java.io.Reader reader) throws java.io.IOException- Overrides:
loadin classjava.util.Properties- Throws:
java.io.IOException
-
load
public void load(java.io.InputStream inStream) throws java.io.IOException- Overrides:
loadin classjava.util.Properties- Throws:
java.io.IOException
-
loadFromXML
public void loadFromXML(java.io.InputStream in) throws java.io.IOException- Overrides:
loadFromXMLin classjava.util.Properties- Throws:
java.io.IOException
-
getCacheTime
public int getCacheTime()
-
setCacheTime
public void setCacheTime(int cacheTime)
-
getResource
public org.springframework.core.io.Resource getResource()
-
setResource
public void setResource(org.springframework.core.io.Resource resource)
-
-