Package org.infinispan.factories

Examples of org.infinispan.factories.GlobalComponentRegistry


    */
   public DefaultCacheManager(GlobalConfiguration globalConfiguration, Configuration defaultConfiguration,
                              boolean start) {
      this.globalConfiguration = globalConfiguration == null ? new GlobalConfigurationBuilder().build() : globalConfiguration;
      this.defaultConfiguration = defaultConfiguration == null ? new ConfigurationBuilder().build() : defaultConfiguration;
      this.globalComponentRegistry = new GlobalComponentRegistry(this.globalConfiguration, this, caches.keySet());
      this.authzHelper = new AuthorizationHelper(this.globalConfiguration.security(), AuditContext.CACHEMANAGER, this.globalConfiguration.globalJmxStatistics().cacheManagerName());
      if (start)
         start();
   }
View Full Code Here


            ConfigurationBuilder builder = entry.getValue();
            org.infinispan.configuration.cache.Configuration c = builder.build(globalConfiguration);
            configurationOverrides.put(entry.getKey(), c);
         }

         globalComponentRegistry = new GlobalComponentRegistry(globalConfiguration, this, caches.keySet());
         authzHelper = new AuthorizationHelper(globalConfiguration.security(), AuditContext.CACHEMANAGER, globalConfiguration.globalJmxStatistics().cacheManagerName());
      } catch (CacheConfigurationException ce) {
         throw ce;
      } catch (RuntimeException re) {
         throw new CacheConfigurationException(re);
View Full Code Here

         Entry<String, ConfigurationBuilder> entry = namedConfigurationBuilderHolder.getNamedConfigurationBuilders().entrySet().iterator().next();
         ConfigurationBuilder builder = entry.getValue();
         configurationOverrides.put(entry.getKey(), builder.build(globalConfiguration));
      }

      globalComponentRegistry = new GlobalComponentRegistry(this.globalConfiguration, this, caches.keySet());
      authzHelper = new AuthorizationHelper(globalConfiguration.security(), AuditContext.CACHEMANAGER, globalConfiguration.globalJmxStatistics().cacheManagerName());
      if (start)
         start();
   }
View Full Code Here

      c.jmxStatistics().enable().dataContainer().invocationBatching().enable();
      return TestCacheManagerFactory.createCacheManager(c);
   }

   public void testSimple() throws Exception {
      GlobalComponentRegistry gcr = TestingUtil.extractGlobalComponentRegistry(this.cacheManager);
      Interpreter interpreter = gcr.getComponent(Interpreter.class);
      String sessionId = interpreter.createSessionId(BasicCacheContainer.DEFAULT_CACHE_NAME);
      interpreter.execute(sessionId, "put 'a' 'b'; get 'a';");
      interpreter
            .execute(sessionId, "put 'c' {\"org.infinispan.cli.interpreter.MyClass\":{\"i\":5,\"x\":null,\"b\":true}};");
      Object o = cache.get("c");
View Full Code Here

      Double f = (Double) cache.get("f");
      assert f == 0.5;
   }

   public void testCacheQualifier() throws Exception {
      GlobalComponentRegistry gcr = TestingUtil.extractGlobalComponentRegistry(this.cacheManager);
      Interpreter interpreter = gcr.getComponent(Interpreter.class);
      String sessionId = interpreter.createSessionId(BasicCacheContainer.DEFAULT_CACHE_NAME);
      Cache<Object, Object> otherCache = cacheManager.getCache("otherCache");
      interpreter.execute(sessionId, "put 'a' 'a'; put 'otherCache'.'b' 'b'; cache 'otherCache'; put 'c' 'c';");
      Object a = cache.get("a");
      assert a.equals("a");
View Full Code Here

      Object c = otherCache.get("c");
      assert c.equals("c");
   }

   public void testBatching() throws Exception {
      GlobalComponentRegistry gcr = TestingUtil.extractGlobalComponentRegistry(this.cacheManager);
      Interpreter interpreter = gcr.getComponent(Interpreter.class);
      String sessionId = interpreter.createSessionId(BasicCacheContainer.DEFAULT_CACHE_NAME);
      interpreter.execute(sessionId, "start; put 'a' 'a'; put 'b' 'b'; end;");
      Object a = cache.get("a");
      assert a.equals("a");
      Object b = cache.get("b");
View Full Code Here

      Object b = cache.get("b");
      assert b.equals("b");
   }

   public void testTx() throws Exception {
      GlobalComponentRegistry gcr = TestingUtil.extractGlobalComponentRegistry(this.cacheManager);
      Interpreter interpreter = gcr.getComponent(Interpreter.class);
      String sessionId = interpreter.createSessionId(BasicCacheContainer.DEFAULT_CACHE_NAME);
      interpreter.execute(sessionId, "begin; put 'a' 'a'; commit;");
      Object a = cache.get("a");
      assert a.equals("a");
      interpreter.execute(sessionId, "begin; put 'b' 'b'; rollback;");
View Full Code Here

      interpreter.execute(sessionId, "begin; put 'b' 'b'; rollback;");
      assert !cache.containsKey("b");
   }

   public void testDangling() throws Exception {
      GlobalComponentRegistry gcr = TestingUtil.extractGlobalComponentRegistry(this.cacheManager);
      Interpreter interpreter = gcr.getComponent(Interpreter.class);
      String sessionId = interpreter.createSessionId(BasicCacheContainer.DEFAULT_CACHE_NAME);
      interpreter.execute(sessionId, "begin; put 'a' 'a';");
      assert cache.getAdvancedCache().getTransactionManager().getTransaction() == null;
      assert !cache.containsKey("a");
      interpreter.execute(sessionId, "start; put 'a' 'a';");
View Full Code Here

      assert cache.getAdvancedCache().getBatchContainer().getBatchTransaction() == null;
      assert !cache.containsKey("a");
   }

   public void testRemove() throws Exception {
      GlobalComponentRegistry gcr = TestingUtil.extractGlobalComponentRegistry(this.cacheManager);
      Interpreter interpreter = gcr.getComponent(Interpreter.class);
      String sessionId = interpreter.createSessionId(BasicCacheContainer.DEFAULT_CACHE_NAME);
      interpreter.execute(sessionId, "put 'a' 'a';");
      Object a = cache.get("a");
      assert a.equals("a");
      interpreter.execute(sessionId, "remove 'a';");
View Full Code Here

      interpreter.execute(sessionId, "remove 'b' 'c';");
      assert cache.containsKey("b");
   }

   public void testReplace() throws Exception {
      GlobalComponentRegistry gcr = TestingUtil.extractGlobalComponentRegistry(this.cacheManager);
      Interpreter interpreter = gcr.getComponent(Interpreter.class);
      String sessionId = interpreter.createSessionId(BasicCacheContainer.DEFAULT_CACHE_NAME);
      interpreter.execute(sessionId, "put 'a' 'a';");
      Object a = cache.get("a");
      assert a.equals("a");
      interpreter.execute(sessionId, "replace 'a' 'b';");
View Full Code Here

TOP

Related Classes of org.infinispan.factories.GlobalComponentRegistry

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.