Polishing

This commit is contained in:
Juergen Hoeller
2019-07-20 17:34:16 +02:00
parent c573eca3d8
commit 529125898a
6 changed files with 85 additions and 61 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2019 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,14 +25,16 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
import org.springframework.util.Assert;
/**
* Cache decorator which synchronizes its {@link #put}, {@link #evict} and {@link #clear}
* operations with Spring-managed transactions (through Spring's {@link TransactionSynchronizationManager},
* performing the actual cache put/evict/clear operation only in the after-commit phase of a
* successful transaction. If no transaction is active, {@link #put}, {@link #evict} and
* Cache decorator which synchronizes its {@link #put}, {@link #evict} and
* {@link #clear} operations with Spring-managed transactions (through Spring's
* {@link TransactionSynchronizationManager}, performing the actual cache
* put/evict/clear operation only in the after-commit phase of a successful
* transaction. If no transaction is active, {@link #put}, {@link #evict} and
* {@link #clear} operations will be performed immediately, as usual.
*
* <p>Use of more aggressive operations such as {@link #putIfAbsent} cannot be deferred
* to the after-commit phase of a running transaction. Use these with care.
* <p><b>Note:</b> Use of immediate operations such as {@link #putIfAbsent}
* cannot be deferred to the after-commit phase of a running transaction.
* Use these with care in a transactional environment.
*
* @author Juergen Hoeller
* @author Stephane Nicoll
@@ -54,6 +56,7 @@ public class TransactionAwareCacheDecorator implements Cache {
this.targetCache = targetCache;
}
/**
* Return the target Cache that this Cache should delegate to.
*/