title: how can I reload/refresh properties in spring at runtime without jvm restart?
body: <p>how can I reload/refresh properties in spring at runtime without jvm restart?</p>
  
  <p>I am looking for something elegant and it should be applicable in Prod. Therefore, JRebel is off the table I guess.</p>
  
  <p>Currently, I have my properties in MYProject.properties</p>
  
  <pre><code>oms.url=abbc.com
  checkin.enabled=true
  </code></pre>
  
  <p>and my java file is autowired to search and use these properties from applicationContext provided different property files:</p>
  
  <pre><code>&lt;bean id="applicationProperties" class="myproject.config.CustomPropertyPlaceHolder"&gt;
          &lt;property name="ignoreResourceNotFound" value="true" /&gt;
          &lt;property name="locations"&gt;
              &lt;list&gt;
                  &lt;value&gt;classpath:MyProject.properties&lt;/value&gt;
                  &lt;value&gt;file:${CATALINA_BASE}/lib/MyProject.properties&lt;/value&gt;
                  &lt;!--&lt;value&gt;file:///appl/conf/outlet.properties&lt;/value&gt;--&gt;
                  &lt;value&gt;classpath:db.password&lt;/value&gt;
                  &lt;value&gt;file:${CATALINA_BASE}/lib/db.password&lt;/value&gt;
                  &lt;!-- &lt;ref bean="applPropertiesFromDb" /&gt; --&gt;
              &lt;/list&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>and Java file as:</p>
  
  <pre><code>@Value("${checkin.enabled}")
      private String checkinEnabled;
  </code></pre>