use of org.infinispan.configuration.global.GlobalConfiguration in project wildfly by wildfly.
the class CacheContainerServiceConfigurator method get.
@Override
public EmbeddedCacheManager get() {
GlobalConfiguration config = this.configuration.get();
String defaultCacheName = config.defaultCacheName().orElse(null);
ConfigurationBuilderHolder holder = new ConfigurationBuilderHolder(config.classLoader(), new GlobalConfigurationBuilder().read(config));
// We need to create a dummy default configuration if cache has a default cache
if (defaultCacheName != null) {
holder.newConfigurationBuilder(defaultCacheName);
}
EmbeddedCacheManager manager = new DefaultCacheManager(holder, false);
// Undefine the default cache, if we defined one
if (defaultCacheName != null) {
manager.undefineConfiguration(defaultCacheName);
}
manager.start();
// Must create executor before registering cache listener
this.executor = Executors.newSingleThreadExecutor(new DefaultThreadFactory(this.getClass()));
manager.addListener(this);
InfinispanLogger.ROOT_LOGGER.debugf("%s cache container started", this.name);
return manager;
}
use of org.infinispan.configuration.global.GlobalConfiguration in project wildfly by wildfly.
the class DefaultCacheContainerTestCase method getCacheManagerConfiguration.
@Test
public void getCacheManagerConfiguration() {
GlobalConfiguration global = new GlobalConfigurationBuilder().build();
when(this.manager.getCacheManagerConfiguration()).thenReturn(global);
GlobalConfiguration result = this.subject.getCacheManagerConfiguration();
assertSame(global, result);
}
use of org.infinispan.configuration.global.GlobalConfiguration in project wildfly by wildfly.
the class CacheGroup method getName.
@Override
public String getName() {
GlobalConfiguration global = this.cache.getCacheManager().getCacheManagerConfiguration();
TransportConfiguration transport = global.transport();
return transport.transport() != null ? transport.clusterName() : global.cacheManagerName();
}
Aggregations