Package org.hibernate.cache.jbc2

Examples of org.hibernate.cache.jbc2.JBossCacheRegionFactory


    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();
       
        regionFactory.start(settings, properties);       
        // Ensure we clean up
        registerFactory(regionFactory);
       
        assertEquals("Used injected CacheInstanceManager", cim, regionFactory.getCacheInstanceManager());
       
        CacheTestUtil.stopRegionFactory(regionFactory, getCacheTestSupport());
    }
View Full Code Here


       
        Configuration cfg = CacheTestUtil.buildConfiguration("test", MultiplexedJBossCacheRegionFactory.class, true, false);
        String entityCfg = optimistic ? "optimistic-entity" : "pessimistic-entity";
        cfg.setProperty(MultiplexingCacheInstanceManager.ENTITY_CACHE_RESOURCE_PROP, entityCfg);
       
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
       
        supportedAccessTypeTest(regionFactory, cfg.getProperties());
    }
View Full Code Here

    public void testIsTransactionAware() throws Exception {
       
        Configuration cfg = CacheTestUtil.buildConfiguration("test", SharedJBossCacheRegionFactory.class, true, false);
        cfg.setProperty(SharedCacheInstanceManager.CACHE_RESOURCE_PROP, CacheTestUtil.LOCAL_PESSIMISTIC_CACHE);
       
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
       
        TransactionalDataRegion region = (TransactionalDataRegion) createRegion(regionFactory, "test/test", cfg.getProperties(), getCacheDataDescription());
       
        assertTrue("Region is transaction-aware", region.isTransactionAware());
       
View Full Code Here

   
    public void testGetCacheDataDescription() throws Exception {
        Configuration cfg = CacheTestUtil.buildConfiguration("test", SharedJBossCacheRegionFactory.class, true, false);
        cfg.setProperty(SharedCacheInstanceManager.CACHE_RESOURCE_PROP, CacheTestUtil.LOCAL_PESSIMISTIC_CACHE);
       
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
       
        TransactionalDataRegion region = (TransactionalDataRegion) createRegion(regionFactory, "test/test", cfg.getProperties(), getCacheDataDescription());
       
        CacheDataDescription cdd = region.getCacheDataDescription();
       
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
       
        if (getCollectionAccessStrategy() == null) {
            Configuration cfg = createConfiguration();
            JBossCacheRegionFactory rf  = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
            Cache localCache = rf.getCacheInstanceManager().getEntityCacheInstance();
            optimistic = localCache.getConfiguration().getNodeLockingScheme() == org.jboss.cache.config.Configuration.NodeLockingScheme.OPTIMISTIC;
           
            // Sleep a bit to avoid concurrent FLUSH problem
            avoidConcurrentFlush();
           
            CollectionRegion localCollectionRegion = rf.buildCollectionRegion(REGION_NAME, cfg.getProperties(), null);
            setCollectionAccessStrategy(localCollectionRegion.buildAccessStrategy(getAccessType()));
        }
    }
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
       
        if (getEntityAccessStrategy() == null) {
            Configuration cfg = createConfiguration();
            JBossCacheRegionFactory rf  = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
            Cache localCache = rf.getCacheInstanceManager().getEntityCacheInstance();
            optimistic = localCache.getConfiguration().getNodeLockingScheme() == org.jboss.cache.config.Configuration.NodeLockingScheme.OPTIMISTIC;
           
            // Sleep a bit to avoid concurrent FLUSH problem
            avoidConcurrentFlush();
           
            EntityRegion localEntityRegion = rf.buildEntityRegion(REGION_NAME, cfg.getProperties(), null);
            setEntityRegionAccessStrategy(localEntityRegion.buildAccessStrategy(getAccessType()));
        }
    }
View Full Code Here

    }
   
    private void putDoesNotBlockGetTest(String configName) throws Exception {
       
        Configuration cfg = createConfiguration(configName);
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
       
        // Sleep a bit to avoid concurrent FLUSH problem
        avoidConcurrentFlush();

        final QueryResultsRegion region = regionFactory.buildQueryResultsRegion(getStandardRegionName(REGION_PREFIX), cfg.getProperties());
       
        region.put(KEY, VALUE1);
        assertEquals(VALUE1, region.get(KEY));

        final CountDownLatch readerLatch = new CountDownLatch(1);
View Full Code Here

    }
   
    private void getDoesNotBlockPutTest(String configName) throws Exception {
       
        Configuration cfg = createConfiguration(configName);
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
       
        // Sleep a bit to avoid concurrent FLUSH problem
        avoidConcurrentFlush();
       
        final QueryResultsRegion region = regionFactory.buildQueryResultsRegion(getStandardRegionName(REGION_PREFIX), cfg.getProperties());
       
        region.put(KEY, VALUE1);
        assertEquals(VALUE1, region.get(KEY));
       
        final Fqn rootFqn = getRegionFqn(getStandardRegionName(REGION_PREFIX), REGION_PREFIX);
View Full Code Here

    }

    private void evictOrRemoveTest(String configName) throws Exception {
   
        Configuration cfg = createConfiguration(configName);
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
        Cache localCache = getJBossCache(regionFactory);
        boolean invalidation = CacheHelper.isClusteredInvalidation(localCache);
       
        // Sleep a bit to avoid concurrent FLUSH problem
        avoidConcurrentFlush();
View Full Code Here

    }

    private void evictOrRemoveAllTest(String configName) throws Exception {
   
        Configuration cfg = createConfiguration(configName);
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
        Cache localCache = getJBossCache(regionFactory);
        boolean optimistic = "OPTIMISTIC".equals(localCache.getConfiguration().getNodeLockingSchemeString());
        boolean invalidation = CacheHelper.isClusteredInvalidation(localCache);
       
        // Sleep a bit to avoid concurrent FLUSH problem
View Full Code Here

TOP

Related Classes of org.hibernate.cache.jbc2.JBossCacheRegionFactory

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.