Search in sources :

Example 1 with NonStrictAccessDelegate

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

the class BaseTransactionalDataRegion method createAccessDelegate.

protected synchronized AccessDelegate createAccessDelegate(AccessType accessType) {
    if (accessType == null) {
        throw new IllegalArgumentException();
    }
    if (this.accessType != null && !this.accessType.equals(accessType)) {
        throw new IllegalStateException("This region was already set up for " + this.accessType + ", cannot use using " + accessType);
    }
    this.accessType = accessType;
    CacheMode cacheMode = cache.getCacheConfiguration().clustering().cacheMode();
    if (accessType == AccessType.NONSTRICT_READ_WRITE) {
        prepareForVersionedEntries();
        return new NonStrictAccessDelegate(this);
    }
    if (cacheMode.isDistributed() || cacheMode.isReplicated()) {
        prepareForTombstones();
        return new TombstoneAccessDelegate(this);
    } else {
        prepareForValidation();
        if (cache.getCacheConfiguration().transaction().transactionMode().isTransactional()) {
            return new TxInvalidationCacheAccessDelegate(this, validator);
        } else {
            return new NonTxInvalidationCacheAccessDelegate(this, validator);
        }
    }
}
Also used : NonStrictAccessDelegate(org.hibernate.cache.infinispan.access.NonStrictAccessDelegate) NonTxInvalidationCacheAccessDelegate(org.hibernate.cache.infinispan.access.NonTxInvalidationCacheAccessDelegate) CacheMode(org.infinispan.configuration.cache.CacheMode) NonTxInvalidationCacheAccessDelegate(org.hibernate.cache.infinispan.access.NonTxInvalidationCacheAccessDelegate) TxInvalidationCacheAccessDelegate(org.hibernate.cache.infinispan.access.TxInvalidationCacheAccessDelegate) TombstoneAccessDelegate(org.hibernate.cache.infinispan.access.TombstoneAccessDelegate)

Aggregations

NonStrictAccessDelegate (org.hibernate.cache.infinispan.access.NonStrictAccessDelegate)1 NonTxInvalidationCacheAccessDelegate (org.hibernate.cache.infinispan.access.NonTxInvalidationCacheAccessDelegate)1 TombstoneAccessDelegate (org.hibernate.cache.infinispan.access.TombstoneAccessDelegate)1 TxInvalidationCacheAccessDelegate (org.hibernate.cache.infinispan.access.TxInvalidationCacheAccessDelegate)1 CacheMode (org.infinispan.configuration.cache.CacheMode)1