From ea95da126af330863eb6b0431e86d3819bc97632 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 8 Nov 2012 23:44:49 +0100 Subject: [PATCH] Implement java.io.Closeable where appropriate Issue: SPR-9962 --- .../context/ConfigurableApplicationContext.java | 6 ++++-- .../org/springframework/jdbc/support/lob/LobCreator.java | 5 +++-- .../org/springframework/http/client/ClientHttpResponse.java | 3 ++- .../org/springframework/http/server/ServerHttpResponse.java | 6 ++++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/context/ConfigurableApplicationContext.java b/spring-context/src/main/java/org/springframework/context/ConfigurableApplicationContext.java index fa57b64cb5..264d9b569e 100644 --- a/spring-context/src/main/java/org/springframework/context/ConfigurableApplicationContext.java +++ b/spring-context/src/main/java/org/springframework/context/ConfigurableApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. @@ -16,6 +16,8 @@ package org.springframework.context; +import java.io.Closeable; + import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.BeanFactoryPostProcessor; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; @@ -36,7 +38,7 @@ import org.springframework.core.env.Environment; * @author Chris Beams * @since 03.11.2003 */ -public interface ConfigurableApplicationContext extends ApplicationContext, Lifecycle { +public interface ConfigurableApplicationContext extends ApplicationContext, Lifecycle, Closeable { /** * Any number of these characters are considered delimiters between diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/LobCreator.java b/spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/LobCreator.java index be54c09684..05085a5b63 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/LobCreator.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/LobCreator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2012 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. @@ -16,6 +16,7 @@ package org.springframework.jdbc.support.lob; +import java.io.Closeable; import java.io.InputStream; import java.io.Reader; import java.sql.PreparedStatement; @@ -56,7 +57,7 @@ import java.sql.SQLException; * @see java.sql.PreparedStatement#setAsciiStream * @see java.sql.PreparedStatement#setCharacterStream */ -public interface LobCreator { +public interface LobCreator extends Closeable { /** * Set the given content as bytes on the given statement, using the given diff --git a/spring-web/src/main/java/org/springframework/http/client/ClientHttpResponse.java b/spring-web/src/main/java/org/springframework/http/client/ClientHttpResponse.java index 38aea117c7..301e4645d9 100644 --- a/spring-web/src/main/java/org/springframework/http/client/ClientHttpResponse.java +++ b/spring-web/src/main/java/org/springframework/http/client/ClientHttpResponse.java @@ -16,6 +16,7 @@ package org.springframework.http.client; +import java.io.Closeable; import java.io.IOException; import org.springframework.http.HttpInputMessage; @@ -30,7 +31,7 @@ import org.springframework.http.HttpStatus; * @author Arjen Poutsma * @since 3.0 */ -public interface ClientHttpResponse extends HttpInputMessage { +public interface ClientHttpResponse extends HttpInputMessage, Closeable { /** * Return the HTTP status code of the response. diff --git a/spring-web/src/main/java/org/springframework/http/server/ServerHttpResponse.java b/spring-web/src/main/java/org/springframework/http/server/ServerHttpResponse.java index 778fe84ab1..8ce306271f 100644 --- a/spring-web/src/main/java/org/springframework/http/server/ServerHttpResponse.java +++ b/spring-web/src/main/java/org/springframework/http/server/ServerHttpResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2012 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. @@ -16,6 +16,8 @@ package org.springframework.http.server; +import java.io.Closeable; + import org.springframework.http.HttpOutputMessage; import org.springframework.http.HttpStatus; @@ -25,7 +27,7 @@ import org.springframework.http.HttpStatus; * @author Arjen Poutsma * @since 3.0 */ -public interface ServerHttpResponse extends HttpOutputMessage { +public interface ServerHttpResponse extends HttpOutputMessage, Closeable { /** * Set the HTTP status code of the response.