Implement java.io.Flushable wherever applicable

This commit is contained in:
Juergen Hoeller
2013-10-14 23:52:31 +02:00
parent 8b1927f3ec
commit 74794190a5
4 changed files with 22 additions and 11 deletions

View File

@@ -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();
/**

View File

@@ -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();
}

View File

@@ -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();
/**