diff --git a/spring-tx/src/main/java/org/springframework/transaction/TransactionStatus.java b/spring-tx/src/main/java/org/springframework/transaction/TransactionStatus.java index 54b1f63712..9a3e47df76 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/TransactionStatus.java +++ b/spring-tx/src/main/java/org/springframework/transaction/TransactionStatus.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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.transaction; +import java.io.Flushable; + /** * Representation of the status of a transaction. * @@ -34,7 +36,7 @@ package org.springframework.transaction; * @see org.springframework.transaction.support.TransactionCallback#doInTransaction * @see org.springframework.transaction.interceptor.TransactionInterceptor#currentTransactionStatus() */ -public interface TransactionStatus extends SavepointManager { +public interface TransactionStatus extends SavepointManager, Flushable { /** * Return whether the present transaction is new (else participating @@ -79,6 +81,7 @@ public interface TransactionStatus extends SavepointManager { * Flush the underlying session to the datastore, if applicable: * for example, all affected Hibernate/JPA sessions. */ + @Override void flush(); /** diff --git a/spring-tx/src/main/java/org/springframework/transaction/support/SmartTransactionObject.java b/spring-tx/src/main/java/org/springframework/transaction/support/SmartTransactionObject.java index e646c6ecc0..f4e35d1a59 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/support/SmartTransactionObject.java +++ b/spring-tx/src/main/java/org/springframework/transaction/support/SmartTransactionObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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.transaction.support; +import java.io.Flushable; + /** * Interface to be implemented by transaction objects that are able to * return an internal rollback-only marker, typically from a another @@ -29,7 +31,7 @@ package org.springframework.transaction.support; * @since 1.1 * @see DefaultTransactionStatus#isRollbackOnly */ -public interface SmartTransactionObject { +public interface SmartTransactionObject extends Flushable { /** * Return whether the transaction is internally marked as rollback-only. @@ -43,6 +45,7 @@ public interface SmartTransactionObject { * Flush the underlying sessions to the datastore, if applicable: * for example, all affected Hibernate/JPA sessions. */ + @Override void flush(); } diff --git a/spring-tx/src/main/java/org/springframework/transaction/support/TransactionSynchronization.java b/spring-tx/src/main/java/org/springframework/transaction/support/TransactionSynchronization.java index bfb35698bc..017861d812 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/support/TransactionSynchronization.java +++ b/spring-tx/src/main/java/org/springframework/transaction/support/TransactionSynchronization.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 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.transaction.support; +import java.io.Flushable; + /** * Interface for transaction synchronization callbacks. * Supported by AbstractPlatformTransactionManager. @@ -34,7 +36,7 @@ package org.springframework.transaction.support; * @see org.springframework.jdbc.datasource.DataSourceUtils#CONNECTION_SYNCHRONIZATION_ORDER * @see org.springframework.orm.hibernate3.SessionFactoryUtils#SESSION_SYNCHRONIZATION_ORDER */ -public interface TransactionSynchronization { +public interface TransactionSynchronization extends Flushable { /** Completion status in case of proper commit */ int STATUS_COMMITTED = 0; @@ -65,6 +67,7 @@ public interface TransactionSynchronization { * for example, a Hibernate/JPA session. * @see org.springframework.transaction.TransactionStatus#flush() */ + @Override void flush(); /** 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 7cfe6011f5..4c8964818e 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-2012 the original author or authors. + * Copyright 2002-2013 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,6 +17,7 @@ package org.springframework.http.server; import java.io.Closeable; +import java.io.Flushable; import java.io.IOException; import org.springframework.http.HttpOutputMessage; @@ -28,7 +29,7 @@ import org.springframework.http.HttpStatus; * @author Arjen Poutsma * @since 3.0 */ -public interface ServerHttpResponse extends HttpOutputMessage, Closeable { +public interface ServerHttpResponse extends HttpOutputMessage, Flushable, Closeable { /** * Set the HTTP status code of the response. @@ -37,10 +38,11 @@ public interface ServerHttpResponse extends HttpOutputMessage, Closeable { void setStatusCode(HttpStatus status); /** - * Ensure the headers and the content of the response are written out. After the first - * flush, headers can no longer be changed, only further content writing and flushing - * is possible. + * Ensure that the headers and the content of the response are written out. + *

After the first flush, headers can no longer be changed. + * Only further content writing and content flushing is possible. */ + @Override void flush() throws IOException; /**