From b5d267ca896f05ac6ebc76a77fd62a3e750db1f6 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Mon, 9 Jun 2014 12:31:53 -0700 Subject: [PATCH] Polish --- .../EndpointWebMvcChildContextConfiguration.java | 1 - .../boot/actuate/health/DataSourceHealthIndicator.java | 1 + .../groovy/template/web/GroovyTemplateView.java | 6 ++++-- .../groovy/template/web/GroovyTemplateViewResolver.java | 6 +++++- .../autoconfigure/jackson/JacksonAutoConfiguration.java | 1 + .../autoconfigure/mongo/MongoDataAutoConfiguration.java | 1 + .../social/SocialAutoConfigurerAdapter.java | 2 +- .../boot/loader/tools/JavaExecutable.java | 7 ++++++- .../boot/loader/tools/LogbackInitializer.java | 7 +++++-- .../springframework/boot/loader/tools/RunProcess.java | 3 ++- .../springframework/boot/loader/tools/SignalUtils.java | 9 ++++++++- .../springframework/boot/loader/JavaAgentDetector.java | 2 +- 12 files changed, 35 insertions(+), 11 deletions(-) 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 d390b0f4f2..71356d55d7 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 @@ -105,7 +105,6 @@ public class EndpointWebMvcChildContextConfiguration { @Bean public HandlerAdapter handlerAdapter(HttpMessageConverters converters) { - // TODO: maybe this needs more configuration for non-basic response use cases RequestMappingHandlerAdapter adapter = new RequestMappingHandlerAdapter(); adapter.setMessageConverters(converters.getConverters()); return adapter; diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/DataSourceHealthIndicator.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/DataSourceHealthIndicator.java index 210b2a38c1..0aef1054db 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/DataSourceHealthIndicator.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/DataSourceHealthIndicator.java @@ -34,6 +34,7 @@ import org.springframework.util.StringUtils; * * @author Dave Syer * @author Christian Dupuis + * @since 1.1.0 */ public class DataSourceHealthIndicator extends AbstractHealthIndicator { diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/web/GroovyTemplateView.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/web/GroovyTemplateView.java index 29dff3ebe9..43a2b7d03b 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/web/GroovyTemplateView.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/web/GroovyTemplateView.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. @@ -24,12 +24,14 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.springframework.web.servlet.View; import org.springframework.web.servlet.support.RequestContext; import org.springframework.web.servlet.view.AbstractUrlBasedView; /** - * @author Dave Syer + * Spring MVC {@link View} that can render Groovy templates. * + * @author Dave Syer * @since 1.1.0 */ public class GroovyTemplateView extends AbstractUrlBasedView { diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/web/GroovyTemplateViewResolver.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/web/GroovyTemplateViewResolver.java index d507a8f399..fdeac1877a 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/web/GroovyTemplateViewResolver.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/web/GroovyTemplateViewResolver.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,15 @@ import java.util.Locale; import org.springframework.beans.propertyeditors.LocaleEditor; import org.springframework.core.io.Resource; import org.springframework.web.servlet.View; +import org.springframework.web.servlet.ViewResolver; import org.springframework.web.servlet.view.UrlBasedViewResolver; /** + * Spring MVC {@link ViewResolver} for {@link GroovyTemplateView}s. + * * @author Dave Syer * @since 1.1.0 + * @see GroovyTemplateView */ public class GroovyTemplateViewResolver extends UrlBasedViewResolver { diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration.java index 79e47e804b..d7905cf748 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration.java @@ -112,4 +112,5 @@ public class JacksonAutoConfiguration { } } + } diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoDataAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoDataAutoConfiguration.java index 63e6bbbd6d..1c7a90a3f4 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoDataAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoDataAutoConfiguration.java @@ -46,6 +46,7 @@ import com.mongodb.Mongo; * @author Dave Syer * @author Oliver Gierke * @author Josh Long + * @since 1.1.0 */ @Configuration @ConditionalOnClass({ Mongo.class, MongoTemplate.class }) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/SocialAutoConfigurerAdapter.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/SocialAutoConfigurerAdapter.java index 605a10cda0..a4354c34dc 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/SocialAutoConfigurerAdapter.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/SocialAutoConfigurerAdapter.java @@ -27,8 +27,8 @@ import org.springframework.social.connect.ConnectionFactory; /** * Base class for auto-configured {@link SocialConfigurerAdapter}s. * - * @author Phillip Webb * @author Craig Walls + * @author Phillip Webb * @since 1.1.0 */ @ConditionalOnClass(SocialConfigurerAdapter.class) diff --git a/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JavaExecutable.java b/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JavaExecutable.java index 3720893fe5..66343f6063 100644 --- a/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JavaExecutable.java +++ b/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JavaExecutable.java @@ -27,6 +27,7 @@ import org.springframework.util.StringUtils; * Provides access to the java binary executable, regardless of OS. * * @author Phillip Webb + * @since 1.1.0 */ public class JavaExecutable { @@ -47,7 +48,11 @@ public class JavaExecutable { return command; } - // TODO: is this used? + /** + * Create a new {@link ProcessBuilder} that will run with the Java executable. + * @param arguments the command arguments + * @return a {@link ProcessBuilder} + */ public ProcessBuilder processBuilder(String... arguments) { ProcessBuilder processBuilder = new ProcessBuilder(toString()); processBuilder.command().addAll(Arrays.asList(arguments)); diff --git a/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/LogbackInitializer.java b/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/LogbackInitializer.java index 6dee1986b4..1ab7293109 100644 --- a/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/LogbackInitializer.java +++ b/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/LogbackInitializer.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. @@ -24,9 +24,12 @@ import org.springframework.util.ClassUtils; import ch.qos.logback.classic.Level; /** + * Utility to initialize logback (when present) to use INFO level logging. + * * @author Dave Syer + * @since 1.1.0 */ -public class LogbackInitializer { +public abstract class LogbackInitializer { public static void initialize() { if (ClassUtils.isPresent("org.slf4j.impl.StaticLoggerBinder", null) diff --git a/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/RunProcess.java b/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/RunProcess.java index deb5767bf2..4d3db1c6e8 100644 --- a/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/RunProcess.java +++ b/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/RunProcess.java @@ -26,10 +26,11 @@ import java.util.Collection; import org.springframework.util.ReflectionUtils; /** - * Special utility used to run a process. + * Utility used to run a process. * * @author Phillip Webb * @author Dave Syer + * @since 1.1.0 */ public class RunProcess { diff --git a/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/SignalUtils.java b/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/SignalUtils.java index dd1fd704be..ec8f3790e6 100644 --- a/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/SignalUtils.java +++ b/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/SignalUtils.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. @@ -20,13 +20,20 @@ import sun.misc.Signal; import sun.misc.SignalHandler; /** + * Utilities for working with signal handling. + * * @author Dave Syer + * @since 1.1.0 */ @SuppressWarnings("restriction") public class SignalUtils { private static final Signal SIG_INT = new Signal("INT"); + /** + * Handle {@literal INT} signals by calling the specified {@link Runnable} + * @param runnable the runnable to call on SIGINT. + */ public static void attachSignalHandler(final Runnable runnable) { Signal.handle(SIG_INT, new SignalHandler() { @Override diff --git a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/JavaAgentDetector.java b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/JavaAgentDetector.java index 5c7caede21..42823b6131 100644 --- a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/JavaAgentDetector.java +++ b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/JavaAgentDetector.java @@ -22,7 +22,7 @@ import java.net.URL; * A strategy for detecting Java agents * * @author Andy Wilkinson - * @since 1.1 + * @since 1.1.0 */ public interface JavaAgentDetector {