当前位置: 首页>>代码示例>>Java>>正文


Java CacheDataDescription.isVersioned方法代码示例

本文整理汇总了Java中org.hibernate.cache.spi.CacheDataDescription.isVersioned方法的典型用法代码示例。如果您正苦于以下问题:Java CacheDataDescription.isVersioned方法的具体用法?Java CacheDataDescription.isVersioned怎么用?Java CacheDataDescription.isVersioned使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.hibernate.cache.spi.CacheDataDescription的用法示例。


在下文中一共展示了CacheDataDescription.isVersioned方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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


注:本文中的org.hibernate.cache.spi.CacheDataDescription.isVersioned方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。