Package org.infinispan.manager

Examples of org.infinispan.manager.DefaultCacheManager


    private final String defaultCache;

    @SuppressWarnings("deprecation")
    public DefaultEmbeddedCacheManager(GlobalConfiguration global, String defaultCache) {
        this(new DefaultCacheManager(adapt(global), false), defaultCache);
    }
View Full Code Here


        this(new DefaultCacheManager(adapt(global), false), defaultCache);
    }

    @SuppressWarnings("deprecation")
    public DefaultEmbeddedCacheManager(GlobalConfiguration global, Configuration config, String defaultCache) {
        this(new DefaultCacheManager(adapt(global), LegacyConfigurationAdaptor.adapt(config), false), defaultCache);
    }
View Full Code Here

            + "/provider=" + provider.toString();
      // Set cache manager class loader and apply name to cache manager MBean
      globalBuilder.classLoader(classLoader)
            .globalJmxStatistics().cacheManagerName(cacheManagerName);

      cm = new DefaultCacheManager(cbh, true);
      registerPredefinedCaches();
      status = Status.STARTED;
   }
View Full Code Here

      }
      else
      {
         // Reset the manager before storing it into the map since the default config is used as
         // template to define a new configuration
         manager = new DefaultCacheManager(gc);
         CacheManagerInstance cacheManagerInstance = new CacheManagerInstance(manager);
         cacheManagerInstance.acquire();
         CACHE_MANAGERS.put(clusterName, cacheManagerInstance);
         if (LOG.isInfoEnabled())
         {
View Full Code Here

      throw new RuntimeException(
          "Infinispan configuration file not found-->"+inConfigFile);

    System.out.println("CacheBuilder called with "+inConfigFile);
   
    cache_manager = new DefaultCacheManager(inConfigFile, false);
    //ShutdownHook shutdownHook = new ShutdownHook(cache_manager);
    //Runtime.getRuntime().addShutdownHook(shutdownHook);
  }
View Full Code Here

        TransactionSynchronizationRegistry txSyncRegistry = this.configuration.getTransactionSynchronizationRegistry();
        if (txSyncRegistry != null) {
            tx.transactionSynchronizationRegistryLookup(new TransactionSynchronizationRegistryProvider(txSyncRegistry));
        }

        EmbeddedCacheManager manager = new DefaultCacheManager(global, defaultConfig, false);
        manager.addListener(this);
        // Add named configurations
        for (Map.Entry<String, Configuration> entry: this.configuration.getConfigurations().entrySet()) {
            Configuration overrides = entry.getValue();
            Configuration configuration = defaults.getDefaultConfiguration(overrides.getCacheMode()).clone();
            configuration.applyOverrides(overrides);
            manager.defineConfiguration(entry.getKey(), configuration);
        }
        this.container = new DefaultEmbeddedCacheManager(manager, this.configuration.getDefaultCache());
        this.container.start();
    }
View Full Code Here

   public DemoDriver(InfinispanDirectory infinispanDirectory) {
      actions = new DemoActions(infinispanDirectory);
   }

   public static void main(String[] args) throws IOException {
      DefaultCacheManager cacheManager = new DefaultCacheManager("config-samples/lucene-demo-cache-config.xml");
      cacheManager.start();
      try {
         Cache cache = cacheManager.getCache();
         InfinispanDirectory directory = new InfinispanDirectory(cache);
         DemoDriver driver = new DemoDriver(directory);
         driver.run();
      }
      finally {
         cacheManager.stop();
      }
   }
View Full Code Here

   protected Cache<String, String> getReplicatedCache(String jgrousConfigFile) throws Exception {
      GlobalConfigurationBuilder globalConfig = new GlobalConfigurationBuilder();
      globalConfig.globalJmxStatistics().disable();
      globalConfig.globalJmxStatistics().mBeanServerLookup(null); //TODO remove once WFLY-3124 is fixed, for now fail JMX registration
      globalConfig.transport().defaultTransport().addProperty("configurationFile", jgrousConfigFile);
      EmbeddedCacheManager manager = new DefaultCacheManager(globalConfig.build());

      ConfigurationBuilder cacheConfig = new ConfigurationBuilder();
      cacheConfig.transaction().lockingMode(LockingMode.PESSIMISTIC);
      cacheConfig.invocationBatching().enable();
      cacheConfig.jmxStatistics().disable();
      cacheConfig.clustering().cacheMode(CacheMode.REPL_SYNC);

      manager.defineConfiguration(CACHE_NAME, cacheConfig.build());
      Cache<String, String> replicatedCache = manager.getCache(CACHE_NAME);
      return replicatedCache;
   }
View Full Code Here

public class DefaultEmbeddedCacheManager extends AbstractDelegatingEmbeddedCacheManager {

    private final String defaultCache;

    public DefaultEmbeddedCacheManager(GlobalConfiguration global, String defaultCache) {
        this(new DefaultCacheManager(global, null, false), defaultCache);
    }
View Full Code Here

    public DefaultEmbeddedCacheManager(GlobalConfiguration global, String defaultCache) {
        this(new DefaultCacheManager(global, null, false), defaultCache);
    }

    public DefaultEmbeddedCacheManager(GlobalConfiguration global, Configuration config, String defaultCache) {
        this(new DefaultCacheManager(global, config, false), defaultCache);
    }
View Full Code Here

TOP

Related Classes of org.infinispan.manager.DefaultCacheManager

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.