org.hibernate.cache.spi.access.AccessType - java examples

Here are the examples of the java api org.hibernate.cache.spi.access.AccessType taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

80 Examples 7

19 View Complete Implementation : HibernateRegionFactory.java
Copyright Apache License 2.0
Author : apache
/**
 * Hibernate L2 cache region factory.
 * <p>
 * Following Hibernate settings should be specified to enable second level cache and to use this
 * region factory for caching:
 * <pre name="code" clreplaced="brush: xml; gutter: false;">
 * hibernate.cache.use_second_level_cache=true
 * hibernate.cache.region.factory_clreplaced=org.apache.ignite.cache.hibernate.HibernateRegionFactory
 * </pre>
 * Note that before region factory is started you need to start properly configured Ignite node in the same JVM.
 * For example to start Ignite node one of loader provided in {@code org.apache.ignite.grid.startup} package can be used.
 * <p>
 * Name of Ignite instance to be used for region factory must be specified as following Hibernate property:
 * <pre name="code" clreplaced="brush: xml; gutter: false;">
 * org.apache.ignite.hibernate.ignite_instance_name=<Ignite instance name>
 * </pre>
 * Each Hibernate cache region must be replacedociated with some {@link IgniteInternalCache}, by default it is replacedumed that
 * for each cache region there is a {@link IgniteInternalCache} with the same name. Also it is possible to define
 * region to cache mapping using properties with prefix {@code org.apache.ignite.hibernate.region_cache}.
 * For example if for region with name "region1" cache with name "cache1" should be used then following
 * Hibernate property should be specified:
 * <pre name="code" clreplaced="brush: xml; gutter: false;">
 * org.apache.ignite.hibernate.region_cache.region1=cache1
 * </pre>
 */
public clreplaced HibernateRegionFactory implements RegionFactory {

    /**
     */
    private static final long serialVersionUID = 0L;

    /**
     */
    static final HibernateExceptionConverter EXCEPTION_CONVERTER = new HibernateExceptionConverter() {

        @Override
        public RuntimeException convert(Exception e) {
            return new CacheException(e);
        }
    };

    /**
     * Default region access type.
     */
    private AccessType dfltAccessType;

    /**
     * Key transformer.
     */
    private final HibernateKeyTransformer hibernate4transformer = new HibernateKeyTransformer() {

        @Override
        public Object transform(Object key) {
            return key;
        }
    };

    /**
     */
    private final HibernateAccessStrategyFactory accessStgyFactory = new HibernateAccessStrategyFactory(hibernate4transformer, EXCEPTION_CONVERTER);

    /**
     * {@inheritDoc}
     */
    @Override
    public void start(SessionFactoryOptions settings, Properties props) throws CacheException {
        String accessType = props.getProperty(DFLT_ACCESS_TYPE_PROPERTY, NONSTRICT_READ_WRITE.name());
        dfltAccessType = AccessType.valueOf(accessType);
        accessStgyFactory.start(props);
    }

    /**
     * @return Access strategy factory.
     */
    HibernateAccessStrategyFactory accessStrategyFactory() {
        return accessStgyFactory;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void stop() {
    // No-op.
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isMinimalPutsEnabledByDefault() {
        return false;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public AccessType getDefaultAccessType() {
        return dfltAccessType;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public long nextTimestamp() {
        return System.currentTimeMillis();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public EnreplacedyRegion buildEnreplacedyRegion(String regionName, Properties props, CacheDataDescription metadata) throws CacheException {
        return new HibernateEnreplacedyRegion(this, regionName, accessStgyFactory.node(), accessStgyFactory.regionCache(regionName), metadata);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public NaturalIdRegion buildNaturalIdRegion(String regionName, Properties props, CacheDataDescription metadata) throws CacheException {
        return new HibernateNaturalIdRegion(this, regionName, accessStgyFactory.node(), accessStgyFactory.regionCache(regionName), metadata);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public CollectionRegion buildCollectionRegion(String regionName, Properties props, CacheDataDescription metadata) throws CacheException {
        return new HibernateCollectionRegion(this, regionName, accessStgyFactory.node(), accessStgyFactory.regionCache(regionName), metadata);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public QueryResultsRegion buildQueryResultsRegion(String regionName, Properties props) throws CacheException {
        return new HibernateQueryResultsRegion(this, regionName, accessStgyFactory.node(), accessStgyFactory.regionCache(regionName));
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public TimestampsRegion buildTimestampsRegion(String regionName, Properties props) throws CacheException {
        return new HibernateTimestampsRegion(this, regionName, accessStgyFactory.node(), accessStgyFactory.regionCache(regionName));
    }
}

19 View Complete Implementation : BaseTransactionalDataRegion.java
Copyright Apache License 2.0
Author : infinispan
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(cacheMode);
        return new NonStrictAccessDelegate(this, getCacheDataDescription().getVersionComparator());
    }
    if (cacheMode.isDistributed() || cacheMode.isReplicated()) {
        prepareForTombstones(cacheMode);
        return new TombstoneAccessDelegate(this);
    } else {
        prepareForValidation();
        if (cache.getCacheConfiguration().transaction().transactionMode().isTransactional()) {
            return new TxInvalidationCacheAccessDelegate(this, validator);
        } else {
            return new NonTxInvalidationCacheAccessDelegate(this, validator);
        }
    }
}

19 View Complete Implementation : HibernateRegionFactory.java
Copyright Apache License 2.0
Author : apache
/**
 * Hibernate L2 cache region factory.
 * <p>
 * Following Hibernate settings should be specified to enable second level cache and to use this
 * region factory for caching:
 * <pre name="code" clreplaced="brush: xml; gutter: false;">
 * hibernate.cache.use_second_level_cache=true
 * hibernate.cache.region.factory_clreplaced=org.apache.ignite.cache.hibernate.HibernateRegionFactory
 * </pre>
 * Note that before region factory is started you need to start properly configured Ignite node in the same JVM.
 * For example to start Ignite node one of loader provided in {@code org.apache.ignite.grid.startup} package can be used.
 * <p>
 * Name of Ignite instance to be used for region factory must be specified as following Hibernate property:
 * <pre name="code" clreplaced="brush: xml; gutter: false;">
 * org.apache.ignite.hibernate.ignite_instance_name=<Ignite instance name>
 * </pre>
 * Each Hibernate cache region must be replacedociated with some {@link IgniteInternalCache}, by default it is replacedumed that
 * for each cache region there is a {@link IgniteInternalCache} with the same name. Also it is possible to define
 * region to cache mapping using properties with prefix {@code org.apache.ignite.hibernate.region_cache}.
 * For example if for region with name "region1" cache with name "cache1" should be used then following
 * Hibernate property should be specified:
 * <pre name="code" clreplaced="brush: xml; gutter: false;">
 * org.apache.ignite.hibernate.region_cache.region1=cache1
 * </pre>
 */
public clreplaced HibernateRegionFactory implements RegionFactory {

    /**
     */
    private static final long serialVersionUID = 0L;

    /**
     */
    static final HibernateExceptionConverter EXCEPTION_CONVERTER = new HibernateExceptionConverter() {

        @Override
        public RuntimeException convert(Exception e) {
            return new CacheException(e);
        }
    };

    /**
     * Default region access type.
     */
    private AccessType dfltAccessType;

    /**
     * Key transformer.
     */
    private final HibernateKeyTransformer hibernate4transformer = new HibernateKeyTransformer() {

        @Override
        public Object transform(Object key) {
            return key;
        }
    };

    /**
     */
    private final HibernateAccessStrategyFactory accessStgyFactory = new HibernateAccessStrategyFactory(hibernate4transformer, EXCEPTION_CONVERTER);

    /**
     */
    private SessionFactoryOptions options;

    /**
     * {@inheritDoc}
     */
    @Override
    public void start(SessionFactoryOptions options, Map cfgValues) throws CacheException {
        this.options = options;
        String accessType = cfgValues.getOrDefault(DFLT_ACCESS_TYPE_PROPERTY, NONSTRICT_READ_WRITE.name()).toString();
        dfltAccessType = AccessType.valueOf(accessType);
        accessStgyFactory.start(cfgValues);
    }

    /**
     * @return Access strategy factory.
     */
    HibernateAccessStrategyFactory accessStrategyFactory() {
        return accessStgyFactory;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void stop() {
    // No-op.
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isMinimalPutsEnabledByDefault() {
        return false;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public AccessType getDefaultAccessType() {
        return dfltAccessType;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public long nextTimestamp() {
        return Instant.now().toEpochMilli();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String qualify(String regionName) {
        return RegionNameQualifier.INSTANCE.qualify(regionName, options);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public DomainDataRegion buildDomainDataRegion(DomainDataRegionConfig regionCfg, DomainDataRegionBuildingContext buildingCtx) {
        return new IgniteDomainDataRegion(regionCfg, this, null, buildingCtx, accessStgyFactory);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public QueryResultsRegion buildQueryResultsRegion(String regionName, SessionFactoryImplementor sessFactory) {
        return new IgniteQueryResultsRegion(this, regionName, accessStgyFactory.node(), accessStgyFactory.regionCache(regionName));
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public TimestampsRegion buildTimestampsRegion(String regionName, SessionFactoryImplementor sessFactory) {
        return new IgniteTimestampsRegion(this, regionName, accessStgyFactory.node(), accessStgyFactory.regionCache(regionName));
    }
}

19 View Complete Implementation : HibernateTransactionalDataRegion.java
Copyright Apache License 2.0
Author : apache
/**
 * @param accessType Hibernate L2 cache access type.
 * @return Access strategy for given access type.
 */
HibernateAccessStrategyAdapter createAccessStrategy(AccessType accessType) {
    switch(accessType) {
        case READ_ONLY:
            return factory.accessStrategyFactory().createReadOnlyStrategy(cache);
        case NONSTRICT_READ_WRITE:
            return factory.accessStrategyFactory().createNonStrictReadWriteStrategy(cache);
        case READ_WRITE:
            return factory.accessStrategyFactory().createReadWriteStrategy(cache);
        case TRANSACTIONAL:
            return factory.accessStrategyFactory().createTransactionalStrategy(cache);
        default:
            throw new IllegalArgumentException("Unknown Hibernate access type: " + accessType);
    }
}

19 View Complete Implementation : DomainDataRegionImpl.java
Copyright Apache License 2.0
Author : infinispan
private synchronized AccessDelegate createAccessDelegate(AccessType accessType, Comparator<Object> comparator) {
    CacheMode cacheMode = cache.getCacheConfiguration().clustering().cacheMode();
    if (accessType == AccessType.NONSTRICT_READ_WRITE) {
        prepareForVersionedEntries(cacheMode);
        return new NonStrictAccessDelegate(this, comparator);
    }
    if (cacheMode.isDistributed() || cacheMode.isReplicated()) {
        prepareForTombstones(cacheMode);
        return new TombstoneAccessDelegate(this);
    } else {
        prepareForValidation();
        return new NonTxInvalidationCacheAccessDelegate(this, validator);
    }
}

19 View Complete Implementation : IgniteNaturalIdDataAccess.java
Copyright Apache License 2.0
Author : apache
/**
 * Implementation of contract for managing transactional and concurrent access to cached naturalId data.
 */
public clreplaced IgniteNaturalIdDataAccess extends IgniteCachedDomainDataAccess implements NaturalIdDataAccess {

    /**
     * Strategy access type.
     */
    private final AccessType accessType;

    /**
     */
    public IgniteNaturalIdDataAccess(HibernateAccessStrategyAdapter stgy, AccessType accessType, RegionFactory regionFactory, DomainDataRegion domainDataRegion, Ignite ignite, HibernateCacheProxy cache) {
        super(stgy, regionFactory, domainDataRegion, ignite, cache);
        this.accessType = accessType;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public AccessType getAccessType() {
        return accessType;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Object generateCacheKey(Object[] naturalIdValues, EnreplacedyPersister persister, SharedSessionContractImplementor ses) {
        return DefaultCacheKeysFactory.staticCreateNaturalIdKey(naturalIdValues, persister, ses);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Object[] getNaturalIdValues(Object cacheKey) {
        return DefaultCacheKeysFactory.staticGetNaturalIdValues(cacheKey);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean insert(SharedSessionContractImplementor ses, Object key, Object val) throws CacheException {
        return stgy.insert(key, val);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean afterInsert(SharedSessionContractImplementor ses, Object key, Object val) throws CacheException {
        return stgy.afterInsert(key, val);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean update(SharedSessionContractImplementor ses, Object key, Object val) throws CacheException {
        return stgy.update(key, val);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean afterUpdate(SharedSessionContractImplementor ses, Object key, Object val, SoftLock lock) throws CacheException {
        return stgy.afterUpdate(key, val);
    }
}

19 View Complete Implementation : BaseRegion.java
Copyright Apache License 2.0
Author : infinispan
protected void checkAccessType(AccessType accessType) {
    if (accessType == AccessType.TRANSACTIONAL && !cache.getCacheConfiguration().transaction().transactionMode().isTransactional()) {
        log.transactionalStrategyNonTransactionalCache();
    } else if (accessType == AccessType.READ_WRITE && cache.getCacheConfiguration().transaction().transactionMode().isTransactional()) {
        log.readWriteStrategyTransactionalCache();
    }
}

19 View Complete Implementation : NodeEnvironment.java
Copyright Apache License 2.0
Author : infinispan
private InfinispanBaseRegion buildAndStoreCollectionRegion(String name, AccessType accessType) {
    return regionFactory.buildCollectionRegion(name, accessType);
}

19 View Complete Implementation : AbstractAccess.java
Copyright Apache License 2.0
Author : infinispan
/**
 * Collection region access for Infinispan.
 *
 * @author Chris Bredesen
 * @author Galder Zamarreño
 * @since 3.5
 */
abstract clreplaced AbstractAccess {

    private final AccessType accessType;

    final AccessDelegate delegate;

    final DomainDataRegionImpl region;

    AbstractAccess(AccessType accessType, AccessDelegate delegate, DomainDataRegionImpl region) {
        this.accessType = accessType;
        this.delegate = delegate;
        this.region = region;
    }

    public void evict(Object key) throws CacheException {
        delegate.evict(key);
    }

    public void evictAll() throws CacheException {
        delegate.evictAll();
    }

    public void removeAll(SharedSessionContractImplementor session) throws CacheException {
        delegate.removeAll();
    }

    public SoftLock lockRegion() throws CacheException {
        return null;
    }

    public void unlockRegion(SoftLock lock) throws CacheException {
    }

    public AccessType getAccessType() {
        return accessType;
    }

    public DomainDataRegion getRegion() {
        return region;
    }

    public boolean contains(Object key) {
        return delegate.get(null, key, Long.MAX_VALUE) != null;
    }
}

19 View Complete Implementation : HibernateRegionFactory.java
Copyright Apache License 2.0
Author : apache
/**
 * Hibernate L2 cache region factory.
 * <p>
 * Following Hibernate settings should be specified to enable second level cache and to use this
 * region factory for caching:
 * <pre name="code" clreplaced="brush: xml; gutter: false;">
 * hibernate.cache.use_second_level_cache=true
 * hibernate.cache.region.factory_clreplaced=org.apache.ignite.cache.hibernate.HibernateRegionFactory
 * </pre>
 * Note that before region factory is started you need to start properly configured Ignite node in the same JVM.
 * For example to start Ignite node one of loader provided in {@code org.apache.ignite.grid.startup} package can be used.
 * <p>
 * Name of Ignite instance to be used for region factory must be specified as following Hibernate property:
 * <pre name="code" clreplaced="brush: xml; gutter: false;">
 * org.apache.ignite.hibernate.ignite_instance_name=<Ignite instance name>
 * </pre>
 * Each Hibernate cache region must be replacedociated with some {@link IgniteInternalCache}, by default it is replacedumed that
 * for each cache region there is a {@link IgniteInternalCache} with the same name. Also it is possible to define
 * region to cache mapping using properties with prefix {@code org.apache.ignite.hibernate.region_cache}.
 * For example if for region with name "region1" cache with name "cache1" should be used then following
 * Hibernate property should be specified:
 * <pre name="code" clreplaced="brush: xml; gutter: false;">
 * org.apache.ignite.hibernate.region_cache.region1=cache1
 * </pre>
 */
public clreplaced HibernateRegionFactory implements RegionFactory {

    /**
     */
    private static final long serialVersionUID = 0L;

    /**
     */
    static final HibernateExceptionConverter EXCEPTION_CONVERTER = new HibernateExceptionConverter() {

        @Override
        public RuntimeException convert(Exception e) {
            return new CacheException(e);
        }
    };

    /**
     * Default region access type.
     */
    private AccessType dfltAccessType;

    /**
     * Key transformer.
     */
    private final HibernateKeyTransformer hibernate4transformer = new HibernateKeyTransformer() {

        @Override
        public Object transform(Object key) {
            if (key instanceof CacheKey) {
                CacheKey cacheKey = (CacheKey) key;
                return new HibernateKeyWrapper(cacheKey.getKey(), cacheKey.getEnreplacedyOrRoleName(), cacheKey.getTenantId());
            }
            return key;
        }
    };

    /**
     */
    private final HibernateAccessStrategyFactory accessStgyFactory = new HibernateAccessStrategyFactory(hibernate4transformer, EXCEPTION_CONVERTER);

    /**
     * {@inheritDoc}
     */
    @Override
    public void start(Settings settings, Properties props) throws CacheException {
        String accessType = props.getProperty(DFLT_ACCESS_TYPE_PROPERTY, NONSTRICT_READ_WRITE.name());
        dfltAccessType = AccessType.valueOf(accessType);
        accessStgyFactory.start(props);
    }

    /**
     * @return Access strategy factory.
     */
    HibernateAccessStrategyFactory accessStrategyFactory() {
        return accessStgyFactory;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void stop() {
    // No-op.
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isMinimalPutsEnabledByDefault() {
        return false;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public AccessType getDefaultAccessType() {
        return dfltAccessType;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public long nextTimestamp() {
        return System.currentTimeMillis();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public EnreplacedyRegion buildEnreplacedyRegion(String regionName, Properties props, CacheDataDescription metadata) throws CacheException {
        return new HibernateEnreplacedyRegion(this, regionName, accessStgyFactory.node(), accessStgyFactory.regionCache(regionName), metadata);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public NaturalIdRegion buildNaturalIdRegion(String regionName, Properties props, CacheDataDescription metadata) throws CacheException {
        return new HibernateNaturalIdRegion(this, regionName, accessStgyFactory.node(), accessStgyFactory.regionCache(regionName), metadata);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public CollectionRegion buildCollectionRegion(String regionName, Properties props, CacheDataDescription metadata) throws CacheException {
        return new HibernateCollectionRegion(this, regionName, accessStgyFactory.node(), accessStgyFactory.regionCache(regionName), metadata);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public QueryResultsRegion buildQueryResultsRegion(String regionName, Properties props) throws CacheException {
        return new HibernateQueryResultsRegion(this, regionName, accessStgyFactory.node(), accessStgyFactory.regionCache(regionName));
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public TimestampsRegion buildTimestampsRegion(String regionName, Properties props) throws CacheException {
        return new HibernateTimestampsRegion(this, regionName, accessStgyFactory.node(), accessStgyFactory.regionCache(regionName));
    }
}

19 View Complete Implementation : IgniteCollectionDataAccess.java
Copyright Apache License 2.0
Author : apache
/**
 * Implementation of {@link CollectionDataAccess} contract for managing transactional and concurrent
 * L2 cache access to cached collection data.
 */
public clreplaced IgniteCollectionDataAccess extends IgniteCachedDomainDataAccess implements CollectionDataAccess {

    /**
     * Access strategiy type.
     */
    private final AccessType accessType;

    /**
     * @param stgy Access strategy implementation.
     * @param accessType Strategy access type.
     * @param regionFactory Region factory.
     * @param domainDataRegion Data region.
     * @param ignite Ignite instance.
     * @param cache Cache proxy.
     */
    public IgniteCollectionDataAccess(HibernateAccessStrategyAdapter stgy, AccessType accessType, RegionFactory regionFactory, DomainDataRegion domainDataRegion, Ignite ignite, HibernateCacheProxy cache) {
        super(stgy, regionFactory, domainDataRegion, ignite, cache);
        this.accessType = accessType;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public AccessType getAccessType() {
        return accessType;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Object generateCacheKey(Object id, CollectionPersister persister, SessionFactoryImplementor factory, String tenantIdentifier) {
        return HibernateKeyWrapper.staticCreateCollectionKey(id, persister, tenantIdentifier);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Object getCacheKeyId(Object cacheKey) {
        return ((HibernateKeyWrapper) cacheKey).id();
    }
}

19 View Complete Implementation : HibernateL2CacheStrategySelfTest.java
Copyright Apache License 2.0
Author : apache
/**
 * @throws Exception If failed.
 */
@Test
public void testEnreplacedyCacheReadWrite() throws Exception {
    for (AccessType accessType : new AccessType[] { AccessType.READ_WRITE, AccessType.NONSTRICT_READ_WRITE }) testEnreplacedyCacheReadWrite(accessType);
}

19 View Complete Implementation : IgniteEntityDataAccess.java
Copyright Apache License 2.0
Author : apache
/**
 * Implementation of contract for managing transactional and concurrent access to cached enreplacedy data.
 */
public clreplaced IgniteEnreplacedyDataAccess extends IgniteCachedDomainDataAccess implements EnreplacedyDataAccess {

    /**
     * Strategy access type.
     */
    private final AccessType accessType;

    /**
     */
    public IgniteEnreplacedyDataAccess(HibernateAccessStrategyAdapter stgy, AccessType accessType, RegionFactory regionFactory, DomainDataRegion domainDataRegion, Ignite ignite, HibernateCacheProxy cache) {
        super(stgy, regionFactory, domainDataRegion, ignite, cache);
        this.accessType = accessType;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Object generateCacheKey(Object id, EnreplacedyPersister persister, SessionFactoryImplementor factory, String tenantIdentifier) {
        return HibernateKeyWrapper.staticCreateEnreplacedyKey(id, persister, tenantIdentifier);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Object getCacheKeyId(Object cacheKey) {
        return ((HibernateKeyWrapper) cacheKey).id();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean insert(SharedSessionContractImplementor ses, Object key, Object val, Object ver) {
        return stgy.insert(key, val);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean afterInsert(SharedSessionContractImplementor ses, Object key, Object val, Object ver) {
        return stgy.afterInsert(key, val);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean update(SharedSessionContractImplementor ses, Object key, Object val, Object curVer, Object prevVer) {
        return stgy.update(key, val);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean afterUpdate(SharedSessionContractImplementor ses, Object key, Object val, Object curVer, Object prevVer, SoftLock lock) {
        return stgy.afterUpdate(key, val);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public AccessType getAccessType() {
        return accessType;
    }
}

18 View Complete Implementation : EntityMemcachedRegion.java
Copyright Apache License 2.0
Author : kwon37xi
@Override
public EnreplacedyRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    switch(accessType) {
        case READ_ONLY:
            return new ReadOnlyEnreplacedyRegionAccessStrategy(this);
        case NONSTRICT_READ_WRITE:
            return new NonstrictReadWriteEnreplacedyRegionAccessStrategy(this);
        default:
            throw new CacheException("Unsupported access strategy : " + accessType + ".");
    }
}

18 View Complete Implementation : HibernateL2CacheStrategySelfTest.java
Copyright Apache License 2.0
Author : apache
/**
 * @param accessType Cache access type.
 * @param igniteInstanceName Ignite instance name.
 * @return Hibernate configuration.
 */
private Configuration hibernateConfiguration(AccessType accessType, String igniteInstanceName) {
    Configuration cfg = new Configuration();
    cfg.addAnnotatedClreplaced(Enreplacedy1.clreplaced);
    cfg.addAnnotatedClreplaced(Enreplacedy2.clreplaced);
    cfg.addAnnotatedClreplaced(Enreplacedy3.clreplaced);
    cfg.addAnnotatedClreplaced(Enreplacedy4.clreplaced);
    cfg.setCacheConcurrencyStrategy(ENreplacedY1_NAME, accessType.getExternalName());
    cfg.setCacheConcurrencyStrategy(ENreplacedY2_NAME, accessType.getExternalName());
    cfg.setCacheConcurrencyStrategy(ENreplacedY3_NAME, accessType.getExternalName());
    cfg.setCacheConcurrencyStrategy(ENreplacedY4_NAME, accessType.getExternalName());
    cfg.setProperty(DFLT_ACCESS_TYPE_PROPERTY, accessType.name());
    cfg.setProperty(HBM2DDL_AUTO, "create");
    cfg.setProperty(GENERATE_STATISTICS, "true");
    cfg.setProperty(USE_SECOND_LEVEL_CACHE, "true");
    cfg.setProperty(USE_QUERY_CACHE, "true");
    cfg.setProperty(CACHE_REGION_FACTORY, HibernateRegionFactory.clreplaced.getName());
    cfg.setProperty(RELEASE_CONNECTIONS, "on_close");
    cfg.setProperty(USE_STRUCTURED_CACHE, "true");
    cfg.setProperty(IGNITE_INSTANCE_NAME_PROPERTY, igniteInstanceName);
    cfg.setProperty(REGION_CACHE_PROPERTY + ENreplacedY1_NAME, "cache1");
    cfg.setProperty(REGION_CACHE_PROPERTY + ENreplacedY2_NAME, "cache2");
    cfg.setProperty(REGION_CACHE_PROPERTY + TIMESTAMP_CACHE, TIMESTAMP_CACHE);
    cfg.setProperty(REGION_CACHE_PROPERTY + QUERY_CACHE, QUERY_CACHE);
    return cfg;
}

18 View Complete Implementation : CollectionRegionImpl.java
Copyright Apache License 2.0
Author : kwon37xi
@Override
public CollectionRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    switch(accessType) {
        case READ_ONLY:
            if (getCacheDataDescription().isMutable()) {
                LOG.warnf("read-only cache configured for mutable collection [ %s ]", getName());
            }
            return new ReadOnlyCollectionRegionAccessStrategy(this);
        case READ_WRITE:
            return new ReadWriteCollectionRegionAccessStrategy(this);
        case NONSTRICT_READ_WRITE:
            return new NonstrictReadWriteCollectionRegionAccessStrategy(this);
        case TRANSACTIONAL:
            return new TransactionalCollectionRegionAccessStrategy(this);
        // throw new UnsupportedOperationException( "doesn't support this access strategy" );
        default:
            throw new IllegalArgumentException("unrecognized access strategy type [" + accessType + "]");
    }
}

18 View Complete Implementation : HibernateL2CacheStrategySelfTest.java
Copyright Apache License 2.0
Author : apache
/**
 * @param accessType Cache access typr.
 * @param igniteInstanceName Name of the grid providing caches.
 * @return Session factory.
 */
private SessionFactory startHibernate(AccessType accessType, String igniteInstanceName) {
    Configuration cfg = hibernateConfiguration(accessType, igniteInstanceName);
    ServiceRegistryBuilder builder = new ServiceRegistryBuilder();
    builder.applySetting("hibernate.connection.url", CONNECTION_URL);
    builder.applySetting("hibernate.show_sql", false);
    return cfg.buildSessionFactory(builder.buildServiceRegistry());
}

18 View Complete Implementation : NaturalIdRegionImpl.java
Copyright Apache License 2.0
Author : kwon37xi
@Override
public NaturalIdRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    switch(accessType) {
        case READ_ONLY:
            if (getCacheDataDescription().isMutable()) {
                LOG.warnf("read-only cache configured for mutable collection [ %s ]", getName());
            }
            return new ReadOnlyNaturalIdRegionAccessStrategy(this);
        case READ_WRITE:
            return new ReadWriteNaturalIdRegionAccessStrategy(this);
        case NONSTRICT_READ_WRITE:
            return new NonstrictReadWriteNaturalIdRegionAccessStrategy(this);
        case TRANSACTIONAL:
            return new TransactionalNaturalIdRegionAccessStrategy(this);
        // throw new UnsupportedOperationException( "doesn't support this access strategy" );
        default:
            throw new IllegalArgumentException("unrecognized access strategy type [" + accessType + "]");
    }
}

18 View Complete Implementation : IgniteDomainDataRegion.java
Copyright Apache License 2.0
Author : apache
/**
 * {@inheritDoc}
 */
@Override
protected NaturalIdDataAccess generateNaturalIdAccess(NaturalIdDataCachingConfig naturalIdAccessCfg) {
    HibernateCacheProxy cache = stgyFactory.regionCache(getName());
    AccessType accessType = naturalIdAccessCfg.getAccessType();
    Ignite ignite = stgyFactory.node();
    switch(accessType) {
        case READ_ONLY:
            HibernateAccessStrategyAdapter readOnlyStgy = stgyFactory.createReadOnlyStrategy(cache);
            return new IgniteNaturalIdDataAccess(readOnlyStgy, accessType, getRegionFactory(), this, ignite, cache);
        case NONSTRICT_READ_WRITE:
            HibernateAccessStrategyAdapter nonStrictReadWriteStgy = stgyFactory.createNonStrictReadWriteStrategy(cache);
            return new IgniteNaturalIdDataAccess(nonStrictReadWriteStgy, accessType, getRegionFactory(), this, ignite, cache);
        case READ_WRITE:
            HibernateAccessStrategyAdapter readWriteStgy = stgyFactory.createReadWriteStrategy(cache);
            return new IgniteNaturalIdDataAccess(readWriteStgy, accessType, getRegionFactory(), this, ignite, cache);
        case TRANSACTIONAL:
            HibernateAccessStrategyAdapter transactionalStgy = stgyFactory.createTransactionalStrategy(cache);
            return new IgniteNaturalIdDataAccess(transactionalStgy, accessType, getRegionFactory(), this, ignite, cache);
        default:
            throw new IllegalArgumentException("Unknown Hibernate access type: " + accessType);
    }
}

18 View Complete Implementation : RedisCollectionRegion.java
Copyright Apache License 2.0
Author : debop
@Override
public CollectionRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    return getAccessStrategyFactory().createCollectionRegionAccessStrategy(this, accessType);
}

18 View Complete Implementation : RedisEntityRegion.java
Copyright Apache License 2.0
Author : debop
@Override
public EnreplacedyRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    return getAccessStrategyFactory().createEnreplacedyRegionAccessStrategy(this, accessType);
}

18 View Complete Implementation : RedisNaturalIdRegion.java
Copyright Apache License 2.0
Author : debop
@Override
public NaturalIdRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    return getAccessStrategyFactory().createNaturalIdRegionAccessStrategy(this, accessType);
}

18 View Complete Implementation : RedisCollectionRegion.java
Copyright Apache License 2.0
Author : debop
@Override
public CollectionRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    return accessStrategyFactory.createCollectionRegionAccessStrategy(this, accessType);
}

18 View Complete Implementation : RedisEntityRegion.java
Copyright Apache License 2.0
Author : debop
@Override
public EnreplacedyRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    return accessStrategyFactory.createEnreplacedyRegionAccessStrategy(this, accessType);
}

18 View Complete Implementation : RedisNaturalIdRegion.java
Copyright Apache License 2.0
Author : debop
@Override
public NaturalIdRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    return accessStrategyFactory.createNaturalIdRegionAccessStrategy(this, accessType);
}

18 View Complete Implementation : CollectionRegionImpl.java
Copyright Apache License 2.0
Author : infinispan
@Override
public CollectionRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    checkAccessType(accessType);
    AccessDelegate accessDelegate = createAccessDelegate(accessType);
    return new CollectionAccess(this, accessDelegate);
}

18 View Complete Implementation : EntityRegionImpl.java
Copyright Apache License 2.0
Author : infinispan
@Override
public EnreplacedyRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    checkAccessType(accessType);
    AccessDelegate accessDelegate = createAccessDelegate(accessType);
    if (accessType == AccessType.READ_ONLY || !getCacheDataDescription().isMutable()) {
        return new ReadOnlyAccess(this, accessDelegate);
    } else {
        return new ReadWriteAccess(this, accessDelegate);
    }
}

18 View Complete Implementation : CollectionMemcachedRegion.java
Copyright Apache License 2.0
Author : kwon37xi
@Override
public CollectionRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    switch(accessType) {
        case READ_ONLY:
            return new ReadOnlyCollectionRegionAccessStrategy(this);
        case NONSTRICT_READ_WRITE:
            return new NonstrictReadWriteCollectionRegionAccessStrategy(this);
        default:
            throw new CacheException("Unsupported access strategy : " + accessType + ".");
    }
}

18 View Complete Implementation : HibernateNaturalIdRegion.java
Copyright Apache License 2.0
Author : apache
/**
 * {@inheritDoc}
 */
@Override
public NaturalIdRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    return new AccessStrategy(createAccessStrategy(accessType));
}

18 View Complete Implementation : NaturalIdMemcachedRegion.java
Copyright Apache License 2.0
Author : kwon37xi
@Override
public NaturalIdRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    switch(accessType) {
        case READ_ONLY:
            return new ReadOnlyNaturalIdRegionAccessStrategy(this);
        case NONSTRICT_READ_WRITE:
            return new NonstrictReadWriteNaturalIdRegionAccessStrategy(this);
        default:
            throw new CacheException("Unsupported access strategy : " + accessType + ".");
    }
}

18 View Complete Implementation : EntityRegionImpl.java
Copyright Apache License 2.0
Author : kwon37xi
@Override
public EnreplacedyRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    switch(accessType) {
        case READ_ONLY:
            if (getCacheDataDescription().isMutable()) {
                LOG.warnf("read-only cache configured for mutable enreplacedy [ %s ]", getName());
            }
            return new ReadOnlyEnreplacedyRegionAccessStrategy(this);
        case READ_WRITE:
            return new ReadWriteEnreplacedyRegionAccessStrategy(this);
        case NONSTRICT_READ_WRITE:
            return new NonstrictReadWriteEnreplacedyRegionAccessStrategy(this);
        case TRANSACTIONAL:
            // throw new UnsupportedOperationException( "doesn't support this access strategy" );
            return new TransactionalEnreplacedyRegionAccessStrategy(this);
        default:
            throw new IllegalArgumentException("unrecognized access strategy type [" + accessType + "]");
    }
}

18 View Complete Implementation : NaturalIdRegionImpl.java
Copyright Apache License 2.0
Author : infinispan
@Override
public NaturalIdRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    checkAccessType(accessType);
    AccessDelegate accessDelegate = createAccessDelegate(accessType);
    if (accessType == AccessType.READ_ONLY || !getCacheDataDescription().isMutable()) {
        return new ReadOnlyAccess(this, accessDelegate);
    } else {
        return new ReadWriteAccess(this, accessDelegate);
    }
}

18 View Complete Implementation : HibernateCollectionRegion.java
Copyright Apache License 2.0
Author : apache
/**
 * {@inheritDoc}
 */
@Override
public CollectionRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    return new AccessStrategy(createAccessStrategy(accessType));
}

18 View Complete Implementation : TestSessionAccessImpl.java
Copyright Apache License 2.0
Author : infinispan
@Override
public Object collectionAccess(InfinispanBaseRegion region, AccessType accessType) {
    return ((CollectionRegion) region).buildAccessStrategy(accessType);
}

18 View Complete Implementation : TestSessionAccessImpl.java
Copyright Apache License 2.0
Author : infinispan
@Override
public Object enreplacedyAccess(InfinispanBaseRegion region, AccessType accessType) {
    return ((EnreplacedyRegion) region).buildAccessStrategy(accessType);
}

18 View Complete Implementation : HibernateEntityRegion.java
Copyright Apache License 2.0
Author : apache
/**
 * {@inheritDoc}
 */
@Override
public EnreplacedyRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    return new AccessStrategy(createAccessStrategy(accessType));
}

18 View Complete Implementation : DomainDataRegionImpl.java
Copyright Apache License 2.0
Author : infinispan
@Override
public CollectionDataAccess getCollectionDataAccess(NavigableRole collectionRole) {
    CollectionDataCachingConfig collectionConfig = findConfig(this.config.getCollectionCaching(), collectionRole);
    AccessType accessType = collectionConfig.getAccessType();
    AccessDelegate accessDelegate = createAccessDelegate(accessType, collectionConfig.getOwnerVersionComparator());
    return new CollectionDataAccessImpl(this, accessDelegate, accessType);
}

17 View Complete Implementation : RedisAccessStrategyFactoryImpl.java
Copyright Apache License 2.0
Author : debop
@Override
public EnreplacedyRegionAccessStrategy createEnreplacedyRegionAccessStrategy(RedisEnreplacedyRegion enreplacedyRegion, AccessType accessType) {
    switch(accessType) {
        case READ_ONLY:
            if (enreplacedyRegion.getCacheDataDescription().isMutable()) {
                log.warn("read-only cache configured for mutable enreplacedy regionName=[{}]", enreplacedyRegion.getName());
            }
            return new ReadOnlyRedisEnreplacedyRegionAccessStrategy(enreplacedyRegion, enreplacedyRegion.getSettings());
        case READ_WRITE:
            return new ReadWriteRedisEnreplacedyRegionAccessStrategy(enreplacedyRegion, enreplacedyRegion.getSettings());
        case NONSTRICT_READ_WRITE:
            return new NonStrictReadWriteRedisEnreplacedyRegionAccessStrategy(enreplacedyRegion, enreplacedyRegion.getSettings());
        case TRANSACTIONAL:
            return new TransactionalRedisEnreplacedyRegionAccessStrategy(enreplacedyRegion, enreplacedyRegion.getSettings());
        default:
            throw new IllegalArgumentException("unrecognized access strategy type [" + accessType + "]");
    }
}

17 View Complete Implementation : RedisAccessStrategyFactoryImpl.java
Copyright Apache License 2.0
Author : debop
/**
 * {@inheritDoc}
 */
public NaturalIdRegionAccessStrategy createNaturalIdRegionAccessStrategy(RedisNaturalIdRegion naturalIdRegion, AccessType accessType) {
    switch(accessType) {
        case READ_ONLY:
            if (naturalIdRegion.getCacheDataDescription().isMutable()) {
                log.warn("read-only cache configured for mutable enreplacedy naturalIdRegion=[{}]", naturalIdRegion.getName());
            }
            return new ReadOnlyRedisNaturalIdRegionAccessStrategy(naturalIdRegion, naturalIdRegion.getOptions());
        case READ_WRITE:
            return new ReadWriteRedisNaturalIdRegionAccessStrategy(naturalIdRegion, naturalIdRegion.getOptions());
        case NONSTRICT_READ_WRITE:
            return new NonStrictReadWriteRedisNaturalIdRegionAccessStrategy(naturalIdRegion, naturalIdRegion.getOptions());
        case TRANSACTIONAL:
            return new TransactionalRedisNaturalIdRegionAccessStrategy(naturalIdRegion, naturalIdRegion.getOptions());
        default:
            throw new IllegalArgumentException("unrecognized access strategy type [" + accessType + "]");
    }
}

17 View Complete Implementation : HazelcastCollectionRegion.java
Copyright Apache License 2.0
Author : hazelcast
public CollectionRegionAccessStrategy buildAccessStrategy(final AccessType accessType) throws CacheException {
    if (AccessType.READ_ONLY.equals(accessType)) {
        return new CollectionRegionAccessStrategyAdapter(new ReadOnlyAccessDelegate<HazelcastCollectionRegion>(this, props));
    }
    if (AccessType.NONSTRICT_READ_WRITE.equals(accessType)) {
        return new CollectionRegionAccessStrategyAdapter(new NonStrictReadWriteAccessDelegate<HazelcastCollectionRegion>(this, props));
    }
    if (AccessType.READ_WRITE.equals(accessType)) {
        return new CollectionRegionAccessStrategyAdapter(new ReadWriteAccessDelegate<HazelcastCollectionRegion>(this, props));
    }
    throw new CacheException("AccessType \"" + accessType + "\" is not currently supported by Hazelcast.");
}

17 View Complete Implementation : HazelcastEntityRegion.java
Copyright Apache License 2.0
Author : hazelcast
public EnreplacedyRegionAccessStrategy buildAccessStrategy(final AccessType accessType) throws CacheException {
    if (AccessType.READ_ONLY.equals(accessType)) {
        return new EnreplacedyRegionAccessStrategyAdapter(new ReadOnlyAccessDelegate<HazelcastEnreplacedyRegion>(this, props));
    }
    if (AccessType.NONSTRICT_READ_WRITE.equals(accessType)) {
        return new EnreplacedyRegionAccessStrategyAdapter(new NonStrictReadWriteAccessDelegate<HazelcastEnreplacedyRegion>(this, props));
    }
    if (AccessType.READ_WRITE.equals(accessType)) {
        return new EnreplacedyRegionAccessStrategyAdapter(new ReadWriteAccessDelegate<HazelcastEnreplacedyRegion>(this, props));
    }
    throw new CacheException("AccessType \"" + accessType + "\" is not currently supported by Hazelcast.");
}

17 View Complete Implementation : HazelcastNaturalIdRegion.java
Copyright Apache License 2.0
Author : hazelcast
public NaturalIdRegionAccessStrategy buildAccessStrategy(final AccessType accessType) throws CacheException {
    if (AccessType.READ_ONLY.equals(accessType)) {
        return new NaturalIdRegionAccessStrategyAdapter(new ReadOnlyAccessDelegate<HazelcastNaturalIdRegion>(this, props));
    }
    if (AccessType.NONSTRICT_READ_WRITE.equals(accessType)) {
        return new NaturalIdRegionAccessStrategyAdapter(new NonStrictReadWriteAccessDelegate<HazelcastNaturalIdRegion>(this, props));
    }
    if (AccessType.READ_WRITE.equals(accessType)) {
        return new NaturalIdRegionAccessStrategyAdapter(new ReadWriteAccessDelegate<HazelcastNaturalIdRegion>(this, props));
    }
    throw new CacheException("AccessType \"" + accessType + "\" is not currently supported by Hazelcast.");
}

17 View Complete Implementation : NodeEnvironment.java
Copyright Apache License 2.0
Author : infinispan
public InfinispanBaseRegion getEnreplacedyRegion(String name, AccessType accessType) {
    if (enreplacedyRegionMap == null) {
        enreplacedyRegionMap = new HashMap<>();
        return buildAndStoreEnreplacedyRegion(name, accessType);
    }
    InfinispanBaseRegion region = enreplacedyRegionMap.get(name);
    if (region == null) {
        region = buildAndStoreEnreplacedyRegion(name, accessType);
    }
    return region;
}

17 View Complete Implementation : NodeEnvironment.java
Copyright Apache License 2.0
Author : infinispan
private InfinispanBaseRegion buildAndStoreEnreplacedyRegion(String name, AccessType accessType) {
    InfinispanBaseRegion region = regionFactory.buildEnreplacedyRegion(name, accessType);
    enreplacedyRegionMap.put(name, region);
    return region;
}

17 View Complete Implementation : TestRegionFactoryImpl.java
Copyright Apache License 2.0
Author : infinispan
@Override
public InfinispanBaseRegion buildCollectionRegion(String regionName, AccessType accessType) {
    String prefix = delegate.getSettings().getCacheRegionPrefix();
    if (prefix != null && !prefix.isEmpty())
        regionName = prefix + '.' + regionName;
    return (InfinispanBaseRegion) delegate.buildCollectionRegion(regionName, null, MUTABLE_VERSIONED);
}

17 View Complete Implementation : TestRegionFactoryImpl.java
Copyright Apache License 2.0
Author : infinispan
@Override
public InfinispanBaseRegion buildEnreplacedyRegion(String regionName, AccessType accessType) {
    String prefix = delegate.getSettings().getCacheRegionPrefix();
    if (prefix != null && !prefix.isEmpty())
        regionName = prefix + '.' + regionName;
    return (InfinispanBaseRegion) delegate.buildEnreplacedyRegion(regionName, null, MUTABLE_VERSIONED);
}

17 View Complete Implementation : DomainDataRegionImpl.java
Copyright Apache License 2.0
Author : infinispan
@Override
public NaturalIdDataAccess getNaturalIdDataAccess(NavigableRole rootEnreplacedyRole) {
    NaturalIdDataCachingConfig naturalIdConfig = findConfig(this.config.getNaturalIdCaching(), rootEnreplacedyRole);
    AccessType accessType = naturalIdConfig.getAccessType();
    if (accessType == AccessType.NONSTRICT_READ_WRITE) {
        // We don't support nonstrict read write for natural ids as NSRW requires versions;
        // natural ids aren't versioned by definition (as the values are primary keys).
        accessType = AccessType.READ_WRITE;
    }
    AccessDelegate accessDelegate = createAccessDelegate(accessType, null);
    if (accessType == AccessType.READ_ONLY || !naturalIdConfig.isMutable()) {
        return new ReadOnlyNaturalDataAccess(accessType, accessDelegate, this);
    } else {
        return new ReadWriteNaturalDataAccess(accessType, accessDelegate, this);
    }
}

17 View Complete Implementation : TestRegionFactoryImpl.java
Copyright Apache License 2.0
Author : infinispan
@Override
public InfinispanBaseRegion buildEnreplacedyRegion(String regionName, AccessType accessType) {
    RootClreplaced persistentClreplaced = rootClreplacedMock(regionName);
    DomainDataRegionConfigImpl config = new DomainDataRegionConfigImpl.Builder(regionName).addEnreplacedyConfig(persistentClreplaced, accessType).build();
    return (InfinispanBaseRegion) delegate.buildDomainDataRegion(config, null);
}

17 View Complete Implementation : TestSessionAccessImpl.java
Copyright Apache License 2.0
Author : infinispan
@Override
public Object collectionAccess(InfinispanBaseRegion region, AccessType accessType) {
    DomainDataRegionImpl impl = (DomainDataRegionImpl) region;
    NavigableRole role = impl.config().getCollectionCaching().stream().filter(c -> c.getAccessType() == accessType).map(DomainDataCachingConfig::getNavigableRole).findFirst().orElseThrow(() -> new IllegalArgumentException());
    return impl.getCollectionDataAccess(role);
}

17 View Complete Implementation : TestSessionAccessImpl.java
Copyright Apache License 2.0
Author : infinispan
@Override
public Object enreplacedyAccess(InfinispanBaseRegion region, AccessType accessType) {
    DomainDataRegionImpl impl = (DomainDataRegionImpl) region;
    NavigableRole role = impl.config().getEnreplacedyCaching().stream().filter(c -> c.getAccessType() == accessType).map(DomainDataCachingConfig::getNavigableRole).findFirst().orElseThrow(() -> new IllegalArgumentException());
    return impl.getEnreplacedyDataAccess(role);
}