com.buschmais.xo.impl.cache.CacheSynchronization Maven / Gradle / Ivy
The newest version!
package com.buschmais.xo.impl.cache;
import com.buschmais.xo.api.XOTransaction;
public class CacheSynchronization implements XOTransaction.Synchronization {
private final CacheSynchronizationService cacheSynchronizationService;
public CacheSynchronization(CacheSynchronizationService cacheSynchronizationService) {
this.cacheSynchronizationService = cacheSynchronizationService;
}
@Override
public void beforeCompletion() {
cacheSynchronizationService.flush();
}
@Override
public void afterCompletion(boolean committed) {
cacheSynchronizationService.clear();
}
}