Package org.hibernate.cache.jbc

Examples of org.hibernate.cache.jbc.CacheInstanceManager


        Configuration cfg = CacheTestUtil.buildConfiguration("", JBossCacheRegionFactory.class, true, true);
       
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
       
        CacheInstanceManager mgr = regionFactory.getCacheInstanceManager();
        assertTrue("Correct default CacheInstanceManager type", mgr instanceof SharedCacheInstanceManager);
       
        Cache cache = mgr.getEntityCacheInstance();
        assertTrue("entity cache exists", cache != null);
        assertEquals("Used correct config", "TestSharedCache", cache.getConfiguration().getClusterName());
        assertEquals("Cache started", CacheStatus.STARTED, cache.getCacheStatus());       
       
        CacheTestUtil.stopRegionFactory(regionFactory, getCacheTestSupport());
View Full Code Here


   
    public void testInjectedCacheInstanceManager() {

        Configuration cfg = CacheTestUtil.buildConfiguration("", JBossCacheRegionFactory.class, true, true);
       
        CacheInstanceManager cim = new MultiplexingCacheInstanceManager();
        JBossCacheRegionFactory regionFactory = new JBossCacheRegionFactory(cim);
       
        Settings settings = cfg.buildSettings();
        Properties properties = cfg.getProperties();
       
View Full Code Here

    public void testUse2ndLevelCache() throws Exception {
        Configuration cfg = CacheTestUtil.buildConfiguration("", getRegionFactoryClass(), false, true);
       
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
       
        CacheInstanceManager cim = regionFactory.getCacheInstanceManager();
       
        assertNull(cim.getCollectionCacheInstance());
        assertNull(cim.getEntityCacheInstance());
        assertNotNull(cim.getQueryCacheInstance());
        assertNotNull(cim.getTimestampsCacheInstance());
    }
View Full Code Here

    public void testUseQueryCache() throws Exception {
        Configuration cfg = CacheTestUtil.buildConfiguration("", getRegionFactoryClass(), true, false);
       
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
       
        CacheInstanceManager cim = regionFactory.getCacheInstanceManager();
       
        assertNotNull(cim.getCollectionCacheInstance());
        assertNotNull(cim.getEntityCacheInstance());
        assertNull(cim.getQueryCacheInstance());
        assertNull(cim.getTimestampsCacheInstance());
    }
View Full Code Here

        return regionFactory.buildEntityRegion(regionName, properties, cdd);
    }

    @Override
    protected Cache getJBossCache(JBossCacheRegionFactory regionFactory) {
        CacheInstanceManager mgr = regionFactory.getCacheInstanceManager();
        return mgr.getEntityCacheInstance();
    }
View Full Code Here

        return regionFactory.buildCollectionRegion(regionName, properties, cdd);
    }

    @Override
    protected Cache getJBossCache(JBossCacheRegionFactory regionFactory) {
        CacheInstanceManager mgr = regionFactory.getCacheInstanceManager();
        return mgr.getCollectionCacheInstance();
    }
View Full Code Here

    }
   
    private Cache createCache() throws Exception {
        Configuration cfg = CacheTestUtil.buildConfiguration("test", MultiplexedJBossCacheRegionFactory.class, false, true);
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg);
        CacheInstanceManager mgr = regionFactory.getCacheInstanceManager();
        return mgr.getTimestampsCacheInstance();
    }
View Full Code Here

        return regionFactory.buildTimestampsRegion(regionName, properties);
    }

    @Override
    protected Cache getJBossCache(JBossCacheRegionFactory regionFactory) {
        CacheInstanceManager mgr = regionFactory.getCacheInstanceManager();
        return mgr.getTimestampsCacheInstance();
    }
View Full Code Here

        return regionPrefix + "/" + StandardQueryCache.class.getName();
    }

    @Override
    protected Cache getJBossCache(JBossCacheRegionFactory regionFactory) {
        CacheInstanceManager mgr = regionFactory.getCacheInstanceManager();
        return mgr.getQueryCacheInstance();
    }
View Full Code Here

TOP

Related Classes of org.hibernate.cache.jbc.CacheInstanceManager

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.