use of org.infinispan.manager.EmbeddedCacheManager in project wildfly by wildfly.
the class InfinispanRegionFactory method createCacheManager.
@Override
protected EmbeddedCacheManager createCacheManager(Properties properties, final ServiceRegistry serviceRegistry) 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);
}
}
use of org.infinispan.manager.EmbeddedCacheManager in project wildfly by wildfly.
the class InfinispanRegionFactory method createCacheManager.
@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);
}
}
use of org.infinispan.manager.EmbeddedCacheManager in project wildfly by wildfly.
the class SharedInfinispanRegionFactory method createCacheManager.
@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);
}
}
use of org.infinispan.manager.EmbeddedCacheManager in project gora by apache.
the class SimulationDriver method startHotRodServer.
protected void startHotRodServer(GlobalConfigurationBuilder gbuilder, ConfigurationBuilder builder, int nodeIndex) {
TransportFlags transportFlags = new TransportFlags();
EmbeddedCacheManager cm = addClusterEnabledCacheManager(gbuilder, builder, transportFlags);
HotRodServer server = HotRodClientTestingUtil.startHotRodServer(cm);
servers.add(server);
}
Aggregations