Add getTargetDataSource to TransactionAwareCacheDecorator
Issue: SPR-15479
This commit is contained in:
parent
333e5c6b01
commit
547c4f69a4
|
|
@ -53,6 +53,12 @@ public class TransactionAwareCacheDecorator implements Cache {
|
||||||
this.targetCache = targetCache;
|
this.targetCache = targetCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the target Cache that this Cache should delegate to.
|
||||||
|
*/
|
||||||
|
public Cache getTargetCache() {
|
||||||
|
return this.targetCache;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,13 @@ public class TransactionAwareCacheDecoratorTests {
|
||||||
new TransactionAwareCacheDecorator(null);
|
new TransactionAwareCacheDecorator(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getTargetCache() {
|
||||||
|
Cache target = new ConcurrentMapCache("testCache");
|
||||||
|
TransactionAwareCacheDecorator cache = new TransactionAwareCacheDecorator(target);
|
||||||
|
assertSame(target, cache.getTargetCache());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void regularOperationsOnTarget() {
|
public void regularOperationsOnTarget() {
|
||||||
Cache target = new ConcurrentMapCache("testCache");
|
Cache target = new ConcurrentMapCache("testCache");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue