From ac54d7fe3cbce1d25be8cb300d2941657a8a7604 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 21 Jan 2014 13:30:23 -0800 Subject: [PATCH] Final polish before 1.0.0.RC1 --- ...dpointWebMvcChildContextConfiguration.java | 3 +- .../MetricRepositoryAutoConfiguration.java | 6 +- .../actuate/endpoint/AbstractEndpoint.java | 3 +- .../boot/actuate/endpoint/TraceEndpoint.java | 3 +- .../endpoint/jmx/EndpointMBeanExporter.java | 4 +- .../endpoint/mvc/EndpointHandlerMapping.java | 3 +- ...cEndpoint.java => EndpointMvcAdapter.java} | 24 ++++--- .../endpoint/mvc/EnvironmentMvcEndpoint.java | 6 +- .../endpoint/mvc/JolokiaMvcEndpoint.java | 8 +-- .../endpoint/mvc/ManagementErrorEndpoint.java | 19 +++-- .../endpoint/mvc/MetricsMvcEndpoint.java | 8 ++- .../actuate/endpoint/mvc/MvcEndpoint.java | 18 ++++- .../actuate/endpoint/mvc/MvcEndpoints.java | 6 +- .../endpoint/mvc/ShutdownMvcEndpoint.java | 6 +- .../health/VanillaHealthIndicator.java | 4 +- .../export/AbstractMetricExporter.java | 9 +-- .../repository/InMemoryMetricRepository.java | 3 +- .../redis/RedisMultiMetricRepository.java | 2 +- .../metrics/repository/redis/RedisUtils.java | 18 +++++ .../boot/actuate/metrics/rich/RichGauge.java | 16 +++++ .../metrics/writer/CodahaleMetricWriter.java | 17 +++-- .../metrics/writer/DefaultCounterService.java | 6 +- .../metrics/writer/DefaultGaugeService.java | 6 +- .../ManagementServerProperties.java | 12 ++-- .../boot/actuate/web/ErrorController.java | 3 +- .../EndpointWebMvcAutoConfigurationTests.java | 3 +- .../mvc/EndpointHandlerMappingTests.java | 6 +- .../metrics/repository/redis/RedisServer.java | 14 ++-- ...ConfigurationReportLoggingInitializer.java | 1 - .../EnableAutoConfiguration.java | 3 - .../batch/BasicBatchConfigurer.java | 15 ++++ .../batch/BatchDatabaseInitializer.java | 5 +- .../condition/OnBeanCondition.java | 24 +++++-- .../condition/OnWebApplicationCondition.java | 5 +- .../jdbc/DataSourceAutoConfiguration.java | 22 +++++- .../jms/JmsTemplateAutoConfiguration.java | 10 +-- .../jmx/JmxAutoConfiguration.java | 3 +- .../reactor/ReactorAutoConfiguration.java | 3 +- .../AuthenticationManagerConfiguration.java | 7 +- .../security/SecurityAutoConfiguration.java | 8 ++- .../SpringBootWebSecurityConfiguration.java | 69 ++++++++++--------- .../infrastructure/CommandLineInvoker.java | 2 +- .../cli/command/shell/CommandCompleter.java | 7 +- ...scapeAwareWhiteSpaceArgumentDelimiter.java | 2 +- .../cli/command/shell/RunProcessCommand.java | 4 +- .../boot/cli/compiler/GroovyCompiler.java | 3 +- .../RepositoryConfigurationFactory.java | 3 +- .../cli/compiler/grape/JreProxySelector.java | 8 +-- .../grape/ManagedDependenciesFactory.java | 4 ++ .../grape/RepositoryConfiguration.java | 3 +- .../GroovyBeansTransformation.java | 5 +- .../boot/groovy/EnableDeviceResolver.java | 9 ++- .../groovy/EnableIntegrationPatterns.java | 8 ++- .../boot/groovy/EnableJmsMessaging.java | 9 ++- .../boot/groovy/GroovyTemplate.java | 4 +- .../mongo/SampleMongoApplicationTests.java | 4 +- .../gradle/SpringBootPluginExtension.groovy | 12 ++-- .../boot/gradle/task/ProjectLibraries.java | 19 ++++- .../boot/gradle/task/RunApp.java | 4 +- .../boot/loader/PropertiesLauncher.java | 4 +- .../boot/loader/archive/FilteredArchive.java | 5 +- .../boot/loader/util/SystemPropertyUtils.java | 18 ++--- .../boot/config/SimpleJsonParser.java | 6 +- .../jetty/JettyEmbeddedServletContainer.java | 4 +- .../TomcatEmbeddedWebappClassLoader.java | 6 +- .../boot/test/package-info.java | 23 +++++++ .../EnableConfigurationPropertiesTests.java | 21 +++++- 67 files changed, 390 insertions(+), 218 deletions(-) rename spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/{GenericMvcEndpoint.java => EndpointMvcAdapter.java} (67%) create mode 100644 spring-boot/src/main/java/org/springframework/boot/test/package-info.java diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcChildContextConfiguration.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcChildContextConfiguration.java index 4fa3dee7f7..49937e77e5 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcChildContextConfiguration.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcChildContextConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,6 +53,7 @@ import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandl * Configuration triggered from {@link EndpointWebMvcAutoConfiguration} when a new * {@link EmbeddedServletContainer} running on a different port is required. * + * @author Dave Syer * @see EndpointWebMvcAutoConfiguration */ @Configuration diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/MetricRepositoryAutoConfiguration.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/MetricRepositoryAutoConfiguration.java index 889e7af740..d6ca68499e 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/MetricRepositoryAutoConfiguration.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/MetricRepositoryAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,11 +48,9 @@ import org.springframework.messaging.support.ExecutorSubscribableChannel; import com.codahale.metrics.MetricRegistry; /** - *

* {@link EnableAutoConfiguration Auto-configuration} for metrics services. Creates * user-facing {@link GaugeService} and {@link CounterService} instances, and also back - * end repositories to catch the data pumped into them. - *

+ * end repositories to catch the data pumped into them.

*

* An {@link InMemoryMetricRepository} is always created unless another * {@link MetricRepository} is already provided by the user. In general, even if metric diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AbstractEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AbstractEndpoint.java index 9b62efd36f..bb7ad5d1d0 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AbstractEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AbstractEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import javax.validation.constraints.Pattern; /** * Abstract base for {@link Endpoint} implementations. - *

* * @author Phillip Webb * @author Christian Dupuis diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/TraceEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/TraceEndpoint.java index ef687ec3b2..cf69bb6b56 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/TraceEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/TraceEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,6 @@ public class TraceEndpoint extends AbstractEndpoint> { /** * Create a new {@link TraceEndpoint} instance. - * * @param repository the trace repository */ public TraceEndpoint(TraceRepository repository) { diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanExporter.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanExporter.java index 4830f49a90..b197a8e7a0 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanExporter.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanExporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -184,8 +184,6 @@ public class EndpointMBeanExporter extends MBeanExporter implements SmartLifecyc return builder.toString(); } - // SmartLifeCycle implementation - @Override public final int getPhase() { return this.phase; diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EndpointHandlerMapping.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EndpointHandlerMapping.java index ed98da9aa0..908b16c9eb 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EndpointHandlerMapping.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EndpointHandlerMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,7 +46,6 @@ import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandl * @author Phillip Webb * @author Christian Dupuis * @author Dave Syer - * */ public class EndpointHandlerMapping extends RequestMappingHandlerMapping implements ApplicationContextAware { diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/GenericMvcEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EndpointMvcAdapter.java similarity index 67% rename from spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/GenericMvcEndpoint.java rename to spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EndpointMvcAdapter.java index 524200cbb7..57bb44d503 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/GenericMvcEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EndpointMvcAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,18 +17,26 @@ package org.springframework.boot.actuate.endpoint.mvc; import org.springframework.boot.actuate.endpoint.Endpoint; +import org.springframework.util.Assert; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; /** + * Adapter class to expose {@link Endpoint}s as {@link MvcEndpoint}s. + * * @author Dave Syer */ -public class GenericMvcEndpoint implements MvcEndpoint { +public class EndpointMvcAdapter implements MvcEndpoint { - private Endpoint delegate; + private final Endpoint delegate; - public GenericMvcEndpoint(Endpoint delegate) { + /** + * Create a new {@link EndpointMvcAdapter}. + * @param delegate the underlying {@link Endpoint} to adapt. + */ + public EndpointMvcAdapter(Endpoint delegate) { + Assert.notNull(delegate, "Delegate must not be null"); this.delegate = delegate; } @@ -49,11 +57,9 @@ public class GenericMvcEndpoint implements MvcEndpoint { } @Override - public Class getEndpointType() { - @SuppressWarnings("unchecked") - Class> type = (Class>) this.delegate - .getClass(); - return type; + @SuppressWarnings("rawtypes") + public Class getEndpointType() { + return this.delegate.getClass(); } } diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EnvironmentMvcEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EnvironmentMvcEndpoint.java index 1eacc19b75..f8a741a003 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EnvironmentMvcEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/EnvironmentMvcEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,9 +27,11 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseStatus; /** + * Adapter to expose {@link EnvironmentEndpoint} as an {@link MvcEndpoint}. + * * @author Dave Syer */ -public class EnvironmentMvcEndpoint extends GenericMvcEndpoint implements +public class EnvironmentMvcEndpoint extends EndpointMvcAdapter implements EnvironmentAware { private Environment environment; diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/JolokiaMvcEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/JolokiaMvcEndpoint.java index 7c7ea90d24..8f4d03edeb 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/JolokiaMvcEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/JolokiaMvcEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,8 +38,7 @@ import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.ServletWrappingController; /** - * {@link Endpoint} implementation to register the Jolokia infrastructure with the Boot - * management subsystem. + * {@link MvcEndpoint} to expose Jolokia. * * @author Christian Dupuis */ @@ -110,7 +109,8 @@ public class JolokiaMvcEndpoint implements MvcEndpoint, InitializingBean, } @Override - public Class getEndpointType() { + @SuppressWarnings("rawtypes") + public Class getEndpointType() { return null; } diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/ManagementErrorEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/ManagementErrorEndpoint.java index 5b9e120f9c..f54eb450d7 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/ManagementErrorEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/ManagementErrorEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,17 +18,19 @@ package org.springframework.boot.actuate.endpoint.mvc; import java.util.Map; +import org.springframework.boot.actuate.endpoint.Endpoint; import org.springframework.boot.actuate.web.ErrorController; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.util.Assert; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.context.request.RequestAttributes; import org.springframework.web.context.request.RequestContextHolder; /** - * Special endpoint for handling "/error" path when the management servlet is in a child - * context. The regular {@link ErrorController} should be available there but because of - * the way the handler mappings are set up it will not be detected. + * Special {@link MvcEndpoint} for handling "/error" path when the management servlet is + * in a child context. The regular {@link ErrorController} should be available there but + * because of the way the handler mappings are set up it will not be detected. * * @author Dave Syer */ @@ -36,9 +38,11 @@ import org.springframework.web.context.request.RequestContextHolder; public class ManagementErrorEndpoint implements MvcEndpoint { private final ErrorController controller; - private String path; + + private final String path; public ManagementErrorEndpoint(String path, ErrorController controller) { + Assert.notNull(controller, "Controller must not be null"); this.path = path; this.controller = controller; } @@ -61,7 +65,8 @@ public class ManagementErrorEndpoint implements MvcEndpoint { } @Override - public Class getEndpointType() { + @SuppressWarnings("rawtypes") + public Class getEndpointType() { return null; } -} \ No newline at end of file +} diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/MetricsMvcEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/MetricsMvcEndpoint.java index 26800b5b89..920d0adfc4 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/MetricsMvcEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/MetricsMvcEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,11 +25,13 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseStatus; /** + * Adapter to expose {@link MetricsEndpoint} as an {@link MvcEndpoint}. + * * @author Dave Syer */ -public class MetricsMvcEndpoint extends GenericMvcEndpoint { +public class MetricsMvcEndpoint extends EndpointMvcAdapter { - private MetricsEndpoint delegate; + private final MetricsEndpoint delegate; public MetricsMvcEndpoint(MetricsEndpoint delegate) { super(delegate); diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/MvcEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/MvcEndpoint.java index 7aa76420f7..a6ad2893ab 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/MvcEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/MvcEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,10 +29,22 @@ import org.springframework.boot.actuate.endpoint.Endpoint; */ public interface MvcEndpoint { + /** + * Return the MVC path of the endpoint. + */ String getPath(); + /** + * Return if the endpoint exposes sensitive information. + */ boolean isSensitive(); - Class getEndpointType(); + /** + * Return the type of {@link Endpoint} exposed, or {@code null} if this + * {@link MvcEndpoint} exposes information that cannot be represented as a traditional + * {@link Endpoint}. + */ + @SuppressWarnings("rawtypes") + Class getEndpointType(); -} \ No newline at end of file +} diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/MvcEndpoints.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/MvcEndpoints.java index 3e1801b45c..5b7e329614 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/MvcEndpoints.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/MvcEndpoints.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,7 +60,7 @@ public class MvcEndpoints implements ApplicationContextAware, InitializingBean { Endpoint.class).values(); for (Endpoint endpoint : delegates) { if (isGenericEndpoint(endpoint.getClass())) { - this.endpoints.add(new GenericMvcEndpoint(endpoint)); + this.endpoints.add(new EndpointMvcAdapter(endpoint)); } } } @@ -85,4 +85,4 @@ public class MvcEndpoints implements ApplicationContextAware, InitializingBean { && !MvcEndpoint.class.isAssignableFrom(type); } -} \ No newline at end of file +} diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/ShutdownMvcEndpoint.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/ShutdownMvcEndpoint.java index 0877ed6885..dfa6865200 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/ShutdownMvcEndpoint.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/ShutdownMvcEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,9 +22,11 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; /** + * Adapter to expose {@link ShutdownEndpoint} as an {@link MvcEndpoint}. + * * @author Dave Syer */ -public class ShutdownMvcEndpoint extends GenericMvcEndpoint { +public class ShutdownMvcEndpoint extends EndpointMvcAdapter { public ShutdownMvcEndpoint(ShutdownEndpoint delegate) { super(delegate); diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/VanillaHealthIndicator.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/VanillaHealthIndicator.java index f98f91ee17..fa07500c82 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/VanillaHealthIndicator.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/VanillaHealthIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ package org.springframework.boot.actuate.health; /** - * Default implementation of {@link HealthIndicator} that simply returns "ok". + * Default implementation of {@link HealthIndicator} that simply returns {@literal "ok"}. * * @author Dave Syer */ diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/export/AbstractMetricExporter.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/export/AbstractMetricExporter.java index 42a454c365..c78eb92cd3 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/export/AbstractMetricExporter.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/export/AbstractMetricExporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,6 @@ public abstract class AbstractMetricExporter implements Exporter { /** * The earliest time for which data will be exported. - * * @param earliestTimestamp the timestamp to set */ public void setEarliestTimestamp(Date earliestTimestamp) { @@ -58,7 +57,6 @@ public abstract class AbstractMetricExporter implements Exporter { /** * Ignore timestamps (export all metrics). - * * @param ignoreTimestamps the flag to set */ public void setIgnoreTimestamps(boolean ignoreTimestamps) { @@ -96,7 +94,6 @@ public abstract class AbstractMetricExporter implements Exporter { * prefixes). If the metrics to be exported partition into groups identified by a * String, subclasses should override this method. Otherwise the default should be * fine (iteration over all metrics). - * * @return groups of metrics to iterate over (default singleton empty string) */ protected Iterable groups() { @@ -105,7 +102,6 @@ public abstract class AbstractMetricExporter implements Exporter { /** * Write the values associated with a group. - * * @param group the group to write * @param values the values to write */ @@ -113,10 +109,9 @@ public abstract class AbstractMetricExporter implements Exporter { /** * Get the next group of metrics to write. - * * @param group the group name to write * @return some metrics to write */ protected abstract Iterable> next(String group); -} \ No newline at end of file +} diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/repository/InMemoryMetricRepository.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/repository/InMemoryMetricRepository.java index 360b89d04c..d7012ea429 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/repository/InMemoryMetricRepository.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/repository/InMemoryMetricRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ public class InMemoryMetricRepository implements MetricRepository, MultiMetricRe PrefixMetricReader { private SimpleInMemoryRepository> metrics = new SimpleInMemoryRepository>(); + private Collection groups = new HashSet(); @Override diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/repository/redis/RedisMultiMetricRepository.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/repository/redis/RedisMultiMetricRepository.java index a57cbc6032..fea6f68e3e 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/repository/redis/RedisMultiMetricRepository.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/repository/redis/RedisMultiMetricRepository.java @@ -43,6 +43,7 @@ public class RedisMultiMetricRepository implements MultiMetricRepository { private static final String DEFAULT_METRICS_PREFIX = "spring.groups."; private String prefix = DEFAULT_METRICS_PREFIX; + private String keys = this.prefix + "keys"; private BoundZSetOperations zSetOperations; @@ -57,7 +58,6 @@ public class RedisMultiMetricRepository implements MultiMetricRepository { /** * The prefix for all metrics keys. - * * @param prefix the prefix to set for all metrics keys */ public void setPrefix(String prefix) { diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/repository/redis/RedisUtils.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/repository/redis/RedisUtils.java index 40763e47bb..b27f139659 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/repository/redis/RedisUtils.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/repository/redis/RedisUtils.java @@ -1,3 +1,19 @@ +/* + * Copyright 2012-2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.springframework.boot.actuate.metrics.repository.redis; import org.springframework.data.redis.connection.RedisConnectionFactory; @@ -8,6 +24,8 @@ import org.springframework.data.redis.serializer.GenericToStringSerializer; import org.springframework.data.redis.serializer.StringRedisSerializer; /** + * General Utils for working with Redis. + * * @author Luke Taylor */ class RedisUtils { diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/rich/RichGauge.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/rich/RichGauge.java index 211fbc4f6f..722481152c 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/rich/RichGauge.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/rich/RichGauge.java @@ -1,3 +1,19 @@ +/* + * Copyright 2012-2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.springframework.boot.actuate.metrics.rich; import org.springframework.util.Assert; diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/writer/CodahaleMetricWriter.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/writer/CodahaleMetricWriter.java index 47c5f9d4e2..20cc887ce0 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/writer/CodahaleMetricWriter.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/writer/CodahaleMetricWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 the original author or authors. + * Copyright 2012-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,6 +30,7 @@ import com.codahale.metrics.Timer; /** * A {@link MetricWriter} that send data to a Codahale {@link MetricRegistry} based on a * naming convention: + * *