提交 74794190 编写于 作者: J Juergen Hoeller

Implement java.io.Flushable wherever applicable

上级 8b1927f3
/*
* 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();
/**
......
/*
* 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();
}
/*
* 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();
/**
......
/*
* 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.
* <p>After the first flush, headers can no longer be changed.
* Only further content writing and content flushing is possible.
*/
@Override
void flush() throws IOException;
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册