Package org.infinispan.configuration.cache

Examples of org.infinispan.configuration.cache.CacheLoaderConfiguration


            CacheLoader l = createCacheLoader(LegacyConfigurationAdaptor.adapt(cfg), cache);
            ccl.addCacheLoader(l, cfg);
         }
      } else {
         if (!clmConfig.cacheLoaders().isEmpty()) {
            CacheLoaderConfiguration cfg = clmConfig.cacheLoaders().get(0);
            if (cfg instanceof CacheStoreConfiguration)
               assertNotSingletonAndShared((CacheStoreConfiguration) cfg);
            tmpLoader = createCacheLoader(LegacyConfigurationAdaptor.adapt(cfg), cache);
         } else {
            return null;
View Full Code Here


      try {
         cm = TestCacheManagerFactory.fromXml("configs/managed/str-managed-connection-factory.xml");
         Cache<String, String> first = cm.getCache("first");
         Cache<String, String> second = cm.getCache("second");

         CacheLoaderConfiguration firstCacheLoaderConfig = first.getCacheConfiguration().loaders().cacheLoaders().get(0);
         assert firstCacheLoaderConfig != null;
         CacheLoaderConfiguration secondCacheLoaderConfig = second.getCacheConfiguration().loaders().cacheLoaders().get(0);
         assert secondCacheLoaderConfig != null;
         assert firstCacheLoaderConfig instanceof JdbcStringBasedCacheStoreConfiguration;
         assert secondCacheLoaderConfig instanceof JdbcStringBasedCacheStoreConfiguration;
         CacheLoaderManager cacheLoaderManager = first.getAdvancedCache().getComponentRegistry().getComponent(CacheLoaderManager.class);
         JdbcStringBasedCacheStore loader = (JdbcStringBasedCacheStore) cacheLoaderManager.getCacheLoader();
View Full Code Here

      CacheStore cs = getCacheStore();
      if (cs != null) {
         if ((cs instanceof ChainingCacheStore) && !force) {
            ((ChainingCacheStore) loader).purgeIfNecessary();
         } else {
            CacheLoaderConfiguration first = clmConfig.cacheLoaders().get(0);
            if (force || (first != null && first instanceof CacheStoreConfiguration && ((CacheStoreConfiguration)first).purgeOnStartup())) {
               cs.clear();
            }
         }
      }
View Full Code Here

            CacheLoader l = createCacheLoader(LegacyConfigurationAdaptor.adapt(cfg), cache);
            ccl.addCacheLoader(l, cfg);
         }
      } else {
         if (!clmConfig.cacheLoaders().isEmpty()) {
            CacheLoaderConfiguration cfg = clmConfig.cacheLoaders().get(0);
            if (cfg instanceof CacheStoreConfiguration)
               assertNotSingletonAndShared((CacheStoreConfiguration) cfg);
            tmpLoader = createCacheLoader(LegacyConfigurationAdaptor.adapt(cfg), cache);
         } else {
            return null;
View Full Code Here

      try {
         cm = TestCacheManagerFactory.fromXml("configs/managed/mixed-managed-connection-factory.xml");
         Cache<String, String> first = cm.getCache("first");
         Cache<String, String> second = cm.getCache("second");

         CacheLoaderConfiguration firstCacheLoaderConfig = first.getCacheConfiguration().loaders().cacheLoaders().get(0);
         assert firstCacheLoaderConfig != null;
         CacheLoaderConfiguration secondCacheLoaderConfig = second.getCacheConfiguration().loaders().cacheLoaders().get(0);
         assert secondCacheLoaderConfig != null;
         assert firstCacheLoaderConfig instanceof JdbcMixedCacheStoreConfiguration;
         assert secondCacheLoaderConfig instanceof JdbcMixedCacheStoreConfiguration;
         CacheLoaderManager cacheLoaderManager = first.getAdvancedCache().getComponentRegistry().getComponent(CacheLoaderManager.class);
         JdbcMixedCacheStore loader = (JdbcMixedCacheStore) cacheLoaderManager.getCacheLoader();
View Full Code Here

      try {
         cm = TestCacheManagerFactory.fromXml("configs/managed/binary-managed-connection-factory.xml");
         Cache<String, String> first = cm.getCache("first");
         Cache<String, String> second = cm.getCache("second");

         CacheLoaderConfiguration firstCacheLoaderConfig = first.getCacheConfiguration().loaders().cacheLoaders().get(0);
         assert firstCacheLoaderConfig != null;
         CacheLoaderConfiguration secondCacheLoaderConfig = second.getCacheConfiguration().loaders().cacheLoaders().get(0);
         assert secondCacheLoaderConfig != null;
         assert firstCacheLoaderConfig instanceof JdbcBinaryCacheStoreConfiguration;
         assert secondCacheLoaderConfig instanceof JdbcBinaryCacheStoreConfiguration;
         CacheLoaderManager cacheLoaderManager = first.getAdvancedCache().getComponentRegistry().getComponent(CacheLoaderManager.class);
         JdbcBinaryCacheStore loader = (JdbcBinaryCacheStore) cacheLoaderManager.getCacheLoader();
View Full Code Here

      CacheStore cs = getCacheStore();
      if (cs != null) {
         if ((cs instanceof ChainingCacheStore) && !force) {
            ((ChainingCacheStore) loader).purgeIfNecessary();
         } else {
            CacheLoaderConfiguration first = clmConfig.cacheLoaders().get(0);
            if (force || (first != null && first instanceof CacheStoreConfiguration && ((CacheStoreConfiguration)first).purgeOnStartup())) {
               cs.clear();
            }
         }
      }
View Full Code Here

            CacheLoader l = createCacheLoader(LegacyConfigurationAdaptor.adapt(cfg), cache);
            ccl.addCacheLoader(l, cfg);
         }
      } else {
         if (!clmConfig.cacheLoaders().isEmpty()) {
            CacheLoaderConfiguration cfg = clmConfig.cacheLoaders().get(0);
            if (cfg instanceof CacheStoreConfiguration)
               assertNotSingletonAndShared((CacheStoreConfiguration) cfg);
            tmpLoader = createCacheLoader(LegacyConfigurationAdaptor.adapt(cfg), cache);
         } else {
            return null;
View Full Code Here

        .addLoader(JpaCacheStoreConfigurationBuilder.class)
        .persistenceUnitName("org.infinispan.loaders.jpa.configurationTest")
        .entityClass(User.class).build();
   
   
    CacheLoaderConfiguration cacheLoaderConfig = cacheConfig.loaders().cacheLoaders().get(0);
    assert cacheLoaderConfig instanceof JpaCacheStoreConfiguration;
    JpaCacheStoreConfiguration jpaCacheLoaderConfig = (JpaCacheStoreConfiguration) cacheLoaderConfig;
    assert jpaCacheLoaderConfig.persistenceUnitName().equals("org.infinispan.loaders.jpa.configurationTest");
    assert jpaCacheLoaderConfig.entityClass().equals(User.class);
View Full Code Here

    userCache.stop();
    cacheManager.stop();
  }
 
  protected void validateConfig(Cache<VehicleId, Vehicle> vehicleCache) {
     CacheLoaderConfiguration config = vehicleCache.getCacheConfiguration().loaders().cacheLoaders().get(0);
    
     if (config instanceof JpaCacheStoreConfiguration) {
        JpaCacheStoreConfiguration jpaConfig = (JpaCacheStoreConfiguration) config;
        assert jpaConfig.batchSize() == 1;
         assert jpaConfig.entityClass().equals(Vehicle.class) : jpaConfig.entityClass() + " != " + Vehicle.class;
         assert jpaConfig.persistenceUnitName().equals("org.infinispan.loaders.jpa.configurationTest") : jpaConfig.persistenceUnitName() + " != " + "org.infinispan.loaders.jpa.configurationTest";
     } else {
        assert false : "Unknown configuation class " + config.getClass();
     }
  }
View Full Code Here

TOP

Related Classes of org.infinispan.configuration.cache.CacheLoaderConfiguration

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.