本文整理汇总了Java中org.hibernate.cache.spi.CacheDataDescription类的典型用法代码示例。如果您正苦于以下问题:Java CacheDataDescription类的具体用法?Java CacheDataDescription怎么用?Java CacheDataDescription使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CacheDataDescription类属于org.hibernate.cache.spi包,在下文中一共展示了CacheDataDescription类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: LocalRegionCache
import org.hibernate.cache.spi.CacheDataDescription; //导入依赖的package包/类
/**
* @param name the name for this region cache, which is also used to retrieve configuration/topic
* @param hazelcastInstance the {@code HazelcastInstance} to which this region cache belongs, used to retrieve
* configuration and to lookup an {@link ITopic} to register a {@link MessageListener}
* with if {@code withTopic} is {@code true} (optional)
* @param metadata metadata describing the cached data, used to compare data versions (optional)
* @param withTopic {@code true} to register a {@link MessageListener} with the {@link ITopic} whose name
* matches this region cache <i>if</i> a {@code HazelcastInstance} was provided to look
* up the topic; otherwise, {@code false} not to register a listener even if an instance
* was provided
*/
public LocalRegionCache(final String name, final HazelcastInstance hazelcastInstance,
final CacheDataDescription metadata, final boolean withTopic) {
this.hazelcastInstance = hazelcastInstance;
try {
config = hazelcastInstance != null ? hazelcastInstance.getConfig().findMapConfig(name) : null;
} catch (UnsupportedOperationException ignored) {
EmptyStatement.ignore(ignored);
}
versionComparator = metadata != null && metadata.isVersioned() ? metadata.getVersionComparator() : null;
cache = new ConcurrentHashMap<Object, Expirable>();
markerIdCounter = new AtomicLong();
messageListener = createMessageListener();
if (withTopic && hazelcastInstance != null) {
topic = hazelcastInstance.getTopic(name);
topic.addMessageListener(messageListener);
} else {
topic = null;
}
}
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:32,代码来源:LocalRegionCache.java
示例2: LocalRegionCache
import org.hibernate.cache.spi.CacheDataDescription; //导入依赖的package包/类
/**
* @param name the name for this region cache, which is also used to retrieve configuration/topic
* @param hazelcastInstance the {@code HazelcastInstance} to which this region cache belongs, used to retrieve
* configuration and to lookup an {@link ITopic} to register a {@link MessageListener}
* with if {@code withTopic} is {@code true} (optional)
* @param metadata metadata describing the cached data, used to compare data versions (optional)
* @param withTopic {@code true} to register a {@link MessageListener} with the {@link ITopic} whose name
* matches this region cache <i>if</i> a {@code HazelcastInstance} was provided to look
* up the topic; otherwise, {@code false} not to register a listener even if an instance
* was provided
* @since 3.3
*/
public LocalRegionCache(final String name, final HazelcastInstance hazelcastInstance,
final CacheDataDescription metadata, final boolean withTopic) {
this.hazelcastInstance = hazelcastInstance;
try {
config = hazelcastInstance != null ? hazelcastInstance.getConfig().findMapConfig(name) : null;
} catch (UnsupportedOperationException ignored) {
EmptyStatement.ignore(ignored);
}
versionComparator = metadata != null && metadata.isVersioned() ? metadata.getVersionComparator() : null;
cache = new ConcurrentHashMap<Object, Expirable>();
markerIdCounter = new AtomicLong();
messageListener = createMessageListener();
if (withTopic && hazelcastInstance != null) {
topic = hazelcastInstance.getTopic(name);
topic.addMessageListener(messageListener);
} else {
topic = null;
}
}
开发者ID:hazelcast,项目名称:hazelcast-hibernate,代码行数:33,代码来源:LocalRegionCache.java
示例3: AbstractTransactionalDataRegion
import org.hibernate.cache.spi.CacheDataDescription; //导入依赖的package包/类
protected AbstractTransactionalDataRegion(final HazelcastInstance instance, final String regionName,
final Properties props, final CacheDataDescription metadata,
final Cache cache) {
super(instance, regionName, props);
this.metadata = metadata;
this.cache = cache;
}
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:8,代码来源:AbstractTransactionalDataRegion.java
示例4: IMapRegionCache
import org.hibernate.cache.spi.CacheDataDescription; //导入依赖的package包/类
public IMapRegionCache(final String name, final HazelcastInstance hazelcastInstance,
final Properties props, final CacheDataDescription metadata) {
this.name = name;
this.hazelcastInstance = hazelcastInstance;
this.versionComparator = metadata != null && metadata.isVersioned() ? metadata.getVersionComparator() : null;
this.map = hazelcastInstance.getMap(this.name);
lockTimeout = CacheEnvironment.getLockTimeoutInMillis(props);
final long maxOperationTimeout = HazelcastTimestamper.getMaxOperationTimeout(hazelcastInstance);
tryLockAndGetTimeout = Math.min(maxOperationTimeout, COMPARISON_VALUE);
markerIdCounter = new AtomicLong();
}
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:12,代码来源:IMapRegionCache.java
示例5: buildCollectionRegion
import org.hibernate.cache.spi.CacheDataDescription; //导入依赖的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
示例6: buildEntityRegion
import org.hibernate.cache.spi.CacheDataDescription; //导入依赖的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
示例7: buildNaturalIdRegion
import org.hibernate.cache.spi.CacheDataDescription; //导入依赖的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
示例8: testConstructorIgnoresVersionComparatorForUnversionedData
import org.hibernate.cache.spi.CacheDataDescription; //导入依赖的package包/类
@Test
public void testConstructorIgnoresVersionComparatorForUnversionedData() {
CacheDataDescription description = mock(CacheDataDescription.class);
doThrow(AssertionError.class).when(description).getVersionComparator(); // Will fail the test if called
new LocalRegionCache(CACHE_NAME, null, description);
verify(description).isVersioned(); // Verify that the versioned flag was checked
verifyNoMoreInteractions(description);
}
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:10,代码来源:LocalRegionCacheTest.java
示例9: testConstructorSetsVersionComparatorForVersionedData
import org.hibernate.cache.spi.CacheDataDescription; //导入依赖的package包/类
@Test
public void testConstructorSetsVersionComparatorForVersionedData() {
Comparator<?> comparator = mock(Comparator.class);
CacheDataDescription description = mock(CacheDataDescription.class);
when(description.getVersionComparator()).thenReturn(comparator);
when(description.isVersioned()).thenReturn(true);
new LocalRegionCache(CACHE_NAME, null, description);
verify(description).getVersionComparator();
verify(description).isVersioned();
}
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:13,代码来源:LocalRegionCacheTest.java
示例10: buildCollectionRegion
import org.hibernate.cache.spi.CacheDataDescription; //导入依赖的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
示例11: buildEntityRegion
import org.hibernate.cache.spi.CacheDataDescription; //导入依赖的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
示例12: buildNaturalIdRegion
import org.hibernate.cache.spi.CacheDataDescription; //导入依赖的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
示例13: buildEntityRegion
import org.hibernate.cache.spi.CacheDataDescription; //导入依赖的package包/类
/** {@inheritDoc} */
@Override public EntityRegion buildEntityRegion(String regionName, Properties props, CacheDataDescription metadata)
throws CacheException {
return new HibernateEntityRegion(this,
regionName,
accessStgyFactory.node(),
accessStgyFactory.regionCache(regionName),
metadata);
}
开发者ID:apache,项目名称:ignite,代码行数:10,代码来源:HibernateRegionFactory.java
示例14: buildNaturalIdRegion
import org.hibernate.cache.spi.CacheDataDescription; //导入依赖的package包/类
/** {@inheritDoc} */
@Override public NaturalIdRegion buildNaturalIdRegion(String regionName, Properties props,
CacheDataDescription metadata) throws CacheException {
return new HibernateNaturalIdRegion(this,
regionName,
accessStgyFactory.node(),
accessStgyFactory.regionCache(regionName),
metadata);
}
开发者ID:apache,项目名称:ignite,代码行数:10,代码来源:HibernateRegionFactory.java
示例15: buildCollectionRegion
import org.hibernate.cache.spi.CacheDataDescription; //导入依赖的package包/类
/** {@inheritDoc} */
@Override public CollectionRegion buildCollectionRegion(String regionName, Properties props,
CacheDataDescription metadata) throws CacheException {
return new HibernateCollectionRegion(this,
regionName,
accessStgyFactory.node(),
accessStgyFactory.regionCache(regionName),
metadata);
}
开发者ID:apache,项目名称:ignite,代码行数:10,代码来源:HibernateRegionFactory.java
示例16: HibernateNaturalIdRegion
import org.hibernate.cache.spi.CacheDataDescription; //导入依赖的package包/类
/**
* @param factory Region factory.
* @param name Region name.
* @param ignite Grid.
* @param cache Region cache,
* @param dataDesc Region data description.
*/
HibernateNaturalIdRegion(HibernateRegionFactory factory,
String name,
Ignite ignite,
HibernateCacheProxy cache,
CacheDataDescription dataDesc) {
super(factory, name, ignite, cache, dataDesc);
}
开发者ID:apache,项目名称:ignite,代码行数:15,代码来源:HibernateNaturalIdRegion.java
示例17: buildNaturalIdRegion
import org.hibernate.cache.spi.CacheDataDescription; //导入依赖的package包/类
/** {@inheritDoc} */
@Override public NaturalIdRegion buildNaturalIdRegion(String regionName, Properties props,
CacheDataDescription metadata) throws CacheException {
return new HibernateNaturalIdRegion(this,
regionName,
accessStgyFactory.node(),
accessStgyFactory.regionCache(regionName),
metadata);
}
开发者ID:apache,项目名称:ignite,代码行数:10,代码来源:HibernateRegionFactory.java
示例18: buildCollectionRegion
import org.hibernate.cache.spi.CacheDataDescription; //导入依赖的package包/类
/** {@inheritDoc} */
@Override public CollectionRegion buildCollectionRegion(String regionName, Properties props,
CacheDataDescription metadata) throws CacheException {
return new HibernateCollectionRegion(this,
regionName,
accessStgyFactory.node(),
accessStgyFactory.regionCache(regionName),
metadata);
}
开发者ID:apache,项目名称:ignite,代码行数:10,代码来源:HibernateRegionFactory.java
示例19: buildNaturalIdRegion
import org.hibernate.cache.spi.CacheDataDescription; //导入依赖的package包/类
@Override
public NaturalIdRegion buildNaturalIdRegion(String regionName,
Properties properties, CacheDataDescription metadata)
throws CacheException {
// TODO Auto-generated method stub
return null;
}
开发者ID:4data,项目名称:hibernate-memcached,代码行数:8,代码来源:MemcachedRegionFactory.java
示例20: MemcachedRegion
import org.hibernate.cache.spi.CacheDataDescription; //导入依赖的package包/类
public MemcachedRegion(CacheNamespace cacheNamespace, OverridableReadOnlyProperties properties, CacheDataDescription metadata, Settings settings,
MemcachedAdapter memcachedAdapter, HibernateCacheTimestamper hibernateCacheTimestamper) {
this.cacheNamespace = cacheNamespace;
this.properties = properties;
this.metadata = metadata;
this.settings = settings;
this.memcachedAdapter = memcachedAdapter;
this.hibernateCacheTimestamper = hibernateCacheTimestamper;
}
开发者ID:kwon37xi,项目名称:hibernate4-memcached,代码行数:10,代码来源:MemcachedRegion.java
注:本文中的org.hibernate.cache.spi.CacheDataDescription类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论