Java Code Examples for org.hibernate.cache.spi.EntityRegion

The following are top voted examples for showing how to use org.hibernate.cache.spi.EntityRegion. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: hazelcast-hibernate5   File: HazelcastLocalCacheRegionFactory.java   View source code 5 votes vote down vote up
@Override
public EntityRegion buildEntityRegion(final String regionName, final Properties properties,
                                      final CacheDataDescription metadata) throws CacheException {
    final HazelcastEntityRegion<LocalRegionCache> region = new HazelcastEntityRegion<LocalRegionCache>(instance,
            regionName, properties, metadata, new LocalRegionCache(regionName, instance, metadata));
    cleanupService.registerCache(region.getCache());
    return region;
}
 
Example 2
Project: hazelcast-hibernate   File: HazelcastLocalCacheRegionFactory.java   View source code 5 votes vote down vote up
public EntityRegion buildEntityRegion(final String regionName, final Properties properties,
                                      final CacheDataDescription metadata) throws CacheException {
    final HazelcastEntityRegion<LocalRegionCache> region = new HazelcastEntityRegion<LocalRegionCache>(instance,
            regionName, properties, metadata, new LocalRegionCache(regionName, instance, metadata));
    cleanupService.registerCache(region.getCache());
    return region;
}
 
Example 3
Project: ignite   File: HibernateRegionFactory.java   View source code 5 votes vote down vote up
/** {@inheritDoc} */
@Override public EntityRegion buildEntityRegion(String regionName, Properties props, CacheDataDescription metadata)
    throws CacheException {
    return new HibernateEntityRegion(this,
        regionName,
        accessStgyFactory.node(),
        accessStgyFactory.regionCache(regionName),
        metadata);
}
 
Example 4
Project: ignite   File: HibernateRegionFactory.java   View source code 5 votes vote down vote up
/** {@inheritDoc} */
@Override public EntityRegion buildEntityRegion(String regionName, Properties props, CacheDataDescription metadata)
    throws CacheException {
    return new HibernateEntityRegion(this,
        regionName,
        accessStgyFactory.node(),
        accessStgyFactory.regionCache(regionName),
        metadata);
}
 
Example 5
Project: lams   File: NoCachingRegionFactory.java   View source code 4 votes vote down vote up
@Override
public EntityRegion buildEntityRegion(String regionName, Properties properties, CacheDataDescription metadata)
		throws CacheException {
	throw new NoCacheRegionFactoryAvailableException();
}
 
Example 6
Project: hazelcast-hibernate5   File: HazelcastCacheRegionFactory.java   View source code 4 votes vote down vote up
@Override
public EntityRegion buildEntityRegion(final String regionName, final Properties properties,
                                      final CacheDataDescription metadata) throws CacheException {
    return new HazelcastEntityRegion<IMapRegionCache>(instance, regionName, properties, metadata,
            new IMapRegionCache(regionName, instance, properties, metadata));
}
 
Example 7
Project: hazelcast-hibernate5   File: EntityRegionAccessStrategyAdapter.java   View source code 4 votes vote down vote up
@Override
public EntityRegion getRegion() {
    return delegate.getHazelcastRegion();
}
 
Example 8
Project: hazelcast-hibernate5   File: EntityRegionAccessStrategyAdapter.java   View source code 4 votes vote down vote up
@Override
public EntityRegion getRegion() {
    return delegate.getHazelcastRegion();
}
 
Example 9
Project: hazelcast-hibernate   File: HazelcastCacheRegionFactory.java   View source code 4 votes vote down vote up
public EntityRegion buildEntityRegion(final String regionName, final Properties properties,
                                      final CacheDataDescription metadata) throws CacheException {
    return new HazelcastEntityRegion<IMapRegionCache>(instance, regionName, properties, metadata,
            new IMapRegionCache(regionName, instance, properties, metadata));
}
 
Example 10
Project: hazelcast-hibernate   File: EntityRegionAccessStrategyAdapter.java   View source code 4 votes vote down vote up
public EntityRegion getRegion() {
    return delegate.getHazelcastRegion();
}
 
Example 11
Project: ignite   File: HibernateEntityRegion.java   View source code 4 votes vote down vote up
/** {@inheritDoc} */
@Override public EntityRegion getRegion() {
    return HibernateEntityRegion.this;
}
 
Example 12
Project: ignite   File: HibernateEntityRegion.java   View source code 4 votes vote down vote up
/** {@inheritDoc} */
@Override public EntityRegion getRegion() {
    return HibernateEntityRegion.this;
}
 
Example 13
Project: high-performance-java-persistence   File: ReadWriteCacheConcurrencyStrategyWithLockTimeoutTest.java   View source code 4 votes vote down vote up
private net.sf.ehcache.Cache getCache(Class clazz) throws IllegalAccessException {
    EntityPersister entityPersister = ((SessionFactoryImplementor) sessionFactory()).getEntityPersister(clazz.getName() );
    EntityRegion region = entityPersister.getCacheAccessStrategy().getRegion();
    Field cacheField = getField(region.getClass(), "cache");
    return  (net.sf.ehcache.Cache) cacheField.get(region);
}
 
Example 14
Project: hibernate-memcached   File: AbstractMemcachedRegionFactory.java   View source code 4 votes vote down vote up
public EntityRegion buildEntityRegion(String regionName, Properties properties, CacheDataDescription metadata)
		throws CacheException {
	return new MemcachedEntityRegion(getCache(regionName), settings, metadata, properties);
}
 
Example 15
Project: hibernate-memcached   File: ReadOnlyMemcachedEntityRegionAccessStrategy.java   View source code 4 votes vote down vote up
public EntityRegion getRegion() {
	return region;
}
 
Example 16
Project: hibernate-memcached   File: ReadWriteMemcachedEntityRegionAccessStrategy.java   View source code 4 votes vote down vote up
public EntityRegion getRegion() {
	return region;
}
 
Example 17
Project: hibernate-memcached   File: NonStrictReadWriteMemcachedEntityRegionAccessStrategy.java   View source code 4 votes vote down vote up
public EntityRegion getRegion() {
	return region;
}
 
Example 18
Project: hibernate4-memcached   File: ReadWriteEntityRegionAccessStrategy.java   View source code 4 votes vote down vote up
@Override
public EntityRegion getRegion() {
	return region;
}
 
Example 19
Project: hibernate4-memcached   File: BaseEntityRegionAccessStrategy.java   View source code 4 votes vote down vote up
@Override
public EntityRegion getRegion() {
	return region;
}
 
Example 20
Project: hibernate4-memcached   File: BaseEntityMemcachedRegionAccessStrategy.java   View source code 4 votes vote down vote up
@Override
public EntityRegion getRegion() {
    return entityMemcachedRegion;
}
 
Example 21
Project: hibernate-master-class   File: ReadWriteCacheConcurrencyStrategyWithLockTimeoutTest.java   View source code 4 votes vote down vote up
private net.sf.ehcache.Cache getCache(Class clazz) throws IllegalAccessException {
    EntityPersister entityPersister = ((SessionFactoryImplementor) getSessionFactory()).getEntityPersister(clazz.getName() );
    EntityRegion region = entityPersister.getCacheAccessStrategy().getRegion();
    Field cacheField = getField(region.getClass(), "cache");
    return  (net.sf.ehcache.Cache) cacheField.get(region);
}
 
Example 22
Project: lams   File: EntityRegionAccessStrategy.java   View source code 2 votes vote down vote up
/**
 * Get the wrapped entity cache region
 *
 * @return The underlying region
 */
public EntityRegion getRegion();
 
Example 23
Project: TayzGrid   File: ReadOnlyTayzGridEntityRegionAccessStrategy.java   View source code 2 votes vote down vote up
/**
 * Get the wrapped naturalId cache region
 *
 * @return The underlying region
 */
@Override
public EntityRegion getRegion() {
    return (EntityRegion) _region;
}
 
Example 24
Project: TayzGrid   File: ReadWriteTayzGridEntityRegionAccessStrategy.java   View source code 2 votes vote down vote up
/**
 * Get the wrapped naturalId cache region
 *
 * @return The underlying region
 */
@Override
public EntityRegion getRegion() {
    return (EntityRegion) _region;
}
 
Example 25
Project: TayzGrid   File: NonStrictReadWriteTayzGridEntityRegionAccessStrategy.java   View source code 2 votes vote down vote up
/**
 * Get the wrapped naturalId cache region
 *
 * @return The underlying region
 */
@Override
public EntityRegion getRegion() {
    return (EntityRegion) _region;
}
 
Example 26
Project: TayzGrid   File: TayzGridRegionFactory.java   View source code 2 votes vote down vote up
/**
 * Build a cache region specialized for storing entity data.
 *
 * @param regionName The name of the region.
 * @param properties Configuration properties.
 * @param metadata Information regarding the type of data to be cached
 *
 * @return The built region
 *
 * @throws CacheException Indicates problems building the region.
 */
@Override
public EntityRegion buildEntityRegion(String regionName, Properties properties, CacheDataDescription metadata) throws CacheException {
    return new TayzGridEntityRegion(regionName, properties, metadata);
}