From 7790859fd4433457312635a90f3d11d34bdf58ef Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Fri, 19 Dec 2014 13:01:55 +0000 Subject: [PATCH] Sync docs from master to gh-pages --- spring-cloud.html | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/spring-cloud.html b/spring-cloud.html index caf3294..e34e2b5 100644 --- a/spring-cloud.html +++ b/spring-cloud.html @@ -797,10 +797,11 @@ Git, but just loads the config files from the local classpath (or anywhere else you want to point to with "spring.cloud.config.server.locations"). To use the native profile just launch the Config Server with "spring.profiles.active=native". In -the native profile the repository only has the "current" set of -configuration files, so the "label" specification in the HTTP -resources is ignored (i.e. it’s like always pulling from "master" in -the Git implementation).

+the native profile the repository the "label" specification in the +HTTP resources is added to the search path, so properties files are +loaded from each search location and a subdirectory with the same +name as the label (the labelled properties take precedence in the +Spring Environment).

@@ -1981,12 +1982,8 @@ for details on the properties available.

@ComponentScan @EnableAutoConfiguration @EnableEurekaClient -public class Application extends FeignConfiguration { - @Bean - public StoreClient storeClient() { - //loadBalance plugs Feign into ribbon. feign() works without load balancing. - return loadBalance(StoreClient.class, "http://stores"); - } +@FeignClientScan +public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); @@ -1998,7 +1995,8 @@ public class Application extends FeignConfiguration {
StoreClient.java
-
public interface StoreClient {
+
@FeignClient("stores")
+public interface StoreClient {
     @RequestMapping(method = RequestMethod.GET, value = "/stores")
     List<Store> getStores();
 
@@ -2417,6 +2415,21 @@ default the scope is empty and it is up to to Authorization Server to
 decide what the defaults should be, usually depending on the settings in
 the client registration that it holds.

+
+ + + + + +
+
Note
+
+The examples above are all Groovy scripts. If you want to write the +same code in Java (or Groovy) you need to add Spring Security OAuth2 +to the classpath (e.g. see the +sample here). +
+

OAuth2 Protected Resource

@@ -2432,7 +2445,7 @@ simple example (paired with the client above):

@EnableOAuth2Resource class Application { - @RequestMapping('/' + @RequestMapping('/') def home() { [message: 'Hello World'] } @@ -2748,8 +2761,8 @@ $ cf restart app login server instead of challenging for Basic authentication. The clientId and clientSecret are credentials of a registered client in Cloud Foundry. To get a Cloud Foundry client registration for -testing please ask at support@run.pivotal.io (if you want it on PWS), -or your local platform administrator (if it’s a private instance).

+testing please ask your local platform administrator if it’s a private +instance).

@@ -2846,7 +2859,7 @@ service or the "resource" service if you have one).