From 90d7e5df7a94e55edea99e679f0fcf409449dec4 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Thu, 15 Jan 2015 13:52:37 +0000 Subject: [PATCH] Correct Javadocs in *FeignClient Fixes gh-151 --- .../cloud/netflix/feign/FeignClient.java | 11 +++++-- .../cloud/netflix/feign/FeignClientScan.java | 29 +++++++++++-------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/feign/FeignClient.java b/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/feign/FeignClient.java index 4e4c4568..b0c9bceb 100644 --- a/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/feign/FeignClient.java +++ b/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/feign/FeignClient.java @@ -3,6 +3,8 @@ package org.springframework.cloud.netflix.feign; import java.lang.annotation.*; /** + * Annotation for interfaces declaring that a REST client with that interface should be + * created (e.g. for autowiring into another component). * @author Spencer Gibb */ @Target(ElementType.TYPE) @@ -10,9 +12,14 @@ import java.lang.annotation.*; @Documented public @interface FeignClient { /** - * @return serviceId if loadbalance is true, url otherwise - * No need to prefix serviceId with http:// + * @return serviceId if loadbalance is true, url otherwise There is no need to prefix + * serviceId with http://. */ String value(); + + /** + * @return true if calls should be load balanced (assuming a load balancer is + * available). + */ boolean loadbalance() default true; } diff --git a/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/feign/FeignClientScan.java b/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/feign/FeignClientScan.java index 862ab9d0..5db1536e 100644 --- a/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/feign/FeignClientScan.java +++ b/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/feign/FeignClientScan.java @@ -9,11 +9,13 @@ import java.lang.annotation.Target; import org.springframework.context.annotation.Import; /** - * Configures component scanning directives for use with @{@link org.springframework.context.annotation.Configuration} classes. - * Scan Spring Integration specific components. + * Scans for interfaces that declare they are feign clients (via {@link FeignClient + * @FeignClient}). Configures component scanning directives for use with + * {@link org.springframework.context.annotation.Configuration + * @Configuration} classes. * * @author Artem Bilan - * @since 4.0 + * @since 1.0 */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) @@ -22,9 +24,8 @@ import org.springframework.context.annotation.Import; public @interface FeignClientScan { /** - * Alias for the {@link #basePackages()} attribute. - * Allows for more concise annotation declarations e.g.: - * {@code @ComponentScan("org.my.pkg")} instead of + * Alias for the {@link #basePackages()} attribute. Allows for more concise annotation + * declarations e.g.: {@code @ComponentScan("org.my.pkg")} instead of * {@code @ComponentScan(basePackages="org.my.pkg")}. * * @return the array of 'basePackages'. @@ -33,18 +34,22 @@ public @interface FeignClientScan { /** * Base packages to scan for annotated components. - *

{@link #value()} is an alias for (and mutually exclusive with) this attribute. - *

Use {@link #basePackageClasses()} for a type-safe alternative to String-based package names. + *

+ * {@link #value()} is an alias for (and mutually exclusive with) this attribute. + *

+ * Use {@link #basePackageClasses()} for a type-safe alternative to String-based + * package names. * * @return the array of 'basePackages'. */ String[] basePackages() default {}; /** - * Type-safe alternative to {@link #basePackages()} for specifying the packages - * to scan for annotated components. The package of each class specified will be scanned. - *

Consider creating a special no-op marker class or interface in each package - * that serves no purpose other than being referenced by this attribute. + * Type-safe alternative to {@link #basePackages()} for specifying the packages to + * scan for annotated components. The package of each class specified will be scanned. + *

+ * Consider creating a special no-op marker class or interface in each package that + * serves no purpose other than being referenced by this attribute. * * @return the array of 'basePackageClasses'. */