Package org.hibernate.cache

Examples of org.hibernate.cache.Region


    SecondLevelCacheStatistics slcs = ( SecondLevelCacheStatistics ) secondLevelCacheStatistics.get( regionName );
    if ( slcs == null ) {
      if ( sessionFactory == null ) {
        return null;
      }
      Region region = sessionFactory.getSecondLevelCacheRegion( regionName );
      if ( region == null ) {
        return null;
      }
      slcs = new SecondLevelCacheStatistics( region );
      secondLevelCacheStatistics.put( regionName, slcs );
View Full Code Here


    SecondLevelCacheStatistics slcs = ( SecondLevelCacheStatistics ) secondLevelCacheStatistics.get( regionName );
    if ( slcs == null ) {
      if ( sessionFactory == null ) {
        return null;
      }
      Region region = sessionFactory.getSecondLevelCacheRegion( regionName );
      if ( region == null ) {
        return null;
      }
      slcs = new SecondLevelCacheStatistics( region );
      secondLevelCacheStatistics.put( regionName, slcs );
View Full Code Here

    SecondLevelCacheStatistics slcs = ( SecondLevelCacheStatistics ) secondLevelCacheStatistics.get( regionName );
    if ( slcs == null ) {
      if ( sessionFactory == null ) {
        return null;
      }
      Region region = sessionFactory.getSecondLevelCacheRegion( regionName );
      if ( region == null ) {
        return null;
      }
      slcs = new SecondLevelCacheStatistics( region );
      secondLevelCacheStatistics.put( regionName, slcs );
View Full Code Here

    SecondLevelCacheStatisticsImpl slcs = (SecondLevelCacheStatisticsImpl) secondLevelCacheStatistics.get(regionName);
    if ( slcs == null ) {
      if ( sessionFactory == null ) {
        return null;
      }
      Region region = sessionFactory.getSecondLevelCacheRegion( regionName );
      if ( region == null ) {
        return null;
      }
      slcs = new SecondLevelCacheStatisticsImpl(region);
      secondLevelCacheStatistics.put( regionName, slcs );
View Full Code Here

        = (ConcurrentSecondLevelCacheStatisticsImpl) secondLevelCacheStatistics.get( regionName );
    if ( slcs == null ) {
      if ( sessionFactory == null ) {
        return null;
      }
      Region region = sessionFactory.getSecondLevelCacheRegion( regionName );
      if ( region == null ) {
        return null;
      }
      slcs = new ConcurrentSecondLevelCacheStatisticsImpl( region );
      ConcurrentSecondLevelCacheStatisticsImpl previous;
View Full Code Here

        = (ConcurrentSecondLevelCacheStatisticsImpl) secondLevelCacheStatistics.get(regionName);
    if (slcs == null) {
      if (sessionFactory == null) {
        return null;
      }
      Region region = sessionFactory.getSecondLevelCacheRegion(regionName);
      if (region == null) {
        return null;
      }
      slcs = new ConcurrentSecondLevelCacheStatisticsImpl(region);
      ConcurrentSecondLevelCacheStatisticsImpl previous;
View Full Code Here

    SecondLevelCacheStatisticsImpl slcs = (SecondLevelCacheStatisticsImpl) secondLevelCacheStatistics.get(regionName);
    if ( slcs == null ) {
      if ( sessionFactory == null ) {
        return null;
      }
      Region region = sessionFactory.getSecondLevelCacheRegion( regionName );
      if ( region == null ) {
        return null;
      }
      slcs = new SecondLevelCacheStatisticsImpl(region);
      secondLevelCacheStatistics.put( regionName, slcs );
View Full Code Here

        assertNull("No region node", remoteCache.getRoot().getChild( regionFqn ));
       
        Configuration cfg = CacheTestUtil.buildConfiguration("test", SharedJBossCacheRegionFactory.class, true, true);
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
       
        Region region = createRegion(regionFactory, "test/test", cfg.getProperties(), getCacheDataDescription());
       
        Cache localCache = getJBossCache( regionFactory );
       
        // This test assumes replication; verify that's correct
        assertEquals("Cache is REPL_SYNC", "REPL_SYNC", localCache.getConfiguration().getCacheModeString());
       
        // Region creation should not have affected remoteCache

        assertNull("No region node", remoteCache.getRoot().getChild( regionFqn ));
        Node regionRoot = localCache.getRoot().getChild( regionFqn );
        assertTrue("Has a node at " + regionFqn, regionRoot != null );
        assertTrue(regionFqn + " is resident", regionRoot.isResident() );
       
        // Confirm region destroy does not affect remote cache
       
        Option option = new Option();
        option.setCacheModeLocal(true);
        remoteCache.getInvocationContext().setOptionOverrides(option);
        remoteCache.put(regionFqn, "test", "test");
       
        assertEquals("Put succeeded", "test", remoteCache.get(regionFqn, "test"));
        assertNull("Put was local", localCache.get(regionFqn, "test"));
       
        region.destroy();
       
        assertEquals("Remote cache unchanged", "test", remoteCache.get(regionFqn, "test"));
        assertNull("No region node", localCache.getRoot().getChild( regionFqn ));
    }
View Full Code Here

   
    public void testToMap() throws Exception {
        Configuration cfg = CacheTestUtil.buildConfiguration("test", SharedJBossCacheRegionFactory.class, true, true);
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
       
        Region region = createRegion(regionFactory, "test/test", cfg.getProperties(), getCacheDataDescription());
       
        Map map = region.toMap();
        assertNotNull(map);
        assertEquals(0, map.size());
       
        putInRegion(region, "key1", "value1");
        putInRegion(region, "key2", "value2");
       
        map = region.toMap();
        assertNotNull(map);
        assertEquals(2, map.size());
        assertEquals("value1", map.get("key1"));
        assertEquals("value2", map.get("key2"));
       
        removeFromRegion(region, "key1");
       
        map = region.toMap();
        assertNotNull(map);
        assertEquals(1, map.size());
        assertEquals("value2", map.get("key2"));
    }
View Full Code Here

        = (ConcurrentSecondLevelCacheStatisticsImpl) secondLevelCacheStatistics.get( regionName );
    if ( slcs == null ) {
      if ( sessionFactory == null ) {
        return null;
      }
      Region region = sessionFactory.getSecondLevelCacheRegion( regionName );
      if ( region == null ) {
        return null;
      }
      slcs = new ConcurrentSecondLevelCacheStatisticsImpl( region );
      ConcurrentSecondLevelCacheStatisticsImpl previous;
View Full Code Here

TOP

Related Classes of org.hibernate.cache.Region

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.