From fb85510432f48d1aa57225e3adf871bf067cd141 Mon Sep 17 00:00:00 2001 From: Ramnivas Laddad Date: Fri, 25 Jul 2014 09:55:18 -0700 Subject: [PATCH] Explain the use of ServiceInfo.ServiceLabel (fix #52) --- .../src/main/java/org/springframework/cloud/Cloud.java | 8 +++++--- .../org/springframework/cloud/service/ServiceInfo.java | 6 ++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/spring-cloud-core/src/main/java/org/springframework/cloud/Cloud.java b/spring-cloud-core/src/main/java/org/springframework/cloud/Cloud.java index 2d5804d..26cbe6b 100644 --- a/spring-cloud-core/src/main/java/org/springframework/cloud/Cloud.java +++ b/spring-cloud-core/src/main/java/org/springframework/cloud/Cloud.java @@ -201,9 +201,11 @@ public class Cloud { * * *

- * If a there is only a single service of a given type, that service is aliased to the service type. Keys for such properties - * start in cloud.services.<service-type>. For example, if there is only a single MySQL service bound to the - * application, the service properties will also be exposed starting with 'cloud.services.mysql' key:

+     * If a there is only a single service of a given type (as defined by the {@link ServiceInfo.ServiceLabel} 
+     * annoation's value of the corresponding {@link ServiceInfo} class), that service is aliased 
+     * to the service type. Keys for such properties start in cloud.services.<service-type>. 
+     * For example, if there is only a single MySQL service bound to the application, the service properties 
+     * will also be exposed starting with 'cloud.services.mysql' key: 
      * cloud.services.mysql.type = mysql-5.1
      * cloud.services.mysql.plan = free
      * cloud.services.mysql.connection.hostname = ...
diff --git a/spring-cloud-core/src/main/java/org/springframework/cloud/service/ServiceInfo.java b/spring-cloud-core/src/main/java/org/springframework/cloud/service/ServiceInfo.java
index c3f64c1..baebd47 100644
--- a/spring-cloud-core/src/main/java/org/springframework/cloud/service/ServiceInfo.java
+++ b/spring-cloud-core/src/main/java/org/springframework/cloud/service/ServiceInfo.java
@@ -19,6 +19,12 @@ public interface ServiceInfo {
 	
 	/**
 	 * Annotation to mark service label (used in presenting properties) 
+	 * 
+	 * 

+ * If a {@link ServiceInfo} class carries this annotation, it is used categorize + * similar services together for the purpose of exposing cloud properties. + *

+ * * @see Cloud#getCloudProperties() */ @Inherited