本文整理汇总了Java中com.hazelcast.hibernate.local.LocalRegionCache类的典型用法代码示例。如果您正苦于以下问题:Java LocalRegionCache类的具体用法?Java LocalRegionCache怎么用?Java LocalRegionCache使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LocalRegionCache类属于com.hazelcast.hibernate.local包,在下文中一共展示了LocalRegionCache类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: buildCollectionRegion
import com.hazelcast.hibernate.local.LocalRegionCache; //导入依赖的package包/类
public CollectionRegion buildCollectionRegion(String regionName, Properties properties,
CacheDataDescription metadata) throws CacheException {
HazelcastCollectionRegion<LocalRegionCache> region = new HazelcastCollectionRegion<>(hazelcastInstance,
regionName, properties, metadata, new LocalRegionCache(regionName, hazelcastInstance, metadata));
cleanupService.registerCache(region.getCache());
return region;
}
开发者ID:xetys,项目名称:jhipster-ribbon-hystrix,代码行数:10,代码来源:_HazelcastCacheRegionFactory.java
示例2: buildEntityRegion
import com.hazelcast.hibernate.local.LocalRegionCache; //导入依赖的package包/类
public EntityRegion buildEntityRegion(String regionName, Properties properties,
CacheDataDescription metadata) throws CacheException {
HazelcastEntityRegion<LocalRegionCache> region = new HazelcastEntityRegion<>(hazelcastInstance,
regionName, properties, metadata, new LocalRegionCache(regionName, hazelcastInstance, metadata));
cleanupService.registerCache(region.getCache());
return region;
}
开发者ID:xetys,项目名称:jhipster-ribbon-hystrix,代码行数:10,代码来源:_HazelcastCacheRegionFactory.java
示例3: HazelcastQueryResultsRegion
import com.hazelcast.hibernate.local.LocalRegionCache; //导入依赖的package包/类
public HazelcastQueryResultsRegion(final HazelcastInstance instance, final String name, final Properties props) {
// Note: The HazelcastInstance _must_ be passed down here. Otherwise query caches
// cannot be configured and will always use defaults. However, even though we're
// passing the HazelcastInstance, we don't want to use an ITopic for invalidation
// because the timestamps cache can take care of outdated queries
super(instance, name, props, new LocalRegionCache(name, instance, null, false));
}
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:8,代码来源:HazelcastQueryResultsRegion.java
示例4: buildCollectionRegion
import com.hazelcast.hibernate.local.LocalRegionCache; //导入依赖的package包/类
@Override
public CollectionRegion buildCollectionRegion(final String regionName, final Properties properties,
final CacheDataDescription metadata) throws CacheException {
final HazelcastCollectionRegion<LocalRegionCache> region = new HazelcastCollectionRegion<LocalRegionCache>(instance,
regionName, properties, metadata, new LocalRegionCache(regionName, instance, metadata));
cleanupService.registerCache(region.getCache());
return region;
}
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:9,代码来源:HazelcastLocalCacheRegionFactory.java
示例5: buildEntityRegion
import com.hazelcast.hibernate.local.LocalRegionCache; //导入依赖的package包/类
@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;
}
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:9,代码来源:HazelcastLocalCacheRegionFactory.java
示例6: buildNaturalIdRegion
import com.hazelcast.hibernate.local.LocalRegionCache; //导入依赖的package包/类
@Override
public NaturalIdRegion buildNaturalIdRegion(final String regionName, final Properties properties,
final CacheDataDescription metadata) throws CacheException {
final HazelcastNaturalIdRegion<LocalRegionCache> region = new HazelcastNaturalIdRegion<LocalRegionCache>(
instance, regionName, properties, metadata, new LocalRegionCache(regionName, instance, metadata));
cleanupService.registerCache(region.getCache());
return region;
}
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:10,代码来源:HazelcastLocalCacheRegionFactory.java
示例7: testCacheHonorsConfiguration
import com.hazelcast.hibernate.local.LocalRegionCache; //导入依赖的package包/类
/**
* Verifies that the region retrieved the MapConfig and set its timeout from the TTL.
* Also verifies that the nested LocalRegionCache retrieved the configuration,
* but did not register a listener on any ITopic.
*/
@Test
public void testCacheHonorsConfiguration() {
assertEquals(TimeUnit.SECONDS.toMillis(timeout), region.getTimeout());
verify(instance, atLeastOnce()).getConfig();
// ensure a topic is not requested
verify(instance, never()).getTopic(anyString());
verify(config, atLeastOnce()).findMapConfig(eq(REGION_NAME));
// should have been retrieved by the region itself
verify(mapConfig, times(2)).getTimeToLiveSeconds();
// load the cache with more entries than the configured max size
LocalRegionCache regionCache = region.getCache();
assertNotNull(regionCache);
int overSized = maxSize * 2;
for (int i = 0; i < overSized; ++i) {
regionCache.put(i, i, System.currentTimeMillis(), i);
}
assertEquals(overSized, regionCache.size());
// run cleanup to apply the configured limits (the TTL is not tested here for simplicity and speed of this test)
LocalRegionCacheTest.runCleanup(regionCache);
// the default size is 100,000, so if the configuration is ignored no elements will be removed.
// But if the configuration is applied as expected
assertTrue(regionCache.size() <= 50);
verify(mapConfig).getMaxSizeConfig();
verify(mapConfig, times(3)).getTimeToLiveSeconds(); // Should have been retrieved a second time by the cache
}
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:34,代码来源:HazelcastQueryResultsRegionTest.java
示例8: buildCollectionRegion
import com.hazelcast.hibernate.local.LocalRegionCache; //导入依赖的package包/类
public CollectionRegion buildCollectionRegion(final String regionName, final Properties properties,
final CacheDataDescription metadata) throws CacheException {
final HazelcastCollectionRegion<LocalRegionCache> region = new HazelcastCollectionRegion<LocalRegionCache>(instance,
regionName, properties, metadata, new LocalRegionCache(regionName, instance, metadata));
cleanupService.registerCache(region.getCache());
return region;
}
开发者ID:hazelcast,项目名称:hazelcast-hibernate,代码行数:8,代码来源:HazelcastLocalCacheRegionFactory.java
示例9: buildEntityRegion
import com.hazelcast.hibernate.local.LocalRegionCache; //导入依赖的package包/类
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;
}
开发者ID:hazelcast,项目名称:hazelcast-hibernate,代码行数:8,代码来源:HazelcastLocalCacheRegionFactory.java
示例10: buildNaturalIdRegion
import com.hazelcast.hibernate.local.LocalRegionCache; //导入依赖的package包/类
public NaturalIdRegion buildNaturalIdRegion(final String regionName, final Properties properties,
final CacheDataDescription metadata) throws CacheException {
final HazelcastNaturalIdRegion<LocalRegionCache> region = new HazelcastNaturalIdRegion<LocalRegionCache>(
instance, regionName, properties, metadata, new LocalRegionCache(regionName, instance, metadata));
cleanupService.registerCache(region.getCache());
return region;
}
开发者ID:hazelcast,项目名称:hazelcast-hibernate,代码行数:8,代码来源:HazelcastLocalCacheRegionFactory.java
示例11: buildCollectionRegion
import com.hazelcast.hibernate.local.LocalRegionCache; //导入依赖的package包/类
public CollectionRegion buildCollectionRegion(final String regionName, final Properties properties,
final CacheDataDescription metadata) throws CacheException {
HazelcastCollectionRegion<LocalRegionCache> region = new HazelcastCollectionRegion<>(hazelcastInstance,
regionName, properties, metadata, new LocalRegionCache(regionName, hazelcastInstance, metadata));
cleanupService.registerCache(region.getCache());
return region;
}
开发者ID:thpham,项目名称:ithings-demo,代码行数:10,代码来源:HazelcastCacheRegionFactory.java
示例12: buildEntityRegion
import com.hazelcast.hibernate.local.LocalRegionCache; //导入依赖的package包/类
public EntityRegion buildEntityRegion(final String regionName, final Properties properties,
final CacheDataDescription metadata) throws CacheException {
HazelcastEntityRegion<LocalRegionCache> region = new HazelcastEntityRegion<>(hazelcastInstance,
regionName, properties, metadata, new LocalRegionCache(regionName, hazelcastInstance, metadata));
cleanupService.registerCache(region.getCache());
return region;
}
开发者ID:thpham,项目名称:ithings-demo,代码行数:10,代码来源:HazelcastCacheRegionFactory.java
示例13: buildTimestampsRegion
import com.hazelcast.hibernate.local.LocalRegionCache; //导入依赖的package包/类
@Override
public TimestampsRegion buildTimestampsRegion(final String regionName, final Properties properties)
throws CacheException {
return new HazelcastTimestampsRegion<LocalRegionCache>(instance, regionName, properties,
new TimestampsRegionCache(regionName, instance));
}
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:7,代码来源:HazelcastLocalCacheRegionFactory.java
示例14: buildTimestampsRegion
import com.hazelcast.hibernate.local.LocalRegionCache; //导入依赖的package包/类
public TimestampsRegion buildTimestampsRegion(final String regionName, final Properties properties)
throws CacheException {
return new HazelcastTimestampsRegion<LocalRegionCache>(instance, regionName, properties,
new TimestampsRegionCache(regionName, instance));
}
开发者ID:hazelcast,项目名称:hazelcast-hibernate,代码行数:6,代码来源:HazelcastLocalCacheRegionFactory.java
示例15: HazelcastQueryResultsRegion
import com.hazelcast.hibernate.local.LocalRegionCache; //导入依赖的package包/类
public HazelcastQueryResultsRegion(final HazelcastInstance instance, final String name, final Properties props) {
// Note: We can pass HazelcastInstance as null, because instead of invalidation
// timestamps cache can take care of outdated queries.
super(instance, name, props, new LocalRegionCache(name, null, null));
}
开发者ID:health-and-care-developer-network,项目名称:health-and-care-developer-network,代码行数:6,代码来源:HazelcastQueryResultsRegion.java
注:本文中的com.hazelcast.hibernate.local.LocalRegionCache类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论