Package org.hibernate.cache.infinispan.collection

Examples of org.hibernate.cache.infinispan.collection.CollectionRegionImpl


   /** {@inheritDoc} */
   public CollectionRegion buildCollectionRegion(String regionName, Properties properties, CacheDataDescription metadata) throws CacheException {
      if (log.isDebugEnabled()) log.debug("Building collection cache region [" + regionName + "]");
      AdvancedCache cache = getCache(regionName, COLLECTION_KEY, properties);
      CacheAdapter cacheAdapter = CacheAdapterImpl.newInstance(cache);
      CollectionRegionImpl region = new CollectionRegionImpl(cacheAdapter, regionName, metadata, transactionManager, this);
      startRegion(region, regionName);
      return region;
   }
View Full Code Here


   /** {@inheritDoc} */
   public CollectionRegion buildCollectionRegion(String regionName, Properties properties, CacheDataDescription metadata) throws CacheException {
      log.debug("Building collection cache region [" + regionName + "]");
      Cache cache = getCache(regionName, COLLECTION_KEY, properties);
      return new CollectionRegionImpl(cache, regionName, metadata, transactionManager);
   }
View Full Code Here

   /** {@inheritDoc} */
   public CollectionRegion buildCollectionRegion(String regionName, Properties properties, CacheDataDescription metadata) throws CacheException {
      if (log.isDebugEnabled()) log.debug("Building collection cache region [" + regionName + "]");
      Cache cache = getCache(regionName, COLLECTION_KEY, properties);
      CacheAdapter cacheAdapter = CacheAdapterImpl.newInstance(cache);
      CollectionRegionImpl region = new CollectionRegionImpl(cacheAdapter, regionName, metadata, transactionManager, this);
      region.start();
      return region;
   }
View Full Code Here

  public CollectionRegionImpl getCollectionRegion(String name, CacheDataDescription cacheDataDescription) {
    if ( collectionRegionMap == null ) {
      collectionRegionMap = new HashMap<String, CollectionRegionImpl>();
      return buildAndStoreCollectionRegion( name, cacheDataDescription );
    }
    CollectionRegionImpl region = collectionRegionMap.get( name );
    if ( region == null ) {
      region = buildAndStoreCollectionRegion( name, cacheDataDescription );
      collectionRegionMap.put( name, region );
    }
    return region;
View Full Code Here

    }
    return region;
  }

  private CollectionRegionImpl buildAndStoreCollectionRegion(String name, CacheDataDescription cacheDataDescription) {
    CollectionRegionImpl region;
    region = (CollectionRegionImpl) regionFactory.buildCollectionRegion(
        name,
        configuration.getProperties(),
        cacheDataDescription
    );
View Full Code Here

         assertEquals(EvictionStrategy.FIFO, cacheCfg.getEvictionStrategy());
         assertEquals(3000, cacheCfg.getEvictionWakeUpInterval());
         assertEquals(20000, cacheCfg.getEvictionMaxEntries());
         assertFalse(cacheCfg.isExposeJmxStatistics());

         CollectionRegionImpl collectionRegion = (CollectionRegionImpl) factory.buildCollectionRegion(addresses, p, null);
         assertNotNull(factory.getTypeOverrides().get(addresses));
         assertTrue(factory.getDefinedConfigurations().contains(person));
         assertNull(factory.getTypeOverrides().get(parts));
         cache = collectionRegion .getCache();
         cacheCfg = cache.getConfiguration();
         assertEquals(EvictionStrategy.FIFO, cacheCfg.getEvictionStrategy());
         assertEquals(2500, cacheCfg.getEvictionWakeUpInterval());
         assertEquals(5500, cacheCfg.getEvictionMaxEntries());
         assertEquals(65000, cacheCfg.getExpirationLifespan());
         assertEquals(35000, cacheCfg.getExpirationMaxIdle());
         assertFalse(cacheCfg.isExposeJmxStatistics());

         collectionRegion = (CollectionRegionImpl) factory.buildCollectionRegion(parts, p, null);
         assertNotNull(factory.getTypeOverrides().get(addresses));
         assertTrue(factory.getDefinedConfigurations().contains(addresses));
         assertNull(factory.getTypeOverrides().get(parts));
         cache = collectionRegion.getCache();
         cacheCfg = cache.getConfiguration();
         assertEquals(EvictionStrategy.LRU, cacheCfg.getEvictionStrategy());
         assertEquals(3500, cacheCfg.getEvictionWakeUpInterval());
         assertEquals(25000, cacheCfg.getEvictionMaxEntries());
         assertFalse(cacheCfg.isExposeJmxStatistics());

         collectionRegion = (CollectionRegionImpl) factory.buildCollectionRegion(parts, p, null);
         assertNotNull(factory.getTypeOverrides().get(addresses));
         assertTrue(factory.getDefinedConfigurations().contains(addresses));
         assertNull(factory.getTypeOverrides().get(parts));
         cache = collectionRegion.getCache();
         cacheCfg = cache.getConfiguration();
         assertEquals(EvictionStrategy.LRU, cacheCfg.getEvictionStrategy());
         assertEquals(3500, cacheCfg.getEvictionWakeUpInterval());
         assertEquals(25000, cacheCfg.getEvictionMaxEntries());
         assertFalse(cacheCfg.isExposeJmxStatistics());
View Full Code Here

         assertEquals(EvictionStrategy.FIFO, cacheCfg.getEvictionStrategy());
         assertEquals(3000, cacheCfg.getEvictionWakeUpInterval());
         assertEquals(30000, cacheCfg.getEvictionMaxEntries());
         assertEquals(100000, cacheCfg.getExpirationMaxIdle());

         CollectionRegionImpl collectionRegion = (CollectionRegionImpl) factory.buildCollectionRegion("com.acme.Person.addresses", p, null);
         assertNull(factory.getTypeOverrides().get("com.acme.Person.addresses"));
         cache = collectionRegion.getCache();
         cacheCfg = cache.getConfiguration();
         assertEquals(EvictionStrategy.LRU, cacheCfg.getEvictionStrategy());
         assertEquals(3500, cacheCfg.getEvictionWakeUpInterval());
         assertEquals(35000, cacheCfg.getEvictionMaxEntries());
         assertEquals(100000, cacheCfg.getExpirationMaxIdle());
View Full Code Here

         TimestampsRegionImpl timestampsRegion = (TimestampsRegionImpl) factory.buildTimestampsRegion(timestamps, p);
         cache = timestampsRegion.getCache();
         assertTrue(factory.getTypeOverrides().get("timestamps").isExposeStatistics());
         assertTrue(cache.getConfiguration().isExposeJmxStatistics());

         CollectionRegionImpl collectionRegion = (CollectionRegionImpl) factory.buildCollectionRegion("com.acme.Person.addresses", p, null);
         cache = collectionRegion.getCache();
         assertTrue(factory.getTypeOverrides().get("collection").isExposeStatistics());
         assertTrue(cache.getConfiguration().isExposeJmxStatistics());
      } finally {
         factory.stop();
      }
View Full Code Here

         TimestampsRegionImpl timestampsRegion = (TimestampsRegionImpl) factory.buildTimestampsRegion(timestamps, p);
         cache = timestampsRegion.getCache();
         assertFalse(factory.getTypeOverrides().get("timestamps").isExposeStatistics());
         assertFalse(cache.getConfiguration().isExposeJmxStatistics());

         CollectionRegionImpl collectionRegion = (CollectionRegionImpl) factory.buildCollectionRegion("com.acme.Person.addresses", p, null);
         cache = collectionRegion.getCache();
         assertFalse(factory.getTypeOverrides().get("collection").isExposeStatistics());
         assertFalse(cache.getConfiguration().isExposeJmxStatistics());
      } finally {
         factory.stop();
      }
View Full Code Here

   /** {@inheritDoc} */
   public CollectionRegion buildCollectionRegion(String regionName, Properties properties, CacheDataDescription metadata) throws CacheException {
      if (log.isDebugEnabled()) log.debug("Building collection cache region [" + regionName + "]");
      AdvancedCache cache = getCache(regionName, COLLECTION_KEY, properties);
      CacheAdapter cacheAdapter = CacheAdapterImpl.newInstance(cache);
      CollectionRegionImpl region = new CollectionRegionImpl(cacheAdapter, regionName, metadata, transactionManager, this);
      startRegion(region, regionName);
      return region;
   }
View Full Code Here

TOP

Related Classes of org.hibernate.cache.infinispan.collection.CollectionRegionImpl

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.