Package net.n2oapp.properties
Class ReloadableProperties
- java.lang.Object
-
- java.util.Dictionary<K,V>
-
- java.util.Hashtable<Object,Object>
-
- java.util.Properties
-
- net.n2oapp.properties.OverrideProperties
-
- net.n2oapp.properties.ReloadableProperties
-
- All Implemented Interfaces:
Serializable,Cloneable,Map<Object,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
-
-
Field Summary
-
Fields inherited from class java.util.Properties
defaults
-
-
Constructor Summary
Constructors Constructor Description ReloadableProperties()ReloadableProperties(URI uri)ReloadableProperties(org.springframework.core.io.Resource resource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectget(Object key)intgetCacheTime()StringgetCurrentLvlProperty(String key)org.springframework.core.io.ResourcegetResource()booleanisExists()booleanisExpired()Enumeration<Object>keys()voidload(InputStream inStream)voidload(Reader reader)voidloadFromXML(InputStream in)Enumeration<?>propertyNames()Objectput(Object key, Object value)Objectremove(Object key)voidremoveProperty(Object key)voidsetCacheTime(int cacheTime)voidsetResource(org.springframework.core.io.Resource resource)Set<String>stringPropertyNames()StringsuperGetProperty(String key)получить property текущего уровня, без учета наследованияvoidupdateProperty(Object key, 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(URI uri) throws MalformedURLException
- Throws:
MalformedURLException
-
ReloadableProperties
public ReloadableProperties(org.springframework.core.io.Resource resource)
-
ReloadableProperties
public ReloadableProperties()
-
-
Method Detail
-
stringPropertyNames
public Set<String> stringPropertyNames()
- Overrides:
stringPropertyNamesin classOverrideProperties
-
propertyNames
public Enumeration<?> propertyNames()
- Overrides:
propertyNamesin classProperties
-
keys
public Enumeration<Object> keys()
- Overrides:
keysin classOverrideProperties
-
superGetProperty
public String superGetProperty(String key)
Description copied from class:OverridePropertiesполучить property текущего уровня, без учета наследования- Overrides:
superGetPropertyin classOverrideProperties
-
getCurrentLvlProperty
public String getCurrentLvlProperty(String key)
- Overrides:
getCurrentLvlPropertyin classOverrideProperties
-
removeProperty
public void removeProperty(Object key)
-
isExists
public boolean isExists()
-
isExpired
public boolean isExpired()
-
load
public void load(Reader reader) throws IOException
- Overrides:
loadin classProperties- Throws:
IOException
-
load
public void load(InputStream inStream) throws IOException
- Overrides:
loadin classProperties- Throws:
IOException
-
loadFromXML
public void loadFromXML(InputStream in) throws IOException
- Overrides:
loadFromXMLin classProperties- Throws:
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)
-
-