@ -74,7 +74,9 @@ Then, the next time something borrows a connection from the pool, it gets one wi
@@ -74,7 +74,9 @@ Then, the next time something borrows a connection from the pool, it gets one wi
annotation on some beans which can be only initialized once. If a bean
is "immutable", you will have to either annotate the bean with <codeclass="literal">@RefreshScope</code>
or specify the classname under the property key
<codeclass="literal">spring.cloud.refresh.extra-refreshable</code>.</p><p>Refresh scope beans are lazy proxies that initialize when they are used (that is, when a method is called), and the scope acts as a cache of initialized values.
<codeclass="literal">spring.cloud.refresh.extra-refreshable</code>.</p><divclass="important"style="margin-left: 0.5in; margin-right: 0.5in;"><tableborder="0"summary="Important"><tr><tdrowspan="2"align="center"valign="top"width="25"><imgalt="[Important]"src="images/important.png"></td><thalign="left">Important</th></tr><tr><tdalign="left"valign="top"><p>If you create a <codeclass="literal">DataSource</code> bean yourself and the implementation is a <codeclass="literal">HikariDataSource</code>, return the
most specific type, in this case <codeclass="literal">HikariDataSource</code>. Otherwise, you will need to set
<codeclass="literal">spring.cloud.refresh.extra-refreshable=javax.sql.DataSource</code>.</p></td></tr></table></div><p>Refresh scope beans are lazy proxies that initialize when they are used (that is, when a method is called), and the scope acts as a cache of initialized values.
To force a bean to re-initialize on the next method call, you must invalidate its cache entry.</p><p>The <codeclass="literal">RefreshScope</code> is a bean in the context and has a public <codeclass="literal">refreshAll()</code> method to refresh all beans in the scope by clearing the target cache.
The <codeclass="literal">/refresh</code> endpoint exposes this functionality (over HTTP or JMX).
To refresh an individual bean by name, there is also a <codeclass="literal">refresh(String)</code> method.</p><p>To expose the <codeclass="literal">/refresh</code> endpoint, you need to add following configuration to your application:</p><preclass="programlisting"><spanxmlns:d="http://docbook.org/ns/docbook"class="hl-attribute">management</span>:
@ -80,7 +80,9 @@ Then, the next time something borrows a connection from the pool, it gets one wi
@@ -80,7 +80,9 @@ Then, the next time something borrows a connection from the pool, it gets one wi
annotation on some beans which can be only initialized once. If a bean
is "immutable", you will have to either annotate the bean with <codeclass="literal">@RefreshScope</code>
or specify the classname under the property key
<codeclass="literal">spring.cloud.refresh.extra-refreshable</code>.</p><p>Refresh scope beans are lazy proxies that initialize when they are used (that is, when a method is called), and the scope acts as a cache of initialized values.
<codeclass="literal">spring.cloud.refresh.extra-refreshable</code>.</p><divclass="important"style="margin-left: 0.5in; margin-right: 0.5in;"><tableborder="0"summary="Important"><tr><tdrowspan="2"align="center"valign="top"width="25"><imgalt="[Important]"src="images/important.png"></td><thalign="left">Important</th></tr><tr><tdalign="left"valign="top"><p>If you create a <codeclass="literal">DataSource</code> bean yourself and the implementation is a <codeclass="literal">HikariDataSource</code>, return the
most specific type, in this case <codeclass="literal">HikariDataSource</code>. Otherwise, you will need to set
<codeclass="literal">spring.cloud.refresh.extra-refreshable=javax.sql.DataSource</code>.</p></td></tr></table></div><p>Refresh scope beans are lazy proxies that initialize when they are used (that is, when a method is called), and the scope acts as a cache of initialized values.
To force a bean to re-initialize on the next method call, you must invalidate its cache entry.</p><p>The <codeclass="literal">RefreshScope</code> is a bean in the context and has a public <codeclass="literal">refreshAll()</code> method to refresh all beans in the scope by clearing the target cache.
The <codeclass="literal">/refresh</code> endpoint exposes this functionality (over HTTP or JMX).
To refresh an individual bean by name, there is also a <codeclass="literal">refresh(String)</code> method.</p><p>To expose the <codeclass="literal">/refresh</code> endpoint, you need to add following configuration to your application:</p><preclass="programlisting"><spanxmlns:d="http://docbook.org/ns/docbook"class="hl-attribute">management</span>:
@ -194,6 +194,11 @@ annotation on some beans which can be only initialized once. If a bean
@@ -194,6 +194,11 @@ annotation on some beans which can be only initialized once. If a bean
is "immutable", you will have to either annotate the bean with <literal>@RefreshScope</literal>
<simpara>Refresh scope beans are lazy proxies that initialize when they are used (that is, when a method is called), and the scope acts as a cache of initialized values.
To force a bean to re-initialize on the next method call, you must invalidate its cache entry.</simpara>
<simpara>The <literal>RefreshScope</literal> is a bean in the context and has a public <literal>refreshAll()</literal> method to refresh all beans in the scope by clearing the target cache.