From 55c7833e4cc80b6eeaaaf4c1c1da8308f9ada27f Mon Sep 17 00:00:00 2001
From: Ben Klein
Date: Mon, 6 Aug 2018 12:02:41 -0500
Subject: [PATCH] Minor Javadoc cleanup (#401)
Nothing major found--mostly just polish.
---
.../cloud/client/DefaultServiceInstance.java | 4 +-
.../cloud/client/ServiceInstance.java | 16 ++++----
.../EnableCircuitBreakerImportSelector.java | 2 +-
.../client/discovery/DiscoveryClient.java | 16 ++++----
.../composite/CompositeDiscoveryClient.java | 4 +-
...ositeDiscoveryClientAutoConfiguration.java | 2 +-
.../discovery/event/HeartbeatEvent.java | 18 ++++-----
.../discovery/event/HeartbeatMonitor.java | 8 ++--
.../event/InstanceRegisteredEvent.java | 6 +--
.../discovery/event/ParentHeartbeatEvent.java | 4 +-
.../DiscoveryCompositeHealthIndicator.java | 4 +-
.../health/DiscoveryHealthIndicator.java | 4 +-
.../discovery/noop/NoopDiscoveryClient.java | 4 +-
.../NoopDiscoveryClientAutoConfiguration.java | 2 +-
.../simple/SimpleDiscoveryClient.java | 2 +-
...impleDiscoveryClientAutoConfiguration.java | 2 +-
.../simple/SimpleDiscoveryProperties.java | 8 ++--
.../CloudHypermediaAutoConfiguration.java | 4 +-
.../client/hypermedia/DiscoveredResource.java | 6 +--
.../DynamicServiceInstanceProvider.java | 2 +-
.../client/hypermedia/RemoteResource.java | 10 ++---
.../hypermedia/RemoteResourceRefresher.java | 2 +-
.../hypermedia/ServiceInstanceProvider.java | 8 ++--
.../hypermedia/TraversalDefinition.java | 2 +-
.../AsyncLoadBalancerAutoConfiguration.java | 2 +-
...ClientHttpResponseStatusCodeException.java | 10 ++---
.../loadbalancer/InterceptorRetryPolicy.java | 8 ++--
.../client/loadbalancer/LoadBalanced.java | 2 +-
.../LoadBalancedRecoveryCallback.java | 12 +++---
.../LoadBalancedRetryContext.java | 20 +++++-----
.../LoadBalancedRetryFactory.java | 16 ++++----
.../loadbalancer/LoadBalancedRetryPolicy.java | 27 ++++++-------
.../LoadBalancerAutoConfiguration.java | 2 +-
.../loadbalancer/LoadBalancerClient.java | 40 +++++++++----------
.../LoadBalancerRequestTransformer.java | 6 +--
.../LoadBalancerRetryProperties.java | 6 +--
.../loadbalancer/ServiceInstanceChooser.java | 6 +--
.../AbstractAutoServiceRegistration.java | 28 ++++++-------
.../AutoServiceRegistrationProperties.java | 6 +--
.../serviceregistry/ServiceRegistry.java | 20 +++++-----
.../endpoint/ServiceRegistryEndpoint.java | 2 +-
...cheHttpClientConnectionManagerFactory.java | 14 +++----
.../httpclient/ApacheHttpClientFactory.java | 2 +-
.../DefaultApacheHttpClientFactory.java | 3 +-
.../OkHttpClientConnectionPoolFactory.java | 10 ++---
.../cloud/commons/util/InetUtils.java | 4 +-
.../commons/util/InetUtilsProperties.java | 11 ++---
.../util/SpringFactoryImportSelector.java | 2 +-
...LifecycleMvcEndpointAutoConfiguration.java | 4 +-
.../bootstrap/BootstrapConfiguration.java | 2 +-
.../PropertySourceBootstrapProperties.java | 2 +-
.../config/PropertySourceLocator.java | 6 +--
...ironmentDecryptApplicationInitializer.java | 4 +-
.../bootstrap/encrypt/KeyProperties.java | 8 ++--
.../bootstrap/encrypt/RsaProperties.java | 14 +++----
.../environment/EnvironmentChangeEvent.java | 2 +-
.../environment/EnvironmentManager.java | 2 +-
...itableEnvironmentEndpointWebExtension.java | 2 +-
.../ConfigurationPropertiesBeans.java | 2 +-
.../ConfigurationPropertiesRebinder.java | 6 +--
.../context/refresh/ContextRefresher.java | 2 +-
.../context/restart/RestartListener.java | 2 +-
.../cloud/context/scope/GenericScope.java | 24 +++++------
.../cloud/context/scope/ScopeCache.java | 24 +++++------
.../context/scope/refresh/RefreshScope.java | 20 +++++-----
.../context/scope/thread/ThreadScope.java | 2 +-
.../cloud/endpoint/event/RefreshEvent.java | 2 +-
.../endpoint/event/RefreshEventListener.java | 2 +-
.../health/RefreshScopeHealthIndicator.java | 2 +-
69 files changed, 267 insertions(+), 266 deletions(-)
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/DefaultServiceInstance.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/DefaultServiceInstance.java
index d7e710c2..d9498482 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/DefaultServiceInstance.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/DefaultServiceInstance.java
@@ -64,9 +64,9 @@ public class DefaultServiceInstance implements ServiceInstance {
}
/**
- * Create a uri from the given ServiceInstance's host:port
+ * Creates a URI from the given ServiceInstance's host:port.
* @param instance
- * @return URI of the form (secure)?https:http + "host:port"
+ * @return URI of the form (secure)?https:http + "host:port".
*/
public static URI getUri(ServiceInstance instance) {
String scheme = (instance.isSecure()) ? "https" : "http";
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/ServiceInstance.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/ServiceInstance.java
index 9fe58c48..d380bc02 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/ServiceInstance.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/ServiceInstance.java
@@ -20,43 +20,43 @@ import java.net.URI;
import java.util.Map;
/**
- * Represents an instance of a Service in a Discovery System
+ * Represents an instance of a service in a discovery system.
* @author Spencer Gibb
*/
public interface ServiceInstance {
/**
- * @return the service id as registered.
+ * @return The service ID as registered.
*/
String getServiceId();
/**
- * @return the hostname of the registered ServiceInstance
+ * @return The hostname of the registered service instance.
*/
String getHost();
/**
- * @return the port of the registered ServiceInstance
+ * @return The port of the registered service instance.
*/
int getPort();
/**
- * @return if the port of the registered ServiceInstance is https or not
+ * @return Whether the port of the registered service instance uses HTTPS.
*/
boolean isSecure();
/**
- * @return the service uri address
+ * @return The service URI address.
*/
URI getUri();
/**
- * @return the key value pair metadata associated with the service instance
+ * @return The key / value pair metadata associated with the service instance.
*/
Map getMetadata();
/**
- * @return the scheme of the instance
+ * @return The scheme of the service instance.
*/
default String getScheme() {
return null;
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/circuitbreaker/EnableCircuitBreakerImportSelector.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/circuitbreaker/EnableCircuitBreakerImportSelector.java
index e56b592b..934ffb74 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/circuitbreaker/EnableCircuitBreakerImportSelector.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/circuitbreaker/EnableCircuitBreakerImportSelector.java
@@ -21,7 +21,7 @@ import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
/**
- * Import a single circuit breaker implementation Configuration
+ * Imports a single circuit breaker implementation configuration.
* @author Spencer Gibb
*/
@Order(Ordered.LOWEST_PRECEDENCE - 100)
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/DiscoveryClient.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/DiscoveryClient.java
index a6d0f93c..dcee8e6a 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/DiscoveryClient.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/DiscoveryClient.java
@@ -21,27 +21,27 @@ import java.util.List;
import org.springframework.cloud.client.ServiceInstance;
/**
- * DiscoveryClient represents read operations commonly available to Discovery service such as
- * Netflix Eureka or consul.io
+ * Represents read operations commonly available to discovery services such as Netflix
+ * Eureka or consul.io.
* @author Spencer Gibb
*/
public interface DiscoveryClient {
/**
- * A human readable description of the implementation, used in HealthIndicator
- * @return the description
+ * A human-readable description of the implementation, used in HealthIndicator.
+ * @return The description.
*/
String description();
/**
- * Get all ServiceInstances associated with a particular serviceId
- * @param serviceId the serviceId to query
- * @return a List of ServiceInstance
+ * Gets all ServiceInstances associated with a particular serviceId.
+ * @param serviceId The serviceId to query.
+ * @return A List of ServiceInstance.
*/
List getInstances(String serviceId);
/**
- * @return all known service ids
+ * @return All known service IDs.
*/
List getServices();
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/composite/CompositeDiscoveryClient.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/composite/CompositeDiscoveryClient.java
index 21a328de..4c011f0e 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/composite/CompositeDiscoveryClient.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/composite/CompositeDiscoveryClient.java
@@ -9,8 +9,8 @@ import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.DiscoveryClient;
/**
- * A {@link DiscoveryClient} composed of other Discovery Client's and will delegate the
- * calls to each of them in order
+ * A {@link DiscoveryClient} that is composed of other discovery clients and delegates
+ * calls to each of them in order.
*
* @author Biju Kunjummen
*/
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/composite/CompositeDiscoveryClientAutoConfiguration.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/composite/CompositeDiscoveryClientAutoConfiguration.java
index b71d28da..cefc0337 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/composite/CompositeDiscoveryClientAutoConfiguration.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/composite/CompositeDiscoveryClientAutoConfiguration.java
@@ -10,7 +10,7 @@ import org.springframework.context.annotation.Primary;
import java.util.List;
/**
- * Auto-configuration for Composite Discovery Client.
+ * Auto-configuration for composite discovery client.
*
* @author Biju Kunjummen
*/
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/event/HeartbeatEvent.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/event/HeartbeatEvent.java
index 040c4646..e0e6eac0 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/event/HeartbeatEvent.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/event/HeartbeatEvent.java
@@ -19,9 +19,9 @@ package org.springframework.cloud.client.discovery.event;
import org.springframework.context.ApplicationEvent;
/**
- * Event DiscoveryClient implementation can broadcast if they support heartbeat's from the
- * discovery server. Provides listeners with a basic indication of a state change in the
- * service catalog.
+ * An event that a DiscoveryClient implementation can broadcast if it supports
+ * heartbeats from the discovery server. Provides listeners with a basic indication
+ * of a state change in the service catalog.
*
* @author Spencer Gibb
* @author Dave Syer
@@ -32,11 +32,11 @@ public class HeartbeatEvent extends ApplicationEvent {
private final Object state;
/**
- * Create a new event with a source (for example a discovery client) and a value.
+ * Creates a new event with a source (for example, a discovery client) and a value.
* Neither parameter should be relied on to have specific content or format.
*
- * @param source the source of the event
- * @param state the value indicating state of the catalog
+ * @param source The source of the event.
+ * @param state The value indicating state of the catalog.
*/
public HeartbeatEvent(Object source, Object state) {
super(source);
@@ -45,12 +45,12 @@ public class HeartbeatEvent extends ApplicationEvent {
/**
* A value representing the state of the service catalog. The only requirement is that
- * it changes when the catalog is updated, so it can be as simple as a version
- * conuter, or a hash. Implementations can provide information to help users visualize
+ * it changes when the catalog is updated; it can be as simple as a version counter or
+ * a hash. Implementations can provide information to help users visualize
* what is going on in the catalog, but users should not rely on the content (since
* the implementation of the underlying discovery might change).
*
- * @return A value representing state of the service catalog
+ * @return A value representing state of the service catalog.
*/
public Object getValue() {
return this.state;
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/event/HeartbeatMonitor.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/event/HeartbeatMonitor.java
index 15d0709b..cfcd0629 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/event/HeartbeatMonitor.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/event/HeartbeatMonitor.java
@@ -19,8 +19,8 @@ package org.springframework.cloud.client.discovery.event;
import java.util.concurrent.atomic.AtomicReference;
/**
- * Helper class for listeners to the {@link HeartbeatEvent} providing a convenient way to
- * determine if there has been a change in state.
+ * Helper class for listeners to the {@link HeartbeatEvent}, providing a convenient way
+ * to determine if there has been a change in state.
*
* @author Dave Syer
*/
@@ -29,8 +29,8 @@ public class HeartbeatMonitor {
private AtomicReference latestHeartbeat = new AtomicReference<>();
/**
- * @param value the latest heartbeat
- * @return true if the state changed
+ * @param value The latest heartbeat.
+ * @return True if the state changed.
*/
public boolean update(Object value) {
Object last = this.latestHeartbeat.get();
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/event/InstanceRegisteredEvent.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/event/InstanceRegisteredEvent.java
index c9ad8d1f..6be79d95 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/event/InstanceRegisteredEvent.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/event/InstanceRegisteredEvent.java
@@ -30,9 +30,9 @@ public class InstanceRegisteredEvent extends ApplicationEvent {
private T config;
/**
- * Create a new {@link InstanceRegisteredEvent} instance.
- * @param source the component that published the event (never {@code null})
- * @param config the configuration of the instance
+ * Creates a new {@link InstanceRegisteredEvent} instance.
+ * @param source The component that published the event (never {@code null}).
+ * @param config The configuration of the instance.
*/
public InstanceRegisteredEvent(Object source, T config) {
super(source);
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/event/ParentHeartbeatEvent.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/event/ParentHeartbeatEvent.java
index 5633e1e0..49a2cd0d 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/event/ParentHeartbeatEvent.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/event/ParentHeartbeatEvent.java
@@ -19,8 +19,8 @@ package org.springframework.cloud.client.discovery.event;
import org.springframework.context.ApplicationEvent;
/**
- * Heartbeat Event that a Parent ApplicationContext can send to a child Context. Useful,
- * for example, when config server is located via DiscoveryClient, in which case the
+ * Heartbeat event that a parent ApplicationContext can send to a child context. Useful,
+ * for example, when a config server is located via a DiscoveryClient, in which case the
* {@link HeartbeatEvent} that triggers this event is fired in the parent (bootstrap)
* context.
*
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/health/DiscoveryCompositeHealthIndicator.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/health/DiscoveryCompositeHealthIndicator.java
index fab693b3..1626786e 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/health/DiscoveryCompositeHealthIndicator.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/health/DiscoveryCompositeHealthIndicator.java
@@ -26,8 +26,8 @@ import org.springframework.boot.actuate.health.HealthAggregator;
import org.springframework.boot.actuate.health.HealthIndicator;
/**
- * Gathers all DiscoveryHealthIndicator's from a DiscoveryClient implementation
- * and aggregates the statuses.
+ * Gathers all instances of DiscoveryHealthIndicator from a DiscoveryClient
+ * implementation and aggregates the statuses.
* @author Spencer Gibb
*/
//TODO: do we need this? Can they just be independent HealthIndicators?
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/health/DiscoveryHealthIndicator.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/health/DiscoveryHealthIndicator.java
index 43fca7d2..cbf4287d 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/health/DiscoveryHealthIndicator.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/health/DiscoveryHealthIndicator.java
@@ -19,7 +19,7 @@ package org.springframework.cloud.client.discovery.health;
import org.springframework.boot.actuate.health.Health;
/**
- * A health indicator interface specific for a DiscoveryClient implementation
+ * A health indicator interface specific to a DiscoveryClient implementation.
* @author Spencer Gibb
*/
public interface DiscoveryHealthIndicator {
@@ -27,7 +27,7 @@ public interface DiscoveryHealthIndicator {
String getName();
/**
- * @return an indication of health
+ * @return An indication of health.
*/
Health health();
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/noop/NoopDiscoveryClient.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/noop/NoopDiscoveryClient.java
index d3a115cf..46170bce 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/noop/NoopDiscoveryClient.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/noop/NoopDiscoveryClient.java
@@ -23,9 +23,9 @@ import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.DiscoveryClient;
/**
- * DiscoveryClient used when no implementations are found on the classpath
+ * DiscoveryClient used when no implementations are found on the classpath.
*
- * @deprecated Use {@link org.springframework.cloud.client.discovery.simple.SimpleDiscoveryClient instead}
+ * @deprecated Use {@link org.springframework.cloud.client.discovery.simple.SimpleDiscoveryClient instead}.
*
* @author Dave Syer
*/
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/noop/NoopDiscoveryClientAutoConfiguration.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/noop/NoopDiscoveryClientAutoConfiguration.java
index 9548485d..60dd0ff4 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/noop/NoopDiscoveryClientAutoConfiguration.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/noop/NoopDiscoveryClientAutoConfiguration.java
@@ -41,7 +41,7 @@ import org.springframework.core.env.Environment;
/**
*
* @deprecated Use
- * {@link org.springframework.cloud.client.discovery.simple.SimpleDiscoveryClientAutoConfiguration instead}
+ * {@link org.springframework.cloud.client.discovery.simple.SimpleDiscoveryClientAutoConfiguration instead}.
*
* @author Dave Syer
*/
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/simple/SimpleDiscoveryClient.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/simple/SimpleDiscoveryClient.java
index f9b3d4fb..17e94433 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/simple/SimpleDiscoveryClient.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/simple/SimpleDiscoveryClient.java
@@ -9,7 +9,7 @@ import org.springframework.cloud.client.discovery.simple.SimpleDiscoveryProperti
/**
* A {@link org.springframework.cloud.client.discovery.DiscoveryClient} that will use the
- * properties file as a source of service instances
+ * properties file as a source of service instances.
*
* @author Biju Kunjummen
*/
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/simple/SimpleDiscoveryClientAutoConfiguration.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/simple/SimpleDiscoveryClientAutoConfiguration.java
index 71a4d5c0..c7214636 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/simple/SimpleDiscoveryClientAutoConfiguration.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/simple/SimpleDiscoveryClientAutoConfiguration.java
@@ -19,7 +19,7 @@ import org.springframework.util.ClassUtils;
import java.net.URI;
/**
- * Spring Boot Auto-Configuration for Simple Properties based Discovery Client
+ * Spring Boot auto-configuration for simple properties-based discovery client.
*
* @author Biju Kunjummen
*/
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/simple/SimpleDiscoveryProperties.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/simple/SimpleDiscoveryProperties.java
index e9273b52..0c7f9e87 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/simple/SimpleDiscoveryProperties.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/simple/SimpleDiscoveryProperties.java
@@ -14,7 +14,7 @@ import org.springframework.cloud.client.ServiceInstance;
/**
* Properties to hold the details of a
* {@link org.springframework.cloud.client.discovery.DiscoveryClient} service instances
- * for a given service
+ * for a given service.
*
* @author Biju Kunjummen
*/
@@ -54,8 +54,8 @@ public class SimpleDiscoveryProperties {
public static class SimpleServiceInstance implements ServiceInstance {
/**
- * The URI of the service instance. Will be parsed to extract the scheme, hos and
- * port.
+ * The URI of the service instance. Will be parsed to extract the scheme, host,
+ * and port.
*/
private URI uri;
private String host;
@@ -68,7 +68,7 @@ public class SimpleDiscoveryProperties {
private Map metadata = new LinkedHashMap<>();
/**
* The identifier or name for the service. Multiple instances might share the same
- * service id.
+ * service ID.
*/
private String serviceId;
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/CloudHypermediaAutoConfiguration.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/CloudHypermediaAutoConfiguration.java
index 8f31161e..de3887dc 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/CloudHypermediaAutoConfiguration.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/CloudHypermediaAutoConfiguration.java
@@ -29,8 +29,8 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
- * Registers a default {@link RemoteResourceRefresher} if at least one {@link RemoteResource} is declared in the system
- * and applies verification timings defined in the application properties.
+ * Registers a default {@link RemoteResourceRefresher} if at least one {@link RemoteResource} is declared in the system.
+ * Applies verification timings defined in the application properties.
*
* @author Oliver Gierke
*/
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/DiscoveredResource.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/DiscoveredResource.java
index cae5a18e..a0a024c9 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/DiscoveredResource.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/DiscoveredResource.java
@@ -53,7 +53,7 @@ public class DiscoveredResource implements RemoteResource {
/**
* Configures the {@link RestOperations} to use to execute the traversal and verifying HEAD calls.
*
- * @param restOperations can be {@literal null}, resorting to a default {@link RestTemplate} in that case.
+ * @param restOperations Can be {@literal null}; resorts to a default {@link RestTemplate} in that case.
*/
public void setRestOperations(RestOperations restOperations) {
this.restOperations = restOperations == null ? new RestTemplate() : restOperations;
@@ -81,7 +81,7 @@ public class DiscoveredResource implements RemoteResource {
}
/**
- * Verifies the link to the current
+ * Verifies the link to the current.
*/
public void verifyOrDiscover() {
this.link = link == null ? discoverLink() : verify(link);
@@ -90,7 +90,7 @@ public class DiscoveredResource implements RemoteResource {
/**
* Verifies the given {@link Link} by issuing an HTTP HEAD request to the resource.
*
- * @param link must not be {@literal null}.
+ * @param link Must not be {@literal null}.
* @return
*/
private Link verify(Link link) {
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/DynamicServiceInstanceProvider.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/DynamicServiceInstanceProvider.java
index fa32769c..ab25f970 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/DynamicServiceInstanceProvider.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/DynamicServiceInstanceProvider.java
@@ -21,7 +21,7 @@ import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.DiscoveryClient;
/**
- * {@link ServiceInstanceProvider} to work with a {@link DiscoveryClient} to lookup a service by name. Will pick the
+ * {@link ServiceInstanceProvider} to work with a {@link DiscoveryClient} to look up a service by name. Picks the
* first one returned by the configured {@link DiscoveryClient}.
*
* @author Oliver Gierke
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/RemoteResource.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/RemoteResource.java
index 5338e9a4..c3e81ef2 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/RemoteResource.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/RemoteResource.java
@@ -25,15 +25,15 @@ import org.springframework.hateoas.Link;
public interface RemoteResource {
/**
- * Returns the {@link Link} to the resource in case it is available or {@literal null}
- * in case it's gone, i.e. either generally unavailable or can't be discovered.
+ * Returns the {@link Link} to the resource if it is available, or {@literal null}
+ * if it is gone (i.e. it either is generally unavailable or can't be discovered).
*/
Link getLink();
/**
- * Discovers the the resource in case it hasn't been yet or became unavailable. In
- * case a link has been discovered previously, it is verified and either confirmed or
- * the link is removed to indicate it's not available anymore.
+ * Discovers the resource if it hasn't been discovered yet or has become
+ * unavailable. If a link has been discovered previously, it is verified and either
+ * confirmed or removed to indicate that it's not available anymore.
*/
void verifyOrDiscover();
}
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/RemoteResourceRefresher.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/RemoteResourceRefresher.java
index f167d57a..09ca1acf 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/RemoteResourceRefresher.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/RemoteResourceRefresher.java
@@ -22,7 +22,7 @@ import org.springframework.scheduling.config.IntervalTask;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
/**
- * A {@link ScheduledTaskRegistrar} that verifies all {@link DiscoveredResource} instances in the system based
+ * A {@link ScheduledTaskRegistrar} that verifies all {@link DiscoveredResource} instances in the system, based
* on the given timing configuration.
*
* @author Oliver Gierke
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/ServiceInstanceProvider.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/ServiceInstanceProvider.java
index f7547baf..7eb59a00 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/ServiceInstanceProvider.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/ServiceInstanceProvider.java
@@ -18,17 +18,17 @@ package org.springframework.cloud.client.hypermedia;
import org.springframework.cloud.client.ServiceInstance;
/**
- * A component that will provide a {@link ServiceInstance} or can express the absence of one by returning
- * {@literal null}.
+ * A component that will provide a {@link ServiceInstance}, or can express the absence of one by
+ * returning {@literal null}.
*
* @author Oliver Gierke
*/
public interface ServiceInstanceProvider {
/**
- * Returns the service instance or {@literal null} in case the service is currently unavailable.
+ * Returns the service instance or {@literal null} if the service is currently unavailable.
*
- * @return the service instance or {@literal null} in case the service is currently unavailable.
+ * @return The service instance, or {@literal null} if the service is currently unavailable.
*/
ServiceInstance getServiceInstance();
}
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/TraversalDefinition.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/TraversalDefinition.java
index f4ef4809..a4e68505 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/TraversalDefinition.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/hypermedia/TraversalDefinition.java
@@ -26,7 +26,7 @@ import org.springframework.hateoas.client.Traverson.TraversalBuilder;
public interface TraversalDefinition {
/**
- * @param traverson the Traverson instance to run the traversal on.
+ * @param traverson The Traverson instance to run the traversal on.
*/
TraversalBuilder buildTraversal(Traverson traverson);
}
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/AsyncLoadBalancerAutoConfiguration.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/AsyncLoadBalancerAutoConfiguration.java
index c6c2e1dd..ce0cf751 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/AsyncLoadBalancerAutoConfiguration.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/AsyncLoadBalancerAutoConfiguration.java
@@ -30,7 +30,7 @@ import org.springframework.http.client.AsyncClientHttpRequestInterceptor;
import org.springframework.web.client.AsyncRestTemplate;
/**
- * Auto configuration for Ribbon (client side load balancing).
+ * Auto-configuration for Ribbon (client-side load balancing).
*
* @author Rob Worsnop
*/
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/ClientHttpResponseStatusCodeException.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/ClientHttpResponseStatusCodeException.java
index eaf74882..93ff5435 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/ClientHttpResponseStatusCodeException.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/ClientHttpResponseStatusCodeException.java
@@ -23,7 +23,7 @@ import org.springframework.http.client.AbstractClientHttpResponse;
import org.springframework.http.client.ClientHttpResponse;
/**
- * {@link RetryableStatusCodeException} that captures a {@link ClientHttpResponse}
+ * {@link RetryableStatusCodeException} that captures a {@link ClientHttpResponse}.
* @author Ryan Baxter
*/
public class ClientHttpResponseStatusCodeException extends RetryableStatusCodeException {
@@ -31,10 +31,10 @@ public class ClientHttpResponseStatusCodeException extends RetryableStatusCodeEx
private ClientHttpResponseWrapper response;
/**
- * Constructor
- * @param serviceId The service id
- * @param response The response object
- * @throws IOException Thrown if the {@link ClientHttpResponse} response code cant be retrieved
+ * Constructor.
+ * @param serviceId The service ID.
+ * @param response The response object.
+ * @throws IOException Thrown if the {@link ClientHttpResponse} response code cannot be retrieved.
*/
public ClientHttpResponseStatusCodeException(String serviceId, ClientHttpResponse response, byte[] body) throws IOException {
super(serviceId, response.getRawStatusCode(), response, null);
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/InterceptorRetryPolicy.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/InterceptorRetryPolicy.java
index cd316bef..94e0e3fb 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/InterceptorRetryPolicy.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/InterceptorRetryPolicy.java
@@ -32,10 +32,10 @@ public class InterceptorRetryPolicy implements RetryPolicy {
/**
* Creates a new retry policy.
- * @param request the request that will be retried
- * @param policy the retry policy from the load balancer
- * @param serviceInstanceChooser the load balancer client
- * @param serviceName the name of the service
+ * @param request The request that will be retried.
+ * @param policy The retry policy from the load balancer.
+ * @param serviceInstanceChooser The load balancer client.
+ * @param serviceName The name of the service.
*/
public InterceptorRetryPolicy(HttpRequest request, LoadBalancedRetryPolicy policy,
ServiceInstanceChooser serviceInstanceChooser, String serviceName) {
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalanced.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalanced.java
index eaa28727..2d24c0e0 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalanced.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalanced.java
@@ -26,7 +26,7 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * Annotation to mark a RestTemplate bean to be configured to use a LoadBalancerClient
+ * Annotation to mark a RestTemplate bean to be configured to use a LoadBalancerClient.
* @author Spencer Gibb
*/
@Target({ ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD })
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancedRecoveryCallback.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancedRecoveryCallback.java
index a42a7dde..1427c657 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancedRecoveryCallback.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancedRecoveryCallback.java
@@ -22,18 +22,18 @@ import org.springframework.retry.RetryException;
import java.net.URI;
/**
- * An implementation of {@link RecoveryCallback} which relies on an implemtation
+ * An implementation of {@link RecoveryCallback} which relies on an implementation
* of {@link RetryableStatusCodeException} to contain the last response object from
- * the request
+ * the request.
* @author LiYuan Lee
*/
public abstract class LoadBalancedRecoveryCallback implements RecoveryCallback {
/**
- * Create the response returned in the {@link RecoveryCallback}
- * @param response The response from the HTTP client
- * @param uri The URI the response is from
- * @return The response to be returned
+ * Creates the response returned in the {@link RecoveryCallback}.
+ * @param response The response from the HTTP client.
+ * @param uri The URI the response is from.
+ * @return The response to be returned.
*/
protected abstract T createResponse(R response, URI uri);
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancedRetryContext.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancedRetryContext.java
index c0caebc7..0ff06aa5 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancedRetryContext.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancedRetryContext.java
@@ -21,7 +21,7 @@ import org.springframework.retry.RetryContext;
import org.springframework.retry.context.RetryContextSupport;
/**
- * {@link RetryContext} for load balanced retries.
+ * {@link RetryContext} for load-balanced retries.
* @author Ryan Baxter
*/
public class LoadBalancedRetryContext extends RetryContextSupport {
@@ -30,9 +30,9 @@ public class LoadBalancedRetryContext extends RetryContextSupport {
private ServiceInstance serviceInstance;
/**
- * Creates a new load balanced context.
- * @param parent the parent context
- * @param request the request that is being load balanced
+ * Creates a new load-balanced context.
+ * @param parent The parent context.
+ * @param request The request that is being load-balanced.
*/
public LoadBalancedRetryContext(RetryContext parent, HttpRequest request) {
super(parent);
@@ -40,16 +40,16 @@ public class LoadBalancedRetryContext extends RetryContextSupport {
}
/**
- * Gets the request that is being load balanced.
- * @return the request that is being load balanced
+ * Gets the request that is being load-balanced.
+ * @return The request that is being load-balanced.
*/
public HttpRequest getRequest() {
return request;
}
/**
- * Sets the request that is being load baalnced.
- * @param request the request to load balanced
+ * Sets the request that is being load-balanced.
+ * @param request The request to be load balanced.
*/
public void setRequest(HttpRequest request) {
this.request = request;
@@ -57,7 +57,7 @@ public class LoadBalancedRetryContext extends RetryContextSupport {
/**
* Gets the service instance used during the retry.
- * @return the service instance used during the retry
+ * @return The service instance used during the retry.
*/
public ServiceInstance getServiceInstance() {
return serviceInstance;
@@ -65,7 +65,7 @@ public class LoadBalancedRetryContext extends RetryContextSupport {
/**
* Sets the service instance to use during the retry.
- * @param serviceInstance the service instance to use during the retry
+ * @param serviceInstance The service instance to use during the retry.
*/
public void setServiceInstance(ServiceInstance serviceInstance) {
this.serviceInstance = serviceInstance;
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancedRetryFactory.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancedRetryFactory.java
index a5da2b3c..87c86a04 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancedRetryFactory.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancedRetryFactory.java
@@ -20,7 +20,7 @@ import org.springframework.retry.backoff.BackOffPolicy;
import org.springframework.retry.backoff.NoBackOffPolicy;
/**
- * Factory class used to customize the retry functionality throughout Spring Cloud
+ * Factory class used to customize the retry functionality throughout Spring Cloud.
* @author Ryan Baxter
*/
public interface LoadBalancedRetryFactory {
@@ -28,7 +28,7 @@ public interface LoadBalancedRetryFactory {
/**
* Creates a {@link LoadBalancedRetryPolicy}.
* @param service The ID of the service to create the retry policy for.
- * @param serviceInstanceChooser Used to get the next server from a load balancer
+ * @param serviceInstanceChooser Used to get the next server from a load balancer.
* @return A retry policy for the service.
*/
default LoadBalancedRetryPolicy createRetryPolicy(String service, ServiceInstanceChooser serviceInstanceChooser) {
@@ -36,18 +36,18 @@ public interface LoadBalancedRetryFactory {
}
/**
- * Creates an array of {@link RetryListener}s for a given service
- * @param service The service to create the {@link RetryListener}s for
- * @return An array of {@link RetryListener}s
+ * Creates an array of {@link RetryListener}s for a given service.
+ * @param service The service to create the {@link RetryListener}s for.
+ * @return An array of {@link RetryListener}s.
*/
default RetryListener[] createRetryListeners(String service) {
return new RetryListener[0];
}
/**
- * Creates a {@link BackOffPolicy} for a given service
- * @param service The service to create the {@link BackOffPolicy} for
- * @return The {@link BackOffPolicy}
+ * Creates a {@link BackOffPolicy} for a given service.
+ * @param service The service to create the {@link BackOffPolicy} for.
+ * @return The {@link BackOffPolicy}.
*/
default BackOffPolicy createBackOffPolicy(String service) {
return new NoBackOffPolicy();
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancedRetryPolicy.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancedRetryPolicy.java
index 903f3e05..7ec7726f 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancedRetryPolicy.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancedRetryPolicy.java
@@ -24,41 +24,40 @@ public interface LoadBalancedRetryPolicy {
/**
* Return true to retry the failed request on the same server.
* This method may be called more than once when executing a single operation.
- * @param context the context for the retry operation
- * @return true to retry the failed request on the same server, false otherwise
+ * @param context The context for the retry operation.
+ * @return True to retry the failed request on the same server; false otherwise.
*/
public boolean canRetrySameServer(LoadBalancedRetryContext context);
/**
* Return true to retry the failed request on the next server from the load balancer.
* This method may be called more than once when executing a single operation.
- * @param context the context for the retry operation
- * @return true to retry the failed request on the next server from the load balancer, false otherwise
+ * @param context The context for the retry operation.
+ * @return True to retry the failed request on the next server from the load balancer; false otherwise.
*/
public boolean canRetryNextServer(LoadBalancedRetryContext context);
/**
* Called when the retry operation has ended.
- * @param context the context for the retry operation
+ * @param context The context for the retry operation.
*/
public abstract void close(LoadBalancedRetryContext context);
/**
* Called when the execution fails.
- * @param context the context for the retry operation
- * @param throwable the throwable from the failed execution.
+ * @param context The context for the retry operation.
+ * @param throwable The throwable from the failed execution.
*/
public abstract void registerThrowable(LoadBalancedRetryContext context, Throwable throwable);
/**
- * If an exception is not thrown when making a request, than this method will be
- * called to see if the client would like to retry the request based on the status
- * code returned. For example in CloudFoundry the router will return a 404
- * when an app is not available. Since HTTP clients do not throw an exception when
- * a 404 is returned than retryableStatusCode allows
- * clients to force a retry.
+ * If an exception is not thrown when making a request, this method will be called to see if the
+ * client would like to retry the request based on the status code returned. For example, in
+ * Cloud Foundry, the router will return a 404 when an app is not available. Since
+ * HTTP clients do not throw an exception when a 404 is returned,
+ * retryableStatusCode allows clients to force a retry.
* @param statusCode The HTTP status code.
- * @return True if a retry should be attempted, false to just return the response
+ * @return True if a retry should be attempted; false to just return the response.
*/
public boolean retryableStatusCode(int statusCode);
}
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerAutoConfiguration.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerAutoConfiguration.java
index 7bbd0c53..e74a6df1 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerAutoConfiguration.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerAutoConfiguration.java
@@ -36,7 +36,7 @@ import java.util.Collections;
import java.util.List;
/**
- * Auto configuration for Ribbon (client side load balancing).
+ * Auto-configuration for Ribbon (client-side load balancing).
*
* @author Spencer Gibb
* @author Dave Syer
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerClient.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerClient.java
index 2b060fc4..5b2913bd 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerClient.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerClient.java
@@ -22,42 +22,42 @@ import java.io.IOException;
import java.net.URI;
/**
- * Represents a client side load balancer
+ * Represents a client-side load balancer.
* @author Spencer Gibb
*/
public interface LoadBalancerClient extends ServiceInstanceChooser {
/**
- * execute request using a ServiceInstance from the LoadBalancer for the specified
- * service
- * @param serviceId the service id to look up the LoadBalancer
- * @param request allows implementations to execute pre and post actions such as
- * incrementing metrics
- * @return the result of the LoadBalancerRequest callback on the selected
- * ServiceInstance
+ * Executes request using a ServiceInstance from the LoadBalancer for the specified
+ * service.
+ * @param serviceId The service ID to look up the LoadBalancer.
+ * @param request Allows implementations to execute pre and post actions, such as
+ * incrementing metrics.
+ * @return The result of the LoadBalancerRequest callback on the selected
+ * ServiceInstance.
*/
T execute(String serviceId, LoadBalancerRequest request) throws IOException;
/**
- * execute request using a ServiceInstance from the LoadBalancer for the specified
- * service
- * @param serviceId the service id to look up the LoadBalancer
- * @param serviceInstance the service to execute the request to
- * @param request allows implementations to execute pre and post actions such as
- * incrementing metrics
- * @return the result of the LoadBalancerRequest callback on the selected
- * ServiceInstance
+ * Executes request using a ServiceInstance from the LoadBalancer for the specified
+ * service.
+ * @param serviceId The service ID to look up the LoadBalancer.
+ * @param serviceInstance The service to execute the request to.
+ * @param request Allows implementations to execute pre and post actions, such as
+ * incrementing metrics.
+ * @return The result of the LoadBalancerRequest callback on the selected
+ * ServiceInstance.
*/
T execute(String serviceId, ServiceInstance serviceInstance, LoadBalancerRequest request) throws IOException;
/**
- * Create a proper URI with a real host and port for systems to utilize.
- * Some systems use a URI with the logical serivce name as the host,
+ * Creates a proper URI with a real host and port for systems to utilize.
+ * Some systems use a URI with the logical service name as the host,
* such as http://myservice/path/to/service. This will replace the
* service name with the host:port from the ServiceInstance.
* @param instance
- * @param original a URI with the host as a logical service name
- * @return a reconstructed URI
+ * @param original A URI with the host as a logical service name.
+ * @return A reconstructed URI.
*/
URI reconstructURI(ServiceInstance instance, URI original);
}
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerRequestTransformer.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerRequestTransformer.java
index bf25e419..27daf160 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerRequestTransformer.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerRequestTransformer.java
@@ -20,8 +20,8 @@ import org.springframework.core.annotation.Order;
import org.springframework.http.HttpRequest;
/**
- * Allows applications to transform the load balanced {@link HttpRequest} given
- * the chosen {@link ServiceInstance}
+ * Allows applications to transform the load-balanced {@link HttpRequest} given
+ * the chosen {@link ServiceInstance}.
*
* @author Will Tran
*/
@@ -30,4 +30,4 @@ public interface LoadBalancerRequestTransformer {
public static final int DEFAULT_ORDER = 0;
HttpRequest transformRequest(HttpRequest request, ServiceInstance instance);
-}
\ No newline at end of file
+}
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerRetryProperties.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerRetryProperties.java
index b750d895..9ee82b5d 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerRetryProperties.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerRetryProperties.java
@@ -27,15 +27,15 @@ public class LoadBalancerRetryProperties {
/**
* Returns true if the load balancer should retry failed requests.
- * @return true if the load balancer should retry failed request, false otherwise.
+ * @return True if the load balancer should retry failed requests; false otherwise.
*/
public boolean isEnabled() {
return enabled;
}
/**
- * Sets whether the load balancer should retry failed request.
- * @param enabled whether the load balancer should retry failed requests
+ * Sets whether the load balancer should retry failed requests.
+ * @param enabled Whether the load balancer should retry failed requests.
*/
public void setEnabled(boolean enabled) {
this.enabled = enabled;
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/ServiceInstanceChooser.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/ServiceInstanceChooser.java
index 4740c8fb..13710cda 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/ServiceInstanceChooser.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/ServiceInstanceChooser.java
@@ -27,9 +27,9 @@ import org.springframework.cloud.client.ServiceInstance;
public interface ServiceInstanceChooser {
/**
- * Choose a ServiceInstance from the LoadBalancer for the specified service
- * @param serviceId the service id to look up the LoadBalancer
- * @return a ServiceInstance that matches the serviceId
+ * Chooses a ServiceInstance from the LoadBalancer for the specified service.
+ * @param serviceId The service ID to look up the LoadBalancer.
+ * @return A ServiceInstance that matches the serviceId.
*/
ServiceInstance choose(String serviceId);
}
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/AbstractAutoServiceRegistration.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/AbstractAutoServiceRegistration.java
index afa67d2d..8fe416e9 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/AbstractAutoServiceRegistration.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/AbstractAutoServiceRegistration.java
@@ -20,9 +20,9 @@ import java.util.concurrent.atomic.AtomicInteger;
* Lifecycle methods that may be useful and common to {@link ServiceRegistry}
* implementations.
*
- * TODO: document the lifecycle
+ * TODO: Document the lifecycle.
*
- * @param registration type passed to the {@link ServiceRegistry}.
+ * @param Registration type passed to the {@link ServiceRegistry}.
*
* @author Spencer Gibb
*/
@@ -117,8 +117,8 @@ public abstract class AbstractAutoServiceRegistration
}
/**
- * @return if the management service should be registered with the
- * {@link ServiceRegistry}
+ * @return Whether the management service should be registered with the
+ * {@link ServiceRegistry}.
*/
protected boolean shouldRegisterManagement() {
if (this.properties == null || this.properties.isRegisterManagement()) {
@@ -129,18 +129,18 @@ public abstract class AbstractAutoServiceRegistration
}
/**
- * @return the object used to configure the registration
+ * @return The object used to configure the registration.
*/
@Deprecated
protected abstract Object getConfiguration();
/**
- * @return true, if this is enabled
+ * @return True, if this is enabled.
*/
protected abstract boolean isEnabled();
/**
- * @return the serviceId of the Management Service
+ * @return The serviceId of the Management Service.
*/
@Deprecated
protected String getManagementServiceId() {
@@ -149,7 +149,7 @@ public abstract class AbstractAutoServiceRegistration
}
/**
- * @return the service name of the Management Service
+ * @return The service name of the Management Service.
*/
@Deprecated
protected String getManagementServiceName() {
@@ -158,7 +158,7 @@ public abstract class AbstractAutoServiceRegistration
}
/**
- * @return the management server port
+ * @return The management server port.
*/
@Deprecated
protected Integer getManagementPort() {
@@ -166,7 +166,7 @@ public abstract class AbstractAutoServiceRegistration
}
/**
- * @return the app name, currently the spring.application.name property
+ * @return The app name (currently the spring.application.name property).
*/
@Deprecated
protected String getAppName() {
@@ -203,14 +203,14 @@ public abstract class AbstractAutoServiceRegistration
protected abstract R getManagementRegistration();
/**
- * Register the local service with the {@link ServiceRegistry}
+ * Register the local service with the {@link ServiceRegistry}.
*/
protected void register() {
this.serviceRegistry.register(getRegistration());
}
/**
- * Register the local management service with the {@link ServiceRegistry}
+ * Register the local management service with the {@link ServiceRegistry}.
*/
protected void registerManagement() {
R registration = getManagementRegistration();
@@ -220,14 +220,14 @@ public abstract class AbstractAutoServiceRegistration
}
/**
- * De-register the local service with the {@link ServiceRegistry}
+ * De-register the local service with the {@link ServiceRegistry}.
*/
protected void deregister() {
this.serviceRegistry.deregister(getRegistration());
}
/**
- * De-register the local management service with the {@link ServiceRegistry}
+ * De-register the local management service with the {@link ServiceRegistry}.
*/
protected void deregisterManagement() {
R registration = getManagementRegistration();
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/AutoServiceRegistrationProperties.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/AutoServiceRegistrationProperties.java
index b22b82b1..695e8cc4 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/AutoServiceRegistrationProperties.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/AutoServiceRegistrationProperties.java
@@ -8,13 +8,13 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties("spring.cloud.service-registry.auto-registration")
public class AutoServiceRegistrationProperties {
- /** If Auto-Service Registration is enabled, default to true. */
+ /** Whether service auto-registration is enabled. Defaults to true. */
private boolean enabled = true;
- /** Whether to register the management as a service, defaults to true */
+ /** Whether to register the management as a service. Defaults to true. */
private boolean registerManagement = true;
- /** Should startup fail if there is no AutoServiceRegistration, default to false. */
+ /** Whether startup fails if there is no AutoServiceRegistration. Defaults to false. */
private boolean failFast = false;
public boolean isEnabled() {
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/ServiceRegistry.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/ServiceRegistry.java
index bcd695e8..3641d1ae 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/ServiceRegistry.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/ServiceRegistry.java
@@ -9,20 +9,20 @@ package org.springframework.cloud.client.serviceregistry;
public interface ServiceRegistry {
/**
- * Register the registration. Registrations typically have information about
- * instances such as: hostname and port.
- * @param registration the registraion
+ * Registers the registration. A registration typically has information about
+ * an instance, such as its hostname and port.
+ * @param registration The registration.
*/
void register(R registration);
/**
- * Deregister the registration.
+ * Deregisters the registration.
* @param registration
*/
void deregister(R registration);
/**
- * Close the ServiceRegistry. This a lifecycle method.
+ * Closes the ServiceRegistry. This is a lifecycle method.
*/
void close();
@@ -31,8 +31,8 @@ public interface ServiceRegistry {
* by the individual implementations.
*
* @see org.springframework.cloud.client.serviceregistry.endpoint.ServiceRegistryEndpoint
- * @param registration the registration to update
- * @param status the status to set
+ * @param registration The registration to update.
+ * @param status The status to set.
*/
void setStatus(R registration, String status);
@@ -40,9 +40,9 @@ public interface ServiceRegistry {
* Gets the status of a particular registration.
*
* @see org.springframework.cloud.client.serviceregistry.endpoint.ServiceRegistryEndpoint
- * @param registration the registration to query
- * @param the type of the status
- * @return the status of the registration
+ * @param registration The registration to query.
+ * @param The type of the status.
+ * @return The status of the registration.
*/
T getStatus(R registration);
}
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/endpoint/ServiceRegistryEndpoint.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/endpoint/ServiceRegistryEndpoint.java
index e280c83b..07f48502 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/endpoint/ServiceRegistryEndpoint.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/endpoint/ServiceRegistryEndpoint.java
@@ -27,7 +27,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.util.Assert;
/**
- * Endpoint to display and set the service instance status using the service registry.
+ * Endpoint to display and set the service instance status using the ServiceRegistry.
*
* @author Spencer Gibb
*/
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/httpclient/ApacheHttpClientConnectionManagerFactory.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/httpclient/ApacheHttpClientConnectionManagerFactory.java
index 5c97d8e6..803e3ed8 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/httpclient/ApacheHttpClientConnectionManagerFactory.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/httpclient/ApacheHttpClientConnectionManagerFactory.java
@@ -33,13 +33,13 @@ public interface ApacheHttpClientConnectionManagerFactory {
/**
* Creates a new {@link HttpClientConnectionManager}.
- * @param disableSslValidation True to disable SSL validation, false otherwise
- * @param maxTotalConnections The total number of connections
- * @param maxConnectionsPerRoute The total number of connections per route
- * @param timeToLive The time a connection is allowed to exist
- * @param timeUnit The time unit for the time to live value
- * @param registryBuilder The {@link RegistryBuilder} to use in the connection manager
- * @return A new {@link HttpClientConnectionManager}
+ * @param disableSslValidation If true, SSL validation will be disabled.
+ * @param maxTotalConnections The total number of connections.
+ * @param maxConnectionsPerRoute The total number of connections per route.
+ * @param timeToLive The time a connection is allowed to exist.
+ * @param timeUnit The time unit for the time-to-live value.
+ * @param registryBuilder The {@link RegistryBuilder} to use in the connection manager.
+ * @return A new {@link HttpClientConnectionManager}.
*/
public HttpClientConnectionManager newConnectionManager(boolean disableSslValidation,
int maxTotalConnections, int maxConnectionsPerRoute, long timeToLive,
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/httpclient/ApacheHttpClientFactory.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/httpclient/ApacheHttpClientFactory.java
index 5d9dc4b2..e2bb3e4f 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/httpclient/ApacheHttpClientFactory.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/httpclient/ApacheHttpClientFactory.java
@@ -29,7 +29,7 @@ public interface ApacheHttpClientFactory {
/**
* Creates an {@link HttpClientBuilder} that can be used to create a new {@link CloseableHttpClient}.
- * @return A {@link HttpClientBuilder}
+ * @return A {@link HttpClientBuilder}.
*/
public HttpClientBuilder createBuilder();
}
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/httpclient/DefaultApacheHttpClientFactory.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/httpclient/DefaultApacheHttpClientFactory.java
index 1b54aa04..a42a711d 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/httpclient/DefaultApacheHttpClientFactory.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/httpclient/DefaultApacheHttpClientFactory.java
@@ -16,7 +16,8 @@ public class DefaultApacheHttpClientFactory implements ApacheHttpClientFactory {
/**
* A default {@link HttpClientBuilder}. The {@link HttpClientBuilder} returned will
- * have content compression disabled, cookie management disabled, and use system properties.
+ * have content compression disabled, have cookie management disabled, and use system
+ * properties.
*/
@Override
public HttpClientBuilder createBuilder() {
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/httpclient/OkHttpClientConnectionPoolFactory.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/httpclient/OkHttpClientConnectionPoolFactory.java
index d7682cc1..922e7c1d 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/httpclient/OkHttpClientConnectionPoolFactory.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/httpclient/OkHttpClientConnectionPoolFactory.java
@@ -5,17 +5,17 @@ import okhttp3.ConnectionPool;
import java.util.concurrent.TimeUnit;
/**
- * Creates {@link ConnectionPool}s for {@link okhttp3.OkHttpClient}s
+ * Creates {@link ConnectionPool}s for {@link okhttp3.OkHttpClient}s.
* @author Ryan Baxter
*/
public interface OkHttpClientConnectionPoolFactory {
/**
* Creates a new {@link ConnectionPool}.
- * @param maxIdleConnections number of max idle connections to allow
- * @param keepAliveDuration amount of time to keep connections alive
- * @param timeUnit the time unit for the keep alive duration
- * @return A new {@link ConnectionPool}
+ * @param maxIdleConnections Number of max idle connections to allow.
+ * @param keepAliveDuration Amount of time to keep connections alive.
+ * @param timeUnit The time unit for the keep-alive duration.
+ * @return A new {@link ConnectionPool}.
*/
public ConnectionPool create(int maxIdleConnections, long keepAliveDuration, TimeUnit timeUnit);
}
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/util/InetUtils.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/util/InetUtils.java
index c9c1d15b..f35f450d 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/util/InetUtils.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/util/InetUtils.java
@@ -125,7 +125,7 @@ public class InetUtils implements Closeable {
return null;
}
- /** for testing */ boolean isPreferredAddress(InetAddress address) {
+ /** For testing. */ boolean isPreferredAddress(InetAddress address) {
if (this.properties.isUseOnlySiteLocalInterfaces()) {
final boolean siteLocalAddress = address.isSiteLocalAddress();
@@ -148,7 +148,7 @@ public class InetUtils implements Closeable {
return false;
}
- /** for testing */ boolean ignoreInterface(String interfaceName) {
+ /** For testing. */ boolean ignoreInterface(String interfaceName) {
for (String regex : this.properties.getIgnoredInterfaces()) {
if (interfaceName.matches(regex)) {
log.trace("Ignoring interface: " + interfaceName);
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/util/InetUtilsProperties.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/util/InetUtilsProperties.java
index d4ec4613..aa0ca157 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/util/InetUtilsProperties.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/util/InetUtilsProperties.java
@@ -36,28 +36,29 @@ public class InetUtilsProperties {
private String defaultHostname = "localhost";
/**
- * The default ipaddress. Used in case of errors.
+ * The default IP address. Used in case of errors.
*/
private String defaultIpAddress = "127.0.0.1";
/**
- * Timeout in seconds for calculating hostname.
+ * Timeout, in seconds, for calculating hostname.
*/
@Value("${spring.util.timeout.sec:${SPRING_UTIL_TIMEOUT_SEC:1}}")
private int timeoutSeconds = 1;
/**
- * List of Java regex expressions for network interfaces that will be ignored.
+ * List of Java regular expressions for network interfaces that will be ignored.
*/
private List ignoredInterfaces = new ArrayList<>();
/**
- * Use only interfaces with site local addresses. See {@link InetAddress#isSiteLocalAddress()} for more details.
+ * Whether to use only interfaces with site local addresses.
+ * See {@link InetAddress#isSiteLocalAddress()} for more details.
*/
private boolean useOnlySiteLocalInterfaces = false;
/**
- * List of Java regex expressions for network addresses that will be preferred.
+ * List of Java regular expressions for network addresses that will be preferred.
*/
private List preferredNetworks = new ArrayList<>();
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/util/SpringFactoryImportSelector.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/util/SpringFactoryImportSelector.java
index ccc8d00e..dcb887e8 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/util/SpringFactoryImportSelector.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/commons/util/SpringFactoryImportSelector.java
@@ -34,7 +34,7 @@ import org.springframework.util.Assert;
/**
- * Selects configurations to load defined by the generic type T. Loads implementations
+ * Selects configurations to load, defined by the generic type T. Loads implementations
* using {@link SpringFactoriesLoader}.
*
* @author Spencer Gibb
diff --git a/spring-cloud-context/src/main/java/org/springframework/cloud/autoconfigure/LifecycleMvcEndpointAutoConfiguration.java b/spring-cloud-context/src/main/java/org/springframework/cloud/autoconfigure/LifecycleMvcEndpointAutoConfiguration.java
index 0db22a8a..66c554cd 100644
--- a/spring-cloud-context/src/main/java/org/springframework/cloud/autoconfigure/LifecycleMvcEndpointAutoConfiguration.java
+++ b/spring-cloud-context/src/main/java/org/springframework/cloud/autoconfigure/LifecycleMvcEndpointAutoConfiguration.java
@@ -24,8 +24,8 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.ConfigurableEnvironment;
/**
- * Autoconfiguration for some MVC endpoints governing the application context lifecycle.
- * Provides restart, pause, resume, refresh (environment) and environment update
+ * Auto-configuration for some MVC endpoints governing the application context lifecycle.
+ * Provides restart, pause, resume, refresh (environment), and environment update
* endpoints.
*
* @author Dave Syer
diff --git a/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/BootstrapConfiguration.java b/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/BootstrapConfiguration.java
index d8df65d1..5343950d 100644
--- a/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/BootstrapConfiguration.java
+++ b/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/BootstrapConfiguration.java
@@ -31,7 +31,7 @@ import java.lang.annotation.Target;
public @interface BootstrapConfiguration {
/**
- * Exclude specific auto-configuration classes such that they will never be applied.
+ * Excludes specific auto-configuration classes such that they will never be applied.
*/
Class>[] exclude() default {};
diff --git a/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/config/PropertySourceBootstrapProperties.java b/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/config/PropertySourceBootstrapProperties.java
index 8bf1c4a2..f686cc44 100644
--- a/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/config/PropertySourceBootstrapProperties.java
+++ b/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/config/PropertySourceBootstrapProperties.java
@@ -20,7 +20,7 @@ public class PropertySourceBootstrapProperties {
/**
* Flag to indicate that when {@link #setAllowOverride(boolean) allowOverride} is
- * true, external properties should take lowest priority, and not override any
+ * true, external properties should take lowest priority and should not override any
* existing property sources (including local config files). Default false.
*/
private boolean overrideNone = false;
diff --git a/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/config/PropertySourceLocator.java b/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/config/PropertySourceLocator.java
index 96fce80d..ea6bcf10 100644
--- a/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/config/PropertySourceLocator.java
+++ b/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/config/PropertySourceLocator.java
@@ -29,10 +29,10 @@ import org.springframework.core.env.PropertySource;
public interface PropertySourceLocator {
/**
- * @param environment the current Environment
- * @return a PropertySource or null if there is none
+ * @param environment The current Environment.
+ * @return A PropertySource, or null if there is none.
*
- * @throws IllegalStateException if there is a fail fast condition
+ * @throws IllegalStateException if there is a fail-fast condition.
*/
PropertySource> locate(Environment environment);
diff --git a/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/encrypt/EnvironmentDecryptApplicationInitializer.java b/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/encrypt/EnvironmentDecryptApplicationInitializer.java
index af49fdc1..ec67ef5c 100644
--- a/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/encrypt/EnvironmentDecryptApplicationInitializer.java
+++ b/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/encrypt/EnvironmentDecryptApplicationInitializer.java
@@ -42,7 +42,7 @@ import org.springframework.core.env.SystemEnvironmentPropertySource;
import org.springframework.security.crypto.encrypt.TextEncryptor;
/**
- * Decrypt properties from the environment and insert them with high priority so they
+ * Decrypts properties from the environment and inserts them with high priority so they
* override the encrypted values.
*
* @author Dave Syer
@@ -67,7 +67,7 @@ public class EnvironmentDecryptApplicationInitializer implements
/**
* Strategy to determine how to handle exceptions during decryption.
*
- * @param failOnError the flag value (default true)
+ * @param failOnError The flag value (default true).
*/
public void setFailOnError(boolean failOnError) {
this.failOnError = failOnError;
diff --git a/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/encrypt/KeyProperties.java b/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/encrypt/KeyProperties.java
index 2d212f1d..bb2c773e 100644
--- a/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/encrypt/KeyProperties.java
+++ b/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/encrypt/KeyProperties.java
@@ -22,13 +22,13 @@ import org.springframework.core.io.Resource;
public class KeyProperties {
/**
- * A symmetric key. As a stronger alternative consider using a keystore.
+ * A symmetric key. As a stronger alternative, consider using a keystore.
*/
private String key;
/**
- * A salt for the symmetric key in the form of a hex-encoded byte array. As a stronger
- * alternative consider using a keystore.
+ * A salt for the symmetric key, in the form of a hex-encoded byte array. As a stronger
+ * alternative, consider using a keystore.
*/
private String salt = "deadbeef";
@@ -131,4 +131,4 @@ public class KeyProperties {
}
}
-}
\ No newline at end of file
+}
diff --git a/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/encrypt/RsaProperties.java b/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/encrypt/RsaProperties.java
index 38b05550..78d5cdef 100644
--- a/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/encrypt/RsaProperties.java
+++ b/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/encrypt/RsaProperties.java
@@ -27,22 +27,22 @@ import org.springframework.security.rsa.crypto.RsaAlgorithm;
public class RsaProperties {
/**
- * The RSA algorithm to use (DEFAULT or OEAP). Once it is set do not change it (or
- * existing ciphers will not a decryptable).
+ * The RSA algorithm to use (DEFAULT or OEAP). Once it is set, do not change it (or
+ * existing ciphers will not be decryptable).
*/
private RsaAlgorithm algorithm = RsaAlgorithm.DEFAULT;
/**
* Flag to indicate that "strong" AES encryption should be used internally. If
- * true then the GCM algorithm is applied to the AES encrypted bytes. Default is
- * false (in which case "standard" CBC is used instead). Once it is set do not
- * change it (or existing ciphers will not a decryptable).
+ * true, then the GCM algorithm is applied to the AES encrypted bytes. Default is
+ * false (in which case "standard" CBC is used instead). Once it is set, do not
+ * change it (or existing ciphers will not be decryptable).
*/
private boolean strong = false;
/**
- * Salt for the random secret used to encrypt cipher text. Once it is set do not
- * change it (or existing ciphers will not a decryptable).
+ * Salt for the random secret used to encrypt cipher text. Once it is set, do not
+ * change it (or existing ciphers will not be decryptable).
*/
private String salt = "deadbeef";
diff --git a/spring-cloud-context/src/main/java/org/springframework/cloud/context/environment/EnvironmentChangeEvent.java b/spring-cloud-context/src/main/java/org/springframework/cloud/context/environment/EnvironmentChangeEvent.java
index d58e24d8..e6df1e32 100644
--- a/spring-cloud-context/src/main/java/org/springframework/cloud/context/environment/EnvironmentChangeEvent.java
+++ b/spring-cloud-context/src/main/java/org/springframework/cloud/context/environment/EnvironmentChangeEvent.java
@@ -42,7 +42,7 @@ public class EnvironmentChangeEvent extends ApplicationEvent {
}
/**
- * @return the keys
+ * @return The keys.
*/
public Set getKeys() {
return keys;
diff --git a/spring-cloud-context/src/main/java/org/springframework/cloud/context/environment/EnvironmentManager.java b/spring-cloud-context/src/main/java/org/springframework/cloud/context/environment/EnvironmentManager.java
index 12a89dd1..7edfac7f 100644
--- a/spring-cloud-context/src/main/java/org/springframework/cloud/context/environment/EnvironmentManager.java
+++ b/spring-cloud-context/src/main/java/org/springframework/cloud/context/environment/EnvironmentManager.java
@@ -32,7 +32,7 @@ import org.springframework.stereotype.Component;
/**
* Entry point for making local (but volatile) changes to the {@link Environment} of a
* running application. Allows properties to be added and values changed, simply by adding
- * them to a high priority property source in the existing Environment.
+ * them to a high-priority property source in the existing Environment.
*
* @author Dave Syer
*
diff --git a/spring-cloud-context/src/main/java/org/springframework/cloud/context/environment/WritableEnvironmentEndpointWebExtension.java b/spring-cloud-context/src/main/java/org/springframework/cloud/context/environment/WritableEnvironmentEndpointWebExtension.java
index 9a99193f..7c8a02e4 100644
--- a/spring-cloud-context/src/main/java/org/springframework/cloud/context/environment/WritableEnvironmentEndpointWebExtension.java
+++ b/spring-cloud-context/src/main/java/org/springframework/cloud/context/environment/WritableEnvironmentEndpointWebExtension.java
@@ -24,7 +24,7 @@ import org.springframework.boot.actuate.endpoint.web.annotation.EndpointWebExten
import org.springframework.boot.actuate.env.EnvironmentEndpointWebExtension;
/**
- * MVC endpoint for the {@link EnvironmentManager} providing a POST to /env as a simple
+ * MVC endpoint for the {@link EnvironmentManager}, providing a POST to /env as a simple
* way to change the Environment.
*
* @author Dave Syer
diff --git a/spring-cloud-context/src/main/java/org/springframework/cloud/context/properties/ConfigurationPropertiesBeans.java b/spring-cloud-context/src/main/java/org/springframework/cloud/context/properties/ConfigurationPropertiesBeans.java
index f655e500..d9b9cedd 100644
--- a/spring-cloud-context/src/main/java/org/springframework/cloud/context/properties/ConfigurationPropertiesBeans.java
+++ b/spring-cloud-context/src/main/java/org/springframework/cloud/context/properties/ConfigurationPropertiesBeans.java
@@ -74,7 +74,7 @@ ApplicationContextAware {
}
/**
- * @param beans the bean meta data to set
+ * @param beans The bean meta data to set.
*/
public void setBeanMetaDataStore(ConfigurationBeanFactoryMetadata beans) {
this.metaData = beans;
diff --git a/spring-cloud-context/src/main/java/org/springframework/cloud/context/properties/ConfigurationPropertiesRebinder.java b/spring-cloud-context/src/main/java/org/springframework/cloud/context/properties/ConfigurationPropertiesRebinder.java
index 67195807..c393b26d 100644
--- a/spring-cloud-context/src/main/java/org/springframework/cloud/context/properties/ConfigurationPropertiesRebinder.java
+++ b/spring-cloud-context/src/main/java/org/springframework/cloud/context/properties/ConfigurationPropertiesRebinder.java
@@ -39,10 +39,10 @@ import org.springframework.cloud.util.ProxyUtils;
* Listens for {@link EnvironmentChangeEvent} and rebinds beans that were bound to the
* {@link Environment} using {@link ConfigurationProperties
* @ConfigurationProperties}. When these beans are re-bound and
- * re-initialized the changes are available immediately to any component that is using the
+ * re-initialized, the changes are available immediately to any component that is using the
* @ConfigurationProperties bean.
*
- * @see RefreshScope for a deeper and optionally more focused refresh of bean components
+ * @see RefreshScope for a deeper and optionally more focused refresh of bean components.
*
* @author Dave Syer
*
@@ -71,7 +71,7 @@ public class ConfigurationPropertiesRebinder
/**
* A map of bean name to errors when instantiating the bean.
*
- * @return the errors accumulated since the latest destroy
+ * @return The errors accumulated since the latest destroy.
*/
public Map getErrors() {
return this.errors;
diff --git a/spring-cloud-context/src/main/java/org/springframework/cloud/context/refresh/ContextRefresher.java b/spring-cloud-context/src/main/java/org/springframework/cloud/context/refresh/ContextRefresher.java
index 8c013556..5d6e8aee 100644
--- a/spring-cloud-context/src/main/java/org/springframework/cloud/context/refresh/ContextRefresher.java
+++ b/spring-cloud-context/src/main/java/org/springframework/cloud/context/refresh/ContextRefresher.java
@@ -67,7 +67,7 @@ public class ContextRefresher {
return keys;
}
- /* for testing */ ConfigurableApplicationContext addConfigFilesToEnvironment() {
+ /* For testing. */ ConfigurableApplicationContext addConfigFilesToEnvironment() {
ConfigurableApplicationContext capture = null;
try {
StandardEnvironment environment = copyEnvironment(
diff --git a/spring-cloud-context/src/main/java/org/springframework/cloud/context/restart/RestartListener.java b/spring-cloud-context/src/main/java/org/springframework/cloud/context/restart/RestartListener.java
index 5a5a4588..544b703c 100644
--- a/spring-cloud-context/src/main/java/org/springframework/cloud/context/restart/RestartListener.java
+++ b/spring-cloud-context/src/main/java/org/springframework/cloud/context/restart/RestartListener.java
@@ -24,7 +24,7 @@ import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.SmartApplicationListener;
/**
- * A listener that stores enough information about an application as it starts, to be able
+ * A listener that stores enough information about an application, as it starts, to be able
* to restart it later if needed.
*
* @author Dave Syer
diff --git a/spring-cloud-context/src/main/java/org/springframework/cloud/context/scope/GenericScope.java b/spring-cloud-context/src/main/java/org/springframework/cloud/context/scope/GenericScope.java
index 8946d353..724833b9 100644
--- a/spring-cloud-context/src/main/java/org/springframework/cloud/context/scope/GenericScope.java
+++ b/spring-cloud-context/src/main/java/org/springframework/cloud/context/scope/GenericScope.java
@@ -91,10 +91,10 @@ public class GenericScope implements Scope, BeanFactoryPostProcessor,
private ConcurrentMap locks = new ConcurrentHashMap<>();
/**
- * Manual override for the serialization id that will be used to identify the bean
+ * Manual override for the serialization ID that will be used to identify the bean
* factory. The default is a unique key based on the bean names in the bean factory.
*
- * @param id the id to set
+ * @param id The ID to set.
*/
public void setId(String id) {
this.id = id;
@@ -103,7 +103,7 @@ public class GenericScope implements Scope, BeanFactoryPostProcessor,
/**
* The name of this scope. Default "generic".
*
- * @param name the name value to set
+ * @param name The name value to set.
*/
public void setName(String name) {
this.name = name;
@@ -112,7 +112,7 @@ public class GenericScope implements Scope, BeanFactoryPostProcessor,
/**
* The cache implementation to use for bean instances in this scope.
*
- * @param cache the cache to use
+ * @param cache The cache to use.
*/
public void setScopeCache(ScopeCache cache) {
this.cache = new BeanLifecycleWrapperCache(cache);
@@ -121,7 +121,7 @@ public class GenericScope implements Scope, BeanFactoryPostProcessor,
/**
* A map of bean name to errors when instantiating the bean.
*
- * @return the errors accumulated since the latest destroy
+ * @return The errors accumulated since the latest destroy.
*/
public Map getErrors() {
return this.errors;
@@ -153,10 +153,10 @@ public class GenericScope implements Scope, BeanFactoryPostProcessor,
}
/**
- * Destroy the named bean (i.e. flush it from the cache by default).
+ * Destroys the named bean (i.e. flushes it from the cache by default).
*
- * @param name the bean name to flush
- * @return true if the bean was already cached, false otherwise
+ * @param name The bean name to flush.
+ * @return True if the bean was already cached; false otherwise.
*/
protected boolean destroy(String name) {
BeanLifecycleWrapper wrapper = this.cache.remove(name);
@@ -269,13 +269,13 @@ public class GenericScope implements Scope, BeanFactoryPostProcessor,
}
/**
- * If the bean factory is a DefaultListableBeanFactory then it can serialize scoped
+ * If the bean factory is a DefaultListableBeanFactory, then it can serialize scoped
* beans and deserialize them in another context (even in another JVM), as long as the
- * ids of the bean factories match. This method sets up the serialization id to be
- * either the id provided to the scope instance, or if that is null, a hash of all the
+ * IDs of the bean factories match. This method sets up the serialization ID to be
+ * either the ID provided to the scope instance, or if that is null, a hash of all the
* bean names.
*
- * @param beanFactory the bean factory to configure
+ * @param beanFactory The bean factory to configure.
*/
private void setSerializationId(ConfigurableListableBeanFactory beanFactory) {
diff --git a/spring-cloud-context/src/main/java/org/springframework/cloud/context/scope/ScopeCache.java b/spring-cloud-context/src/main/java/org/springframework/cloud/context/scope/ScopeCache.java
index 1be557c0..42ac62b9 100644
--- a/spring-cloud-context/src/main/java/org/springframework/cloud/context/scope/ScopeCache.java
+++ b/spring-cloud-context/src/main/java/org/springframework/cloud/context/scope/ScopeCache.java
@@ -19,7 +19,7 @@ package org.springframework.cloud.context.scope;
import java.util.Collection;
/**
- * A special purpose cache interface specifically for the {@link GenericScope} to use to manage cached bean instances.
+ * A special-purpose cache interface specifically for the {@link GenericScope} to use to manage cached bean instances.
* Implementations generally fall into two categories: those that store values "globally" (i.e. one instance per key),
* and those that store potentially multiple instances per key based on context (e.g. via a thread local). All
* implementations should be thread safe.
@@ -30,25 +30,25 @@ import java.util.Collection;
public interface ScopeCache {
/**
- * Remove the object with this name from the cache.
+ * Removes the object with this name from the cache.
*
- * @param name the object name
- * @return the object removed or null if there was none
+ * @param name The object name.
+ * @return The object removed, or null if there was none.
*/
Object remove(String name);
/**
- * Clear the cache and return all objects in an unmodifiable collection.
+ * Clears the cache and returns all objects in an unmodifiable collection.
*
- * @return all objects stored in the cache
+ * @return All objects stored in the cache.
*/
Collection clear();
/**
- * Get the named object from the cache.
+ * Gets the named object from the cache.
*
- * @param name the name of the object
- * @return the object with that name or null if there is none
+ * @param name The name of the object.
+ * @return The object with that name, or null if there is none.
*/
Object get(String name);
@@ -56,9 +56,9 @@ public interface ScopeCache {
* Put a value in the cache if the key is not already used. If one is already present with the name provided, it is
* not replaced, but is returned to the caller.
*
- * @param name the key
- * @param value the new candidate value
- * @return the value that is in the cache at the end of the operation
+ * @param name The key.
+ * @param value The new candidate value.
+ * @return The value that is in the cache at the end of the operation.
*/
Object put(String name, Object value);
diff --git a/spring-cloud-context/src/main/java/org/springframework/cloud/context/scope/refresh/RefreshScope.java b/spring-cloud-context/src/main/java/org/springframework/cloud/context/scope/refresh/RefreshScope.java
index f85fa5a1..ba23a943 100644
--- a/spring-cloud-context/src/main/java/org/springframework/cloud/context/scope/refresh/RefreshScope.java
+++ b/spring-cloud-context/src/main/java/org/springframework/cloud/context/scope/refresh/RefreshScope.java
@@ -46,20 +46,20 @@ import org.springframework.jmx.export.annotation.ManagedResource;
* proxy for every bean in the scope, so there is a flag
* {@link #setProxyTargetClass(boolean) proxyTargetClass} which controls the proxy
* creation, defaulting to JDK dynamic proxies and therefore only exposing the interfaces
- * implemented by a bean. If callers need access to other methods then the flag needs to
- * be set (and CGLib present on the classpath). Because this scope automatically proxies
- * all its beans, there is no need to add <aop:auto-proxy/> to any bean
- * definitions.
+ * implemented by a bean. If callers need access to other methods, then the flag needs to
+ * be set (and CGLib must be present on the classpath). Because this scope automatically
+ * proxies all its beans, there is no need to add <aop:auto-proxy/> to
+ * any bean definitions.
*
*
*
* The scoped proxy approach adopted here has a side benefit that bean instances are
* automatically {@link Serializable}, and can be sent across the wire as long as the
* receiver has an identical application context on the other side. To ensure that the two
- * contexts agree that they are identical they have to have the same serialization id. One
- * will be generated automatically by default from the bean names, so two contexts with
- * the same bean names are by default able to exchange beans by name. If you need to
- * override the default id then provide an explicit {@link #setId(String) id} when the
+ * contexts agree that they are identical, they have to have the same serialization ID.
+ * One will be generated automatically by default from the bean names, so two contexts
+ * with the same bean names are by default able to exchange beans by name. If you need to
+ * override the default ID, then provide an explicit {@link #setId(String) id} when the
* Scope is declared.
*
*
@@ -78,7 +78,7 @@ public class RefreshScope extends GenericScope
private int order = Ordered.LOWEST_PRECEDENCE - 100;
/**
- * Create a scope instance and give it the default name: "refresh".
+ * Creates a scope instance and gives it the default name: "refresh".
*/
public RefreshScope() {
super.setName("refresh");
@@ -97,7 +97,7 @@ public class RefreshScope extends GenericScope
* Flag to determine whether all beans in refresh scope should be instantiated eagerly
* on startup. Default true.
*
- * @param eager the flag to set
+ * @param eager The flag to set.
*/
public void setEager(boolean eager) {
this.eager = eager;
diff --git a/spring-cloud-context/src/main/java/org/springframework/cloud/context/scope/thread/ThreadScope.java b/spring-cloud-context/src/main/java/org/springframework/cloud/context/scope/thread/ThreadScope.java
index 4b0070be..1db0548d 100644
--- a/spring-cloud-context/src/main/java/org/springframework/cloud/context/scope/thread/ThreadScope.java
+++ b/spring-cloud-context/src/main/java/org/springframework/cloud/context/scope/thread/ThreadScope.java
@@ -25,7 +25,7 @@ import org.springframework.cloud.context.scope.GenericScope;
public class ThreadScope extends GenericScope {
/**
- * Create a scope instance and give it the default name: "thread".
+ * Creates a scope instance and gives it the default name: "thread".
*/
public ThreadScope() {
super();
diff --git a/spring-cloud-context/src/main/java/org/springframework/cloud/endpoint/event/RefreshEvent.java b/spring-cloud-context/src/main/java/org/springframework/cloud/endpoint/event/RefreshEvent.java
index 62cde168..fafba6df 100644
--- a/spring-cloud-context/src/main/java/org/springframework/cloud/endpoint/event/RefreshEvent.java
+++ b/spring-cloud-context/src/main/java/org/springframework/cloud/endpoint/event/RefreshEvent.java
@@ -4,7 +4,7 @@ import org.springframework.cloud.endpoint.RefreshEndpoint;
import org.springframework.context.ApplicationEvent;
/**
- * Event that triggers a call to {@link RefreshEndpoint#refresh()}
+ * Event that triggers a call to {@link RefreshEndpoint#refresh()}.
* @author Spencer Gibb
*/
@SuppressWarnings("serial")
diff --git a/spring-cloud-context/src/main/java/org/springframework/cloud/endpoint/event/RefreshEventListener.java b/spring-cloud-context/src/main/java/org/springframework/cloud/endpoint/event/RefreshEventListener.java
index 6f55cbb7..faefccf4 100644
--- a/spring-cloud-context/src/main/java/org/springframework/cloud/endpoint/event/RefreshEventListener.java
+++ b/spring-cloud-context/src/main/java/org/springframework/cloud/endpoint/event/RefreshEventListener.java
@@ -12,7 +12,7 @@ import org.springframework.context.event.EventListener;
/**
* Calls {@link RefreshEventListener#refresh} when a {@link RefreshEvent} is received.
- * Only responds to {@link RefreshEvent} after receiving an {@link ApplicationReadyEvent} as the RefreshEvent's might come to early in the application lifecycle.
+ * Only responds to {@link RefreshEvent} after receiving an {@link ApplicationReadyEvent}, as the RefreshEvents might come too early in the application lifecycle.
* @author Spencer Gibb
*/
public class RefreshEventListener {
diff --git a/spring-cloud-context/src/main/java/org/springframework/cloud/health/RefreshScopeHealthIndicator.java b/spring-cloud-context/src/main/java/org/springframework/cloud/health/RefreshScopeHealthIndicator.java
index 48257f56..9b1f0b8b 100644
--- a/spring-cloud-context/src/main/java/org/springframework/cloud/health/RefreshScopeHealthIndicator.java
+++ b/spring-cloud-context/src/main/java/org/springframework/cloud/health/RefreshScopeHealthIndicator.java
@@ -27,7 +27,7 @@ import org.springframework.cloud.context.scope.refresh.RefreshScope;
/**
* Health indicator for the refresh scope and configuration properties rebinding. If an
- * environment change causes a bean to fail in instantiate or bind this indicator will
+ * environment change causes a bean to fail in instantiate or bind, this indicator will
* generally say what the problem was and switch to DOWN.
*
* @author Dave Syer