本文整理了Java中org.jipijapa.event.impl.internal.Notification.startCache()
方法的一些代码示例,展示了Notification.startCache()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Notification.startCache()
方法的具体详情如下:
包路径:org.jipijapa.event.impl.internal.Notification
类名称:Notification
方法名:startCache
[英]start cache
[中]启动缓存
代码示例来源:origin: wildfly/wildfly
@Override
public EmbeddedCacheManager getEmbeddedCacheManager(Properties properties) {
Properties settings = new Properties();
String container = properties.getProperty(CACHE_CONTAINER, DEFAULT_CACHE_CONTAINER);
settings.setProperty(HibernateSecondLevelCache.CONTAINER, container);
if (!Boolean.parseBoolean(properties.getProperty(SHARED, DEFAULT_SHARED))) {
HibernateSecondLevelCache.addSecondLevelCacheDependencies(properties, null);
settings.setProperty(HibernateSecondLevelCache.CACHE_TYPE, HibernateSecondLevelCache.CACHE_PRIVATE);
// Find a suitable service name to represent this session factory instance
String name = properties.getProperty(AvailableSettings.SESSION_FACTORY_NAME);
if (name != null) {
settings.setProperty(HibernateSecondLevelCache.NAME, name);
}
settings.setProperty(HibernateSecondLevelCache.CACHES, String.join(" ", HibernateSecondLevelCache.findCaches(properties)));
}
try {
return new JipiJapaCacheManager(Notification.startCache(Classification.INFINISPAN, settings));
} catch (CacheException e) {
throw e;
} catch (Exception e) {
throw new CacheException(e);
}
}
代码示例来源:origin: wildfly/wildfly
@Override
public EmbeddedCacheManager getEmbeddedCacheManager(Properties properties) {
Properties settings = new Properties();
String container = properties.getProperty(CACHE_CONTAINER, DEFAULT_CACHE_CONTAINER);
settings.setProperty(HibernateSecondLevelCache.CONTAINER, container);
if (!Boolean.parseBoolean(properties.getProperty(SHARED, DEFAULT_SHARED))) {
HibernateSecondLevelCache.addSecondLevelCacheDependencies(properties, null);
settings.setProperty(HibernateSecondLevelCache.CACHE_TYPE, HibernateSecondLevelCache.CACHE_PRIVATE);
// Find a suitable service name to represent this session factory instance
String name = properties.getProperty(AvailableSettings.SESSION_FACTORY_NAME);
if (name != null) {
settings.setProperty(HibernateSecondLevelCache.NAME, name);
}
settings.setProperty(HibernateSecondLevelCache.CACHES, String.join(" ", HibernateSecondLevelCache.findCaches(properties)));
}
try {
return new JipiJapaCacheManager(Notification.startCache(Classification.INFINISPAN, settings));
} catch (CacheException e) {
throw e;
} catch (Exception e) {
throw new CacheException(e);
}
}
代码示例来源:origin: org.jipijapa/jipijapa-hibernate4-3
@Override
protected EmbeddedCacheManager createCacheManager(Properties properties) {
String container = properties.getProperty(CACHE_CONTAINER, DEFAULT_CACHE_CONTAINER);
Properties cacheSettings = new Properties();
cacheSettings.put(HibernateSecondLevelCache.CONTAINER, container);
try {
// Get the (shared) cache manager for JPA application use
wrapper = Notification.startCache(Classification.INFINISPAN, cacheSettings);
return (EmbeddedCacheManager)wrapper.getValue();
} catch (Exception e) {
throw new CacheException(e);
}
}
代码示例来源:origin: org.jipijapa/jipijapa-hibernate4-1
@Override
protected EmbeddedCacheManager createCacheManager(Properties properties) {
String container = properties.getProperty(CACHE_CONTAINER, DEFAULT_CACHE_CONTAINER);
Properties cacheSettings = new Properties();
cacheSettings.put(HibernateSecondLevelCache.CONTAINER, container);
try {
// Get the (shared) cache manager for JPA application use
wrapper = Notification.startCache(Classification.INFINISPAN, cacheSettings);
return (EmbeddedCacheManager)wrapper.getValue();
} catch (Exception e) {
throw new CacheException(e);
}
}
代码示例来源:origin: org.jipijapa/jipijapa-hibernate4-3
@Override
protected EmbeddedCacheManager createCacheManager(Properties properties) throws CacheException {
// Find a suitable service name to represent this session factory instance
String name = properties.getProperty(AvailableSettings.SESSION_FACTORY_NAME);
String container = properties.getProperty(CACHE_CONTAINER, DEFAULT_CACHE_CONTAINER);
HibernateSecondLevelCache.addSecondLevelCacheDependencies(properties, null);
Properties cacheSettings = new Properties();
cacheSettings.put(HibernateSecondLevelCache.CACHE_TYPE,CACHE_PRIVATE);
cacheSettings.put(HibernateSecondLevelCache.CONTAINER, container);
if (name != null) {
cacheSettings.put(HibernateSecondLevelCache.NAME, name);
}
try {
// start a private cache for non-JPA use and return the started cache.
wrapper = Notification.startCache(Classification.INFINISPAN, cacheSettings);
return (EmbeddedCacheManager)wrapper.getValue();
} catch (Exception e) {
throw new CacheException(e);
}
}
代码示例来源:origin: org.jipijapa/jipijapa-hibernate4-1
@Override
protected EmbeddedCacheManager createCacheManager(Properties properties) throws CacheException {
// Find a suitable service name to represent this session factory instance
String name = properties.getProperty(AvailableSettings.SESSION_FACTORY_NAME);
String container = properties.getProperty(CACHE_CONTAINER, DEFAULT_CACHE_CONTAINER);
HibernateSecondLevelCache.addSecondLevelCacheDependencies(properties, null);
Properties cacheSettings = new Properties();
cacheSettings.put(HibernateSecondLevelCache.CACHE_TYPE,CACHE_PRIVATE);
cacheSettings.put(HibernateSecondLevelCache.CONTAINER, container);
if (name != null) {
cacheSettings.put(HibernateSecondLevelCache.NAME, name);
}
try {
// start a private cache for non-JPA use and return the started cache.
wrapper = Notification.startCache(Classification.INFINISPAN, cacheSettings);
return (EmbeddedCacheManager)wrapper.getValue();
} catch (Exception e) {
throw new CacheException(e);
}
}
代码示例来源:origin: org.jboss.eap/jipijapa-hibernate5
@Override
public EmbeddedCacheManager getEmbeddedCacheManager(Properties properties) {
Properties settings = new Properties();
String container = properties.getProperty(CACHE_CONTAINER, DEFAULT_CACHE_CONTAINER);
settings.setProperty(HibernateSecondLevelCache.CONTAINER, container);
if (!Boolean.parseBoolean(properties.getProperty(SHARED, DEFAULT_SHARED))) {
HibernateSecondLevelCache.addSecondLevelCacheDependencies(properties, null);
settings.setProperty(HibernateSecondLevelCache.CACHE_TYPE, HibernateSecondLevelCache.CACHE_PRIVATE);
// Find a suitable service name to represent this session factory instance
String name = properties.getProperty(AvailableSettings.SESSION_FACTORY_NAME);
if (name != null) {
settings.setProperty(HibernateSecondLevelCache.NAME, name);
}
settings.setProperty(HibernateSecondLevelCache.CACHES, String.join(" ", HibernateSecondLevelCache.findCaches(properties)));
}
try {
return new JipiJapaCacheManager(Notification.startCache(Classification.INFINISPAN, settings));
} catch (CacheException e) {
throw e;
} catch (Exception e) {
throw new CacheException(e);
}
}
代码示例来源:origin: org.jboss.eap/jipijapa-hibernate5-3
@Override
public EmbeddedCacheManager getEmbeddedCacheManager(Properties properties) {
Properties settings = new Properties();
String container = properties.getProperty(CACHE_CONTAINER, DEFAULT_CACHE_CONTAINER);
settings.setProperty(HibernateSecondLevelCache.CONTAINER, container);
if (!Boolean.parseBoolean(properties.getProperty(SHARED, DEFAULT_SHARED))) {
HibernateSecondLevelCache.addSecondLevelCacheDependencies(properties, null);
settings.setProperty(HibernateSecondLevelCache.CACHE_TYPE, HibernateSecondLevelCache.CACHE_PRIVATE);
// Find a suitable service name to represent this session factory instance
String name = properties.getProperty(AvailableSettings.SESSION_FACTORY_NAME);
if (name != null) {
settings.setProperty(HibernateSecondLevelCache.NAME, name);
}
settings.setProperty(HibernateSecondLevelCache.CACHES, String.join(" ", HibernateSecondLevelCache.findCaches(properties)));
}
try {
return new JipiJapaCacheManager(Notification.startCache(Classification.INFINISPAN, settings));
} catch (CacheException e) {
throw e;
} catch (Exception e) {
throw new CacheException(e);
}
}
内容来源于网络,如有侵权,请联系作者删除!