Package org.infinispan.configuration.global

Examples of org.infinispan.configuration.global.GlobalConfiguration


        jgroupsXml = jgroupsXml.replaceAll("mcast_addr=\"[0-9.]+\"", String.format("mcast_addr=\"%s\"", config.getClusterAddress()));
        jgroupsXml = jgroupsXml.replaceAll("mcast_port=\"[0-9]+\"", String.format("mcast_port=\"%d\"", config.getClusterPort()));


        GlobalConfiguration globalConfiguration = new GlobalConfigurationBuilder()
                .classLoader(InfinispanEmbeddedCacheManager.class.getClassLoader())
                .transport()
                    .defaultTransport()
                    .clusterName(config.getClusterName())
                    .machineId("instance-" + config.getDatacenterId())
                    .addProperty("configurationXml", jgroupsXml)
                    .distributedSyncTimeout(config.getClusterTimeout())
                .globalJmxStatistics()
                    .jmxDomain("org.apache.marmotta.kiwi")
                    .allowDuplicateDomains(true)
                .serialization()
                    .addAdvancedExternalizer(externalizers)
                .build();

        defaultConfiguration = new ConfigurationBuilder()
                .clustering()
                    .cacheMode(CacheMode.REPL_ASYNC)
                    .async()
                        .asyncMarshalling()
                    .stateTransfer()
                        .fetchInMemoryState(false)
                    .timeout(config.getClusterTimeout())
                .eviction()
                    .strategy(EvictionStrategy.LIRS)
                    .maxEntries(100000)
                .expiration()
                    .lifespan(30, TimeUnit.MINUTES)
                    .maxIdle(10, TimeUnit.MINUTES)
                .build();
        cacheManager = new DefaultCacheManager(globalConfiguration, defaultConfiguration, true);

        log.info("initialised Infinispan replicated cache manager (cluster name: {})",  globalConfiguration.transport().clusterName());
    }
View Full Code Here


   protected void clearTempDir() {
      TestingUtil.recursiveFileRemove(tmpDirectory);
   }

   public void testConfigBuilder() {
      GlobalConfiguration globalConfig = new GlobalConfigurationBuilder().globalJmxStatistics().transport().defaultTransport().build();

      Configuration cacheConfig = new ConfigurationBuilder().persistence().addStore(LevelDBStoreConfigurationBuilder.class).location(tmpDataDirectory)
            .expiredLocation(tmpExpiredDirectory).implementationType(LevelDBStoreConfiguration.ImplementationType.AUTO).build();

      StoreConfiguration cacheLoaderConfig = cacheConfig.persistence().stores().get(0);
View Full Code Here

public class JpaConfigurationTest {

   private static final String PERSISTENCE_UNIT_NAME = "org.infinispan.persistence.jpa.configurationTest";

   public void testConfigBuilder() {
      GlobalConfiguration globalConfig = new GlobalConfigurationBuilder()
            .globalJmxStatistics().transport().defaultTransport().build();

      Configuration cacheConfig = new ConfigurationBuilder().persistence()
            .addStore(JpaStoreConfigurationBuilder.class)
            .persistenceUnitName(PERSISTENCE_UNIT_NAME)
View Full Code Here

         this.jcacheManagers.put(installedCacheManager.getCacheManager(), jcacheManager);
      }
   }

   private JCacheManager toJCacheManager(EmbeddedCacheManager cacheManager) {
      GlobalConfiguration globalCfg = cacheManager.getCacheManagerConfiguration();
      String name = globalCfg.globalJmxStatistics().cacheManagerName();
      return new JCacheManager(URI.create(name), cacheManager, Caching.getCachingProvider());
   }
View Full Code Here

        AdvancedExternalizer<?> rowKeyExternalizer = RowKeyExternalizer.INSTANCE;
        AdvancedExternalizer<?> entityKeyMetadataExternalizer = EntityKeyMetadataExternalizer.INSTANCE;
        AdvancedExternalizer<?> idGeneratorKeyExternalizer = IdSourceKeyExternalizer.INSTANCE;

        // override global configuration from the config file to inject externalizers
        GlobalConfiguration globalConfiguration = new GlobalConfigurationBuilder()
          .read( tmpCacheManager.getCacheManagerConfiguration() )
          .serialization()
            .addAdvancedExternalizer( entityKeyExternalizer.getId(), entityKeyExternalizer )
            .addAdvancedExternalizer( associationKeyExternalizer.getId(), associationKeyExternalizer )
            .addAdvancedExternalizer( rowKeyExternalizer.getId(), rowKeyExternalizer )
View Full Code Here

      Configuration cfg = cache.getCacheConfiguration();
      SearchFactoryIntegrator sf = getSearchFactory(
            cfg.indexing().properties(), cr);

      // Resolve MBean server instance
      GlobalConfiguration globalCfg =
            cr.getGlobalComponentRegistry().getGlobalConfiguration();
      mbeanServer = JmxUtil.lookupMBeanServer(globalCfg);

      // Resolve jmx domain to use for query mbeans
      String queryGroupName = getQueryGroupName(cacheName);
View Full Code Here

        AdvancedExternalizer<?> rowKeyExternalizer = RowKeyExternalizer.INSTANCE;
        AdvancedExternalizer<?> entityKeyMetadataExternalizer = EntityKeyMetadataExternalizer.INSTANCE;
        AdvancedExternalizer<?> idGeneratorKeyExternalizer = IdSourceKeyExternalizer.INSTANCE;

        // override global configuration from the config file to inject externalizers
        GlobalConfiguration globalConfiguration = new GlobalConfigurationBuilder()
          .read( tmpCacheManager.getCacheManagerConfiguration() )
          .serialization()
            .addAdvancedExternalizer( entityKeyExternalizer.getId(), entityKeyExternalizer )
            .addAdvancedExternalizer( associationKeyExternalizer.getId(), associationKeyExternalizer )
            .addAdvancedExternalizer( rowKeyExternalizer.getId(), rowKeyExternalizer )
View Full Code Here

        AdvancedExternalizer<?> associationKeyExternalizer = AssociationKeyExternalizer.INSTANCE;
        AdvancedExternalizer<?> rowKeyExternalizer = RowKeyExternalizer.INSTANCE;
        AdvancedExternalizer<?> entityKeyMetadataExternalizer = EntityKeyMetadataExternalizer.INSTANCE;

        // override global configuration from the config file to inject externalizers
        GlobalConfiguration globalConfiguration = new GlobalConfigurationBuilder()
          .read( tmpCacheManager.getCacheManagerConfiguration() )
          .serialization()
            .addAdvancedExternalizer( entityKeyExternalizer.getId(), entityKeyExternalizer )
            .addAdvancedExternalizer( associationKeyExternalizer.getId(), associationKeyExternalizer )
            .addAdvancedExternalizer( rowKeyExternalizer.getId(), rowKeyExternalizer )
View Full Code Here

    */
   private static synchronized EmbeddedCacheManager getUniqueInstance(String regionId,
      ConfigurationBuilderHolder holder, final TransactionManager tm)
   {
      GlobalConfigurationBuilder configBuilder = holder.getGlobalConfigurationBuilder();
      GlobalConfiguration gc = configBuilder.build();
      ExoContainer container = ExoContainerContext.getCurrentContainer();
      // Ensure that the cluster name won't be used between 2 ExoContainers
      configBuilder.transport().clusterName(gc.transport().clusterName() + "_" + container.getContext().getName())
         .globalJmxStatistics()
         .cacheManagerName(gc.globalJmxStatistics().cacheManagerName() + "_" + container.getContext().getName()).
         // Configure the MBeanServerLookup
         mBeanServerLookup(MBEAN_SERVER_LOOKUP);
      EmbeddedCacheManager manager;
      gc = configBuilder.build();
      String clusterName = gc.transport().clusterName();
      if (CACHE_MANAGERS.containsKey(clusterName))
      {
         CacheManagerInstance cacheManagerInstance = CACHE_MANAGERS.get(clusterName);
         cacheManagerInstance.acquire();
         manager = cacheManagerInstance.cacheManager;
View Full Code Here

*/
@Test(groups = "unit", testName = "loaders.jpa.configuration.ConfigurationTest")
public class ConfigurationTest {

  public void testConfigBuilder() {
    GlobalConfiguration globalConfig = new GlobalConfigurationBuilder()
        .globalJmxStatistics().transport().defaultTransport().build();

    Configuration cacheConfig = new ConfigurationBuilder().loaders()
        .addLoader(JpaCacheStoreConfigurationBuilder.class)
        .persistenceUnitName("org.infinispan.loaders.jpa.configurationTest")
View Full Code Here

TOP

Related Classes of org.infinispan.configuration.global.GlobalConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.