Search in sources :

Example 6 with GlobalConfiguration

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;
}
Also used : GlobalConfigurationBuilder(org.infinispan.configuration.global.GlobalConfigurationBuilder) DefaultThreadFactory(org.jboss.as.clustering.context.DefaultThreadFactory) DefaultCacheManager(org.infinispan.manager.DefaultCacheManager) GlobalConfiguration(org.infinispan.configuration.global.GlobalConfiguration) ConfigurationBuilderHolder(org.infinispan.configuration.parsing.ConfigurationBuilderHolder) EmbeddedCacheManager(org.infinispan.manager.EmbeddedCacheManager)

Example 7 with GlobalConfiguration

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);
}
Also used : GlobalConfigurationBuilder(org.infinispan.configuration.global.GlobalConfigurationBuilder) GlobalConfiguration(org.infinispan.configuration.global.GlobalConfiguration) Test(org.junit.Test)

Example 8 with GlobalConfiguration

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();
}
Also used : GlobalConfiguration(org.infinispan.configuration.global.GlobalConfiguration) TransportConfiguration(org.infinispan.configuration.global.TransportConfiguration)

Aggregations

GlobalConfiguration (org.infinispan.configuration.global.GlobalConfiguration)8 GlobalConfigurationBuilder (org.infinispan.configuration.global.GlobalConfigurationBuilder)4 DefaultCacheManager (org.infinispan.manager.DefaultCacheManager)4 ConfigurationBuilder (org.infinispan.configuration.cache.ConfigurationBuilder)2 ConfigurationBuilderHolder (org.infinispan.configuration.parsing.ConfigurationBuilderHolder)2 EmbeddedCacheManager (org.infinispan.manager.EmbeddedCacheManager)2 Serializable (java.io.Serializable)1 PrivilegedActionException (java.security.PrivilegedActionException)1 PrivilegedExceptionAction (java.security.PrivilegedExceptionAction)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 Callable (java.util.concurrent.Callable)1 Consumer (java.util.function.Consumer)1 Function (java.util.function.Function)1 Supplier (java.util.function.Supplier)1 ExoCache (org.exoplatform.services.cache.ExoCache)1 ExoCacheInitException (org.exoplatform.services.cache.ExoCacheInitException)1 DistributedExoCache (org.exoplatform.services.cache.impl.infinispan.distributed.DistributedExoCache)1 GenericExoCacheCreator (org.exoplatform.services.cache.impl.infinispan.generic.GenericExoCacheCreator)1 Cache (org.infinispan.Cache)1