Package org.infinispan.manager

Examples of org.infinispan.manager.DefaultCacheManager


            if (log.isDebugEnabled()) {
                log.debug("Infinispan Cache Mode : local");
            }
        }
        configuration.setExposeJmxStatistics(true);
        cacheManager = new DefaultCacheManager(globalConfiguration, configuration);
        log.debug("Successfully Initialized Infinispan Cache Manager");
    }
View Full Code Here


      }
   }

   public void testTimestampValidation() {
      Properties p = new Properties();
      final DefaultCacheManager manager = new DefaultCacheManager();
      InfinispanRegionFactory factory = new InfinispanRegionFactory() {
         @Override
         protected EmbeddedCacheManager createCacheManager(Properties properties) throws CacheException {
            return manager;
         }
      };
      Configuration config = new Configuration();
      config.setCacheMode(CacheMode.INVALIDATION_SYNC);
      manager.defineConfiguration("timestamps", config);
      try {
         factory.start(null, p);
         fail("Should have failed saying that invalidation is not allowed for timestamp caches.");
      } catch(CacheException ce) {
      }
View Full Code Here

            namingMain.start();
            props = new Properties();
            props.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
            props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");

            manager = new DefaultCacheManager(InfinispanRegionFactory.DEF_INFINISPAN_CONFIG_RESOURCE, false);
            Context ctx = new InitialContext(props);
            bind(JNDI_NAME, manager, EmbeddedCacheManager.class, ctx);
         } catch(Exception e) {
            throw new RuntimeException("Failure to set up JNDI", e);
         }
View Full Code Here

    */
   public void testGetCache() throws Exception
   {
      // Create cache manager
      GlobalConfiguration myGlobalConfig = new GlobalConfigurationBuilder().build();
      EmbeddedCacheManager manager = new DefaultCacheManager(myGlobalConfig);

      // Create a cache
      Configuration config = new ConfigurationBuilder().build();
      manager.defineConfiguration("cache", config);
      Cache<String, String> cache = manager.getCache("cache");

      cache.put("key", "value");
      assertTrue(cache.size() == 1);
      assertTrue(cache.containsKey("key"));

View Full Code Here

    */
   public void testJGroupTransportPhysicalAddress() throws Exception
   {
      GlobalConfiguration myGlobalConfig = new GlobalConfigurationBuilder().clusteredDefault().build();
      // Create cache manager
      EmbeddedCacheManager manager = new DefaultCacheManager(myGlobalConfig);

      // Create a cache
      Cache<String, String> cache = manager.getCache();
     
      assertTrue(manager.getCoordinator() instanceof JGroupsAddress);
      assertTrue(manager.getTransport() instanceof JGroupsTransport);
   }
View Full Code Here

    */
   public void testGetClusterCache() throws Exception
   {
      GlobalConfiguration myGlobalConfig = new GlobalConfigurationBuilder().clusteredDefault().build();
      // Create cache manager
      EmbeddedCacheManager manager = new DefaultCacheManager(myGlobalConfig);

      // Create a cache
      Cache<String, String> cache = manager.getCache();

      cache.put("key", "value");
      assertTrue(cache.size() == 1);
      assertTrue(cache.containsKey("key"));

View Full Code Here

    private final BatcherFactory batcherFactory;
    private final String defaultCacheName;

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

    public DefaultCacheContainer(GlobalConfiguration global, String defaultCacheName) {
        this(new DefaultCacheManager(global, null, false), defaultCacheName);
    }

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

         manager = SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<EmbeddedCacheManager>()
         {
            public EmbeddedCacheManager run() throws IOException
            {
               DefaultCacheManager manager = new DefaultCacheManager(configStream, false);
               loadJGroupsConfig(manager);
               return getUniqueInstance(regionIdEscaped, manager);
            }
         });

      }
      catch (IOException e)
      {
         throw new RepositoryConfigurationException(e);
      }

      PrivilegedAction<Cache<K, V>> action = new PrivilegedAction<Cache<K, V>>()
      {
         public Cache<K, V> run()
         {
            return manager.getCache(regionIdEscaped);
         }
      };
      Cache<K, V> cache = SecurityHelper.doPrivilegedAction(action);

      return cache;
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);
         CACHE_MANAGERS.put(gc, manager);
         if (log.isInfoEnabled())
         {
            log.info("A new ISPN Cache Manager instance has been registered for the region " + regionId
               + " and the container " + container.getContext().getName());
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.