Search in sources :

Example 1 with TombstoneCallInterceptor

use of org.hibernate.cache.infinispan.access.TombstoneCallInterceptor in project hibernate-orm by hibernate.

the class BaseTransactionalDataRegion method prepareForTombstones.

private void prepareForTombstones() {
    if (strategy != null) {
        assert strategy == Strategy.TOMBSTONES;
        return;
    }
    Configuration configuration = cache.getCacheConfiguration();
    if (configuration.eviction().maxEntries() >= 0) {
        log.evictionWithTombstones();
    }
    replaceCommonInterceptors();
    replaceExpirationManager();
    cache.removeInterceptor(CallInterceptor.class);
    TombstoneCallInterceptor tombstoneCallInterceptor = new TombstoneCallInterceptor(this);
    cache.getComponentRegistry().registerComponent(tombstoneCallInterceptor, TombstoneCallInterceptor.class);
    List<CommandInterceptor> interceptorChain = cache.getInterceptorChain();
    cache.addInterceptor(tombstoneCallInterceptor, interceptorChain.size());
    strategy = Strategy.TOMBSTONES;
}
Also used : Configuration(org.infinispan.configuration.cache.Configuration) CommandInterceptor(org.infinispan.interceptors.base.CommandInterceptor) TombstoneCallInterceptor(org.hibernate.cache.infinispan.access.TombstoneCallInterceptor)

Aggregations

TombstoneCallInterceptor (org.hibernate.cache.infinispan.access.TombstoneCallInterceptor)1 Configuration (org.infinispan.configuration.cache.Configuration)1 CommandInterceptor (org.infinispan.interceptors.base.CommandInterceptor)1