@ -187,4 +187,5 @@ application context gets the <code class="literal">Environment</code>. To use th
@@ -187,4 +187,5 @@ application context gets the <code class="literal">Environment</code>. To use th
features in an application you need to include Spring Security RSA in
your classpath (Maven co-ordinates
"org.springframework.security:spring-security-rsa") and you also need
the full strength JCE extensions in your JVM.</p><p>If you are getting an exception due to "Illegal key size" and you are using Sun’s JDK, you need to install the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files. See the following links for more information:</p><divclass="itemizedlist"><ulclass="itemizedlist"style="list-style-type: disc; "><liclass="listitem"><aclass="link"href="http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html"target="_top">Java 6 JCE</a></li><liclass="listitem"><aclass="link"href="http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html"target="_top">Java 7 JCE</a></li><liclass="listitem"><aclass="link"href="http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html"target="_top">Java 8 JCE</a></li></ul></div><p>Extract files into JDK/jre/lib/security folder (whichever version of JRE/JDK x64/x86 you are using).</p></div><divclass="section"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aname="_endpoints"href="#_endpoints"></a>1.10 Endpoints</h2></div></div></div><p>For a Spring Boot Actuator application there are some additional management endpoints:</p><divclass="itemizedlist"><ulclass="itemizedlist"style="list-style-type: disc; "><liclass="listitem">POST to <codeclass="literal">/env</code> to update the <codeclass="literal">Environment</code> and rebind <codeclass="literal">@ConfigurationProperties</code> and log levels</li><liclass="listitem"><codeclass="literal">/refresh</code> for re-loading the boot strap context and refreshing the <codeclass="literal">@RefreshScope</code> beans</li><liclass="listitem"><codeclass="literal">/restart</code> for closing the <codeclass="literal">ApplicationContext</code> and restarting it (disabled by default)</li><liclass="listitem"><codeclass="literal">/pause</code> and <codeclass="literal">/resume</code> for calling the <codeclass="literal">Lifecycle</code> methods (<codeclass="literal">stop()</code> and <codeclass="literal">start()</code> on the <codeclass="literal">ApplicationContext</code>)</li></ul></div></div></div><divclass="navfooter"><hr><tablewidth="100%"summary="Navigation footer"><tr><tdwidth="40%"align="left"><aaccesskey="p"href="multi_pr01.html">Prev</a> </td><tdwidth="20%"align="center"> </td><tdwidth="40%"align="right"> <aaccesskey="n"href="multi__spring_cloud_commons_common_abstractions.html">Next</a></td></tr><tr><tdwidth="40%"align="left"valign="top"> </td><tdwidth="20%"align="center"><aaccesskey="h"href="multi_spring-cloud-commons.html">Home</a></td><tdwidth="40%"align="right"valign="top"> 2. Spring Cloud Commons: Common Abstractions</td></tr></table></div></body></html>
the full strength JCE extensions in your JVM.</p><p>If you are getting an exception due to "Illegal key size" and you are using Sun’s JDK, you need to install the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files. See the following links for more information:</p><divclass="itemizedlist"><ulclass="itemizedlist"style="list-style-type: disc; "><liclass="listitem"><aclass="link"href="http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html"target="_top">Java 6 JCE</a></li><liclass="listitem"><aclass="link"href="http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html"target="_top">Java 7 JCE</a></li><liclass="listitem"><aclass="link"href="http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html"target="_top">Java 8 JCE</a></li></ul></div><p>Extract files into JDK/jre/lib/security folder (whichever version of JRE/JDK x64/x86 you are using).</p></div><divclass="section"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aname="_endpoints"href="#_endpoints"></a>1.10 Endpoints</h2></div></div></div><p>For a Spring Boot Actuator application there are some additional management endpoints:</p><divclass="itemizedlist"><ulclass="itemizedlist"style="list-style-type: disc; "><liclass="listitem">POST to <codeclass="literal">/env</code> to update the <codeclass="literal">Environment</code> and rebind <codeclass="literal">@ConfigurationProperties</code> and log levels</li><liclass="listitem"><codeclass="literal">/refresh</code> for re-loading the boot strap context and refreshing the <codeclass="literal">@RefreshScope</code> beans</li><liclass="listitem"><codeclass="literal">/restart</code> for closing the <codeclass="literal">ApplicationContext</code> and restarting it (disabled by default)</li><liclass="listitem"><codeclass="literal">/pause</code> and <codeclass="literal">/resume</code> for calling the <codeclass="literal">Lifecycle</code> methods (<codeclass="literal">stop()</code> and <codeclass="literal">start()</code> on the <codeclass="literal">ApplicationContext</code>)</li></ul></div><divclass="note"style="margin-left: 0.5in; margin-right: 0.5in;"><tableborder="0"summary="Note"><tr><tdrowspan="2"align="center"valign="top"width="25"><imgalt="[Note]"src="images/note.png"></td><thalign="left">Note</th></tr><tr><tdalign="left"valign="top"><p>If you disable the <codeclass="literal">/restart</code> endpoint then the <codeclass="literal">/pause</code> and <codeclass="literal">/resume</code> endpoints
will also be disabled since they are just a special case of <codeclass="literal">/restart</code>.</p></td></tr></table></div></div></div><divclass="navfooter"><hr><tablewidth="100%"summary="Navigation footer"><tr><tdwidth="40%"align="left"><aaccesskey="p"href="multi_pr01.html">Prev</a> </td><tdwidth="20%"align="center"> </td><tdwidth="40%"align="right"> <aaccesskey="n"href="multi__spring_cloud_commons_common_abstractions.html">Next</a></td></tr><tr><tdwidth="40%"align="left"valign="top"> </td><tdwidth="20%"align="center"><aaccesskey="h"href="multi_spring-cloud-commons.html">Home</a></td><tdwidth="40%"align="right"valign="top"> 2. Spring Cloud Commons: Common Abstractions</td></tr></table></div></body></html>
@ -187,7 +187,8 @@ application context gets the <code class="literal">Environment</code>. To use th
@@ -187,7 +187,8 @@ application context gets the <code class="literal">Environment</code>. To use th
features in an application you need to include Spring Security RSA in
your classpath (Maven co-ordinates
"org.springframework.security:spring-security-rsa") and you also need
the full strength JCE extensions in your JVM.</p><p>If you are getting an exception due to "Illegal key size" and you are using Sun’s JDK, you need to install the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files. See the following links for more information:</p><divclass="itemizedlist"><ulclass="itemizedlist"style="list-style-type: disc; "><liclass="listitem"><aclass="link"href="http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html"target="_top">Java 6 JCE</a></li><liclass="listitem"><aclass="link"href="http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html"target="_top">Java 7 JCE</a></li><liclass="listitem"><aclass="link"href="http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html"target="_top">Java 8 JCE</a></li></ul></div><p>Extract files into JDK/jre/lib/security folder (whichever version of JRE/JDK x64/x86 you are using).</p></div><divclass="section"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aname="_endpoints"href="#_endpoints"></a>1.10 Endpoints</h2></div></div></div><p>For a Spring Boot Actuator application there are some additional management endpoints:</p><divclass="itemizedlist"><ulclass="itemizedlist"style="list-style-type: disc; "><liclass="listitem">POST to <codeclass="literal">/env</code> to update the <codeclass="literal">Environment</code> and rebind <codeclass="literal">@ConfigurationProperties</code> and log levels</li><liclass="listitem"><codeclass="literal">/refresh</code> for re-loading the boot strap context and refreshing the <codeclass="literal">@RefreshScope</code> beans</li><liclass="listitem"><codeclass="literal">/restart</code> for closing the <codeclass="literal">ApplicationContext</code> and restarting it (disabled by default)</li><liclass="listitem"><codeclass="literal">/pause</code> and <codeclass="literal">/resume</code> for calling the <codeclass="literal">Lifecycle</code> methods (<codeclass="literal">stop()</code> and <codeclass="literal">start()</code> on the <codeclass="literal">ApplicationContext</code>)</li></ul></div></div></div><divclass="chapter"><divclass="titlepage"><div><div><h1class="title"><aname="_spring_cloud_commons_common_abstractions"href="#_spring_cloud_commons_common_abstractions"></a>2. Spring Cloud Commons: Common Abstractions</h1></div></div></div><p>Patterns such as service discovery, load balancing and circuit breakers lend themselves to a common abstraction layer that can be consumed by all Spring Cloud clients, independent of the implementation (e.g. discovery via Eureka or Consul).</p><divclass="section"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aname="__enablediscoveryclient"href="#__enablediscoveryclient"></a>2.1 @EnableDiscoveryClient</h2></div></div></div><p>Commons provides the <codeclass="literal">@EnableDiscoveryClient</code> annotation. This looks for implementations of the <codeclass="literal">DiscoveryClient</code> interface via <codeclass="literal">META-INF/spring.factories</code>. Implementations of Discovery Client will add a configuration class to <codeclass="literal">spring.factories</code> under the <codeclass="literal">org.springframework.cloud.client.discovery.EnableDiscoveryClient</code> key. Examples of <codeclass="literal">DiscoveryClient</code> implementations: are <aclass="link"href="http://cloud.spring.io/spring-cloud-netflix/"target="_top">Spring Cloud Netflix Eureka</a>, <aclass="link"href="http://cloud.spring.io/spring-cloud-consul/"target="_top">Spring Cloud Consul Discovery</a> and <aclass="link"href="http://cloud.spring.io/spring-cloud-zookeeper/"target="_top">Spring Cloud Zookeeper Discovery</a>.</p><p>By default, implementations of <codeclass="literal">DiscoveryClient</code> will auto-register the local Spring Boot server with the remote discovery server. This can be disabled by setting <codeclass="literal">autoRegister=false</code> in <codeclass="literal">@EnableDiscoveryClient</code>.</p><divclass="note"style="margin-left: 0.5in; margin-right: 0.5in;"><tableborder="0"summary="Note"><tr><tdrowspan="2"align="center"valign="top"width="25"><imgalt="[Note]"src="images/note.png"></td><thalign="left">Note</th></tr><tr><tdalign="left"valign="top"><p>The use of <codeclass="literal">@EnableDiscoveryClient</code> is no longer required. It is enough to just have a <codeclass="literal">DiscoveryClient</code> implementation
the full strength JCE extensions in your JVM.</p><p>If you are getting an exception due to "Illegal key size" and you are using Sun’s JDK, you need to install the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files. See the following links for more information:</p><divclass="itemizedlist"><ulclass="itemizedlist"style="list-style-type: disc; "><liclass="listitem"><aclass="link"href="http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html"target="_top">Java 6 JCE</a></li><liclass="listitem"><aclass="link"href="http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html"target="_top">Java 7 JCE</a></li><liclass="listitem"><aclass="link"href="http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html"target="_top">Java 8 JCE</a></li></ul></div><p>Extract files into JDK/jre/lib/security folder (whichever version of JRE/JDK x64/x86 you are using).</p></div><divclass="section"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aname="_endpoints"href="#_endpoints"></a>1.10 Endpoints</h2></div></div></div><p>For a Spring Boot Actuator application there are some additional management endpoints:</p><divclass="itemizedlist"><ulclass="itemizedlist"style="list-style-type: disc; "><liclass="listitem">POST to <codeclass="literal">/env</code> to update the <codeclass="literal">Environment</code> and rebind <codeclass="literal">@ConfigurationProperties</code> and log levels</li><liclass="listitem"><codeclass="literal">/refresh</code> for re-loading the boot strap context and refreshing the <codeclass="literal">@RefreshScope</code> beans</li><liclass="listitem"><codeclass="literal">/restart</code> for closing the <codeclass="literal">ApplicationContext</code> and restarting it (disabled by default)</li><liclass="listitem"><codeclass="literal">/pause</code> and <codeclass="literal">/resume</code> for calling the <codeclass="literal">Lifecycle</code> methods (<codeclass="literal">stop()</code> and <codeclass="literal">start()</code> on the <codeclass="literal">ApplicationContext</code>)</li></ul></div><divclass="note"style="margin-left: 0.5in; margin-right: 0.5in;"><tableborder="0"summary="Note"><tr><tdrowspan="2"align="center"valign="top"width="25"><imgalt="[Note]"src="images/note.png"></td><thalign="left">Note</th></tr><tr><tdalign="left"valign="top"><p>If you disable the <codeclass="literal">/restart</code> endpoint then the <codeclass="literal">/pause</code> and <codeclass="literal">/resume</code> endpoints
will also be disabled since they are just a special case of <codeclass="literal">/restart</code>.</p></td></tr></table></div></div></div><divclass="chapter"><divclass="titlepage"><div><div><h1class="title"><aname="_spring_cloud_commons_common_abstractions"href="#_spring_cloud_commons_common_abstractions"></a>2. Spring Cloud Commons: Common Abstractions</h1></div></div></div><p>Patterns such as service discovery, load balancing and circuit breakers lend themselves to a common abstraction layer that can be consumed by all Spring Cloud clients, independent of the implementation (e.g. discovery via Eureka or Consul).</p><divclass="section"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aname="__enablediscoveryclient"href="#__enablediscoveryclient"></a>2.1 @EnableDiscoveryClient</h2></div></div></div><p>Commons provides the <codeclass="literal">@EnableDiscoveryClient</code> annotation. This looks for implementations of the <codeclass="literal">DiscoveryClient</code> interface via <codeclass="literal">META-INF/spring.factories</code>. Implementations of Discovery Client will add a configuration class to <codeclass="literal">spring.factories</code> under the <codeclass="literal">org.springframework.cloud.client.discovery.EnableDiscoveryClient</code> key. Examples of <codeclass="literal">DiscoveryClient</code> implementations: are <aclass="link"href="http://cloud.spring.io/spring-cloud-netflix/"target="_top">Spring Cloud Netflix Eureka</a>, <aclass="link"href="http://cloud.spring.io/spring-cloud-consul/"target="_top">Spring Cloud Consul Discovery</a> and <aclass="link"href="http://cloud.spring.io/spring-cloud-zookeeper/"target="_top">Spring Cloud Zookeeper Discovery</a>.</p><p>By default, implementations of <codeclass="literal">DiscoveryClient</code> will auto-register the local Spring Boot server with the remote discovery server. This can be disabled by setting <codeclass="literal">autoRegister=false</code> in <codeclass="literal">@EnableDiscoveryClient</code>.</p><divclass="note"style="margin-left: 0.5in; margin-right: 0.5in;"><tableborder="0"summary="Note"><tr><tdrowspan="2"align="center"valign="top"width="25"><imgalt="[Note]"src="images/note.png"></td><thalign="left">Note</th></tr><tr><tdalign="left"valign="top"><p>The use of <codeclass="literal">@EnableDiscoveryClient</code> is no longer required. It is enough to just have a <codeclass="literal">DiscoveryClient</code> implementation
on the classpath to cause the Spring Boot application to register with the service discovery server.</p></td></tr></table></div><divclass="section"><divclass="titlepage"><div><div><h3class="title"><aname="_health_indicator"href="#_health_indicator"></a>2.1.1 Health Indicator</h3></div></div></div><p>Commons creates a Spring Boot <codeclass="literal">HealthIndicator</code> that <codeclass="literal">DiscoveryClient</code> implementations can participate in by implementing <codeclass="literal">DiscoveryHealthIndicator</code>. To disable the composite <codeclass="literal">HealthIndicator</code> set <codeclass="literal">spring.cloud.discovery.client.composite-indicator.enabled=false</code>. A generic <codeclass="literal">HealthIndicator</code> based on <codeclass="literal">DiscoveryClient</code> is auto-configured (<codeclass="literal">DiscoveryClientHealthIndicator). To disable it, set `spring.cloud.discovery.client.health-indicator.enabled=false</code>. To disable the description field of the <codeclass="literal">DiscoveryClientHealthIndicator</code> set <codeclass="literal">spring.cloud.discovery.client.health-indicator.include-description=false</code>, otherwise it can bubble up as the <codeclass="literal">description</code> of the rolled up <codeclass="literal">HealthIndicator</code>.</p></div></div><divclass="section"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aname="_serviceregistry"href="#_serviceregistry"></a>2.2 ServiceRegistry</h2></div></div></div><p>Commons now provides a <codeclass="literal">ServiceRegistry</code> interface which provides methods like <codeclass="literal">register(Registration)</code> and <codeclass="literal">deregister(Registration)</code> which allow you to provide custom registered services. <codeclass="literal">Registration</code> is a marker interface.</p><preclass="programlisting"><em><spanclass="hl-annotation"style="color: gray">@Configuration</span></em>
@ -326,6 +326,10 @@ the full strength JCE extensions in your JVM.</simpara>
@@ -326,6 +326,10 @@ the full strength JCE extensions in your JVM.</simpara>
<simpara><literal>/pause</literal> and <literal>/resume</literal> for calling the <literal>Lifecycle</literal> methods (<literal>stop()</literal> and <literal>start()</literal> on the <literal>ApplicationContext</literal>)</simpara>
</listitem>
</itemizedlist>
<note>
<simpara>If you disable the <literal>/restart</literal> endpoint then the <literal>/pause</literal> and <literal>/resume</literal> endpoints
will also be disabled since they are just a special case of <literal>/restart</literal>.</simpara>