Class 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 every cacheTime seconds User: operhod Date: 10.10.13 Time: 17:05
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class java.util.Properties

        defaults
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object get​(java.lang.Object key)  
      int getCacheTime()  
      java.lang.String getCurrentLvlProperty​(java.lang.String key)  
      org.springframework.core.io.Resource getResource()  
      boolean isExists()  
      boolean isExpired()  
      java.util.Enumeration<java.lang.Object> keys()  
      void load​(java.io.InputStream inStream)  
      void load​(java.io.Reader reader)  
      void loadFromXML​(java.io.InputStream in)  
      java.util.Enumeration<?> propertyNames()  
      java.lang.Object put​(java.lang.Object key, java.lang.Object value)  
      java.lang.Object remove​(java.lang.Object key)  
      void removeProperty​(java.lang.Object key)  
      void setCacheTime​(int cacheTime)  
      void setResource​(org.springframework.core.io.Resource resource)  
      java.util.Set<java.lang.String> stringPropertyNames()  
      java.lang.String superGetProperty​(java.lang.String key)
      получить property текущего уровня, без учета наследования
      void updateProperty​(java.lang.Object key, java.lang.Object value)  
      • 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
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • 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

      • propertyNames

        public java.util.Enumeration<?> propertyNames()
        Overrides:
        propertyNames in class java.util.Properties
      • superGetProperty

        public java.lang.String superGetProperty​(java.lang.String key)
        Description copied from class: OverrideProperties
        получить property текущего уровня, без учета наследования
        Overrides:
        superGetProperty in class OverrideProperties
      • get

        public java.lang.Object get​(java.lang.Object key)
        Specified by:
        get in interface java.util.Map<java.lang.Object,​java.lang.Object>
        Overrides:
        get in class OverrideProperties
      • put

        public java.lang.Object put​(java.lang.Object key,
                                    java.lang.Object value)
        Specified by:
        put in interface java.util.Map<java.lang.Object,​java.lang.Object>
        Overrides:
        put in class java.util.Properties
      • remove

        public java.lang.Object remove​(java.lang.Object key)
        Specified by:
        remove in interface java.util.Map<java.lang.Object,​java.lang.Object>
        Overrides:
        remove in class java.util.Properties
      • 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:
        load in class java.util.Properties
        Throws:
        java.io.IOException
      • load

        public void load​(java.io.InputStream inStream)
                  throws java.io.IOException
        Overrides:
        load in class java.util.Properties
        Throws:
        java.io.IOException
      • loadFromXML

        public void loadFromXML​(java.io.InputStream in)
                         throws java.io.IOException
        Overrides:
        loadFromXML in class java.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)