下面列出了怎么用org.hibernate.cache.spi.CacheDataDescription的API类实例代码及写法,或者点击链接到github查看源代码。
public BaseRegion(RMapCache<Object, Object> mapCache, ConnectionManager connectionManager, RegionFactory regionFactory, CacheDataDescription metadata, Properties properties, String defaultKey) {
super();
this.mapCache = mapCache;
this.regionFactory = regionFactory;
this.metadata = metadata;
this.connectionManager = connectionManager;
String maxEntries = getProperty(properties, mapCache.getName(), defaultKey, RedissonRegionFactory.MAX_ENTRIES_SUFFIX);
if (maxEntries != null) {
mapCache.setMaxSize(Integer.valueOf(maxEntries));
}
String timeToLive = getProperty(properties, mapCache.getName(), defaultKey, RedissonRegionFactory.TTL_SUFFIX);
if (timeToLive != null) {
ttl = Integer.valueOf(timeToLive);
}
String maxIdleTime = getProperty(properties, mapCache.getName(), defaultKey, RedissonRegionFactory.MAX_IDLE_SUFFIX);
if (maxIdleTime != null) {
maxIdle = Integer.valueOf(maxIdleTime);
}
String fallbackValue = (String) properties.getOrDefault(RedissonRegionFactory.FALLBACK, "false");
fallback = Boolean.valueOf(fallbackValue);
}
public BaseRegion(RMapCache<Object, Object> mapCache, ConnectionManager connectionManager, RegionFactory regionFactory, CacheDataDescription metadata, Properties properties, String defaultKey) {
super();
this.mapCache = mapCache;
this.regionFactory = regionFactory;
this.metadata = metadata;
this.connectionManager = connectionManager;
String maxEntries = getProperty(properties, mapCache.getName(), defaultKey, RedissonRegionFactory.MAX_ENTRIES_SUFFIX);
if (maxEntries != null) {
mapCache.setMaxSize(Integer.valueOf(maxEntries));
}
String timeToLive = getProperty(properties, mapCache.getName(), defaultKey, RedissonRegionFactory.TTL_SUFFIX);
if (timeToLive != null) {
ttl = Integer.valueOf(timeToLive);
}
String maxIdleTime = getProperty(properties, mapCache.getName(), defaultKey, RedissonRegionFactory.MAX_IDLE_SUFFIX);
if (maxIdleTime != null) {
maxIdle = Integer.valueOf(maxIdleTime);
}
String fallbackValue = (String) properties.getOrDefault(RedissonRegionFactory.FALLBACK, "false");
fallback = Boolean.valueOf(fallbackValue);
}
public BaseRegion(RMapCache<Object, Object> mapCache, ConnectionManager connectionManager, RegionFactory regionFactory, CacheDataDescription metadata, Properties properties, String defaultKey) {
super();
this.mapCache = mapCache;
this.regionFactory = regionFactory;
this.metadata = metadata;
this.connectionManager = connectionManager;
String maxEntries = getProperty(properties, mapCache.getName(), defaultKey, RedissonRegionFactory.MAX_ENTRIES_SUFFIX);
if (maxEntries != null) {
mapCache.setMaxSize(Integer.valueOf(maxEntries));
}
String timeToLive = getProperty(properties, mapCache.getName(), defaultKey, RedissonRegionFactory.TTL_SUFFIX);
if (timeToLive != null) {
ttl = Integer.valueOf(timeToLive);
}
String maxIdleTime = getProperty(properties, mapCache.getName(), defaultKey, RedissonRegionFactory.MAX_IDLE_SUFFIX);
if (maxIdleTime != null) {
maxIdle = Integer.valueOf(maxIdleTime);
}
String fallbackValue = (String) properties.getOrDefault(RedissonRegionFactory.FALLBACK, "false");
fallback = Boolean.valueOf(fallbackValue);
}
/** {@inheritDoc} */
@Override public EntityRegion buildEntityRegion(String regionName, Properties props, CacheDataDescription metadata)
throws CacheException {
return new HibernateEntityRegion(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);
}
/**
* @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);
}
/** {@inheritDoc} */
@Override public EntityRegion buildEntityRegion(String regionName, Properties props, CacheDataDescription metadata)
throws CacheException {
return new HibernateEntityRegion(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);
}
@Override
public EntityRegion buildEntityRegion(String regionName, Properties properties, CacheDataDescription metadata)
throws CacheException {
log.debug("Building entity cache region: " + regionName);
RMapCache<Object, Object> mapCache = getCache(regionName, properties, ENTITY_DEF);
return new RedissonEntityRegion(mapCache, ((Redisson)redisson).getConnectionManager(),this, metadata, settings, properties, ENTITY_DEF);
}
@Override
public NaturalIdRegion buildNaturalIdRegion(String regionName, Properties properties, CacheDataDescription metadata)
throws CacheException {
log.debug("Building naturalId cache region: " + regionName);
RMapCache<Object, Object> mapCache = getCache(regionName, properties, NATURAL_ID_DEF);
return new RedissonNaturalIdRegion(mapCache, ((Redisson)redisson).getConnectionManager(),this, metadata, settings, properties, NATURAL_ID_DEF);
}
@Override
public CollectionRegion buildCollectionRegion(String regionName, Properties properties,
CacheDataDescription metadata) throws CacheException {
log.debug("Building collection cache region: " + regionName);
RMapCache<Object, Object> mapCache = getCache(regionName, properties, COLLECTION_DEF);
return new RedissonCollectionRegion(mapCache, ((Redisson)redisson).getConnectionManager(),this, metadata, settings, properties, COLLECTION_DEF);
}
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;
}
public NaturalIdMemcachedRegion(String regionName, OverridableReadOnlyProperties properties,
CacheDataDescription metadata, Settings settings,
MemcachedAdapter memcachedAdapter,
HibernateCacheTimestamper hibernateCacheTimestamper) {
super(new CacheNamespace(regionName, true), properties, metadata, settings, memcachedAdapter,
hibernateCacheTimestamper);
}
public RefineKeyOverridedGeneralDataMemcachedRegion(CacheNamespace cacheNamespace,
OverridableReadOnlyProperties properties,
CacheDataDescription metadata, Settings settings,
MemcachedAdapter memcachedAdapter,
HibernateCacheTimestamper hibernateCacheTimestamper) {
super(cacheNamespace, properties, metadata, settings, memcachedAdapter, hibernateCacheTimestamper);
}
public J2CacheCollectionRegion(J2CacheAccessStrategyFactory accessStrategyFactory, CacheRegion underlyingCache, Settings settings, CacheDataDescription metadata, Properties properties) {
super(accessStrategyFactory, underlyingCache, settings, metadata, properties);
}
J2CacheTransactionalDataRegion(J2CacheAccessStrategyFactory accessStrategyFactory, CacheRegion cache, Settings settings, CacheDataDescription metadata, Properties properties) {
super(accessStrategyFactory, cache, properties);
this.settings = settings;
this.metadata = metadata;
}
@Override
public CacheDataDescription getCacheDataDescription() {
return metadata;
}
public J2CacheNaturalIdRegion(J2CacheAccessStrategyFactory accessStrategyFactory, CacheRegion underlyingCache, Settings settings, CacheDataDescription metadata, Properties properties) {
super(accessStrategyFactory, underlyingCache, settings, metadata, properties);
}
public J2CacheEntityRegion(J2CacheAccessStrategyFactory accessStrategyFactory, CacheRegion underlyingCache, Settings settings, CacheDataDescription metadata, Properties properties) {
super(accessStrategyFactory,underlyingCache, settings, metadata, properties);
}
public J2CacheCollectionRegion(J2CacheAccessStrategyFactory accessStrategyFactory, CacheRegion underlyingCache, SessionFactoryOptions settings, CacheDataDescription metadata, Properties properties) {
super(accessStrategyFactory, underlyingCache, settings, metadata, properties);
}
J2CacheTransactionalDataRegion(J2CacheAccessStrategyFactory accessStrategyFactory, CacheRegion cache, SessionFactoryOptions settings, CacheDataDescription metadata, Properties properties) {
super(accessStrategyFactory, cache, properties);
this.settings = settings;
this.metadata = metadata;
}
@Override
public CacheDataDescription getCacheDataDescription() {
return this.metadata;
}
public J2CacheNaturalIdRegion(J2CacheAccessStrategyFactory accessStrategyFactory, CacheRegion underlyingCache, SessionFactoryOptions settings, CacheDataDescription metadata, Properties properties) {
super(accessStrategyFactory, underlyingCache, settings, metadata, properties);
}
public J2CacheEntityRegion(J2CacheAccessStrategyFactory accessStrategyFactory, CacheRegion underlyingCache, SessionFactoryOptions settings, CacheDataDescription metadata, Properties properties) {
super(accessStrategyFactory,underlyingCache, settings, metadata, properties);
}
/** {@inheritDoc} */
@Override public CacheDataDescription getCacheDataDescription() {
return dataDesc;
}
/** {@inheritDoc} */
@Override public CacheDataDescription getCacheDataDescription() {
return dataDesc;
}
public RedissonNaturalIdRegion(RMapCache<Object, Object> mapCache, ConnectionManager connectionManager, RegionFactory regionFactory,
CacheDataDescription metadata, Settings settings, Properties properties, String defaultKey) {
super(mapCache, connectionManager, regionFactory, metadata, properties, defaultKey);
this.settings = settings;
}
public RedissonCollectionRegion(RMapCache<Object, Object> mapCache, ConnectionManager connectionManager, RegionFactory regionFactory,
CacheDataDescription metadata, Settings settings, Properties properties, String defaultKey) {
super(mapCache, connectionManager, regionFactory, metadata, properties, defaultKey);
this.settings = settings;
}