Package org.hibernate.cache

Examples of org.hibernate.cache.RegionFactory


     * @param sessionFactory
     * @return currently used <code>HazelcastInstance</code> or null if an error occurs.
     */
    public static HazelcastInstance getHazelcastInstance(final SessionFactoryImplementor sessionFactory) {
        final Settings settings = sessionFactory.getSettings();
        final RegionFactory rf = settings.getRegionFactory();
        if (rf == null) {
            logger.severe("Hibernate 2nd level cache has not been enabled!");
            return null;
        }
        if (rf instanceof AbstractHazelcastCacheRegionFactory) {
View Full Code Here


    DEFAULT_CACHE_CONCURRENCY_STRATEGY = strategy;
  }

  private static CacheConcurrencyStrategy determineCacheConcurrencyStrategy(ExtendedMappings mappings) {
    if ( DEFAULT_CACHE_CONCURRENCY_STRATEGY == null ) {
      final RegionFactory cacheRegionFactory = SettingsFactory.createRegionFactory( mappings.getConfigurationProperties(), true );
      DEFAULT_CACHE_CONCURRENCY_STRATEGY = CacheConcurrencyStrategy.fromAccessType( cacheRegionFactory.getDefaultAccessType() );
    }
    return DEFAULT_CACHE_CONCURRENCY_STRATEGY;
  }
View Full Code Here

    DEFAULT_CACHE_CONCURRENCY_STRATEGY = strategy;
  }

  private static CacheConcurrencyStrategy determineCacheConcurrencyStrategy(Mappings mappings) {
    if ( DEFAULT_CACHE_CONCURRENCY_STRATEGY == null ) {
      final RegionFactory cacheRegionFactory = SettingsFactory.createRegionFactory(
          mappings.getConfigurationProperties(), true
      );
      DEFAULT_CACHE_CONCURRENCY_STRATEGY = CacheConcurrencyStrategy.fromAccessType( cacheRegionFactory.getDefaultAccessType() );
    }
    return DEFAULT_CACHE_CONCURRENCY_STRATEGY;
  }
View Full Code Here

    DEFAULT_CACHE_CONCURRENCY_STRATEGY = strategy;
  }

  private static CacheConcurrencyStrategy determineCacheConcurrencyStrategy(Mappings mappings) {
    if ( DEFAULT_CACHE_CONCURRENCY_STRATEGY == null ) {
      final RegionFactory cacheRegionFactory = SettingsFactory.createRegionFactory(
          mappings.getConfigurationProperties(), true
      );
      DEFAULT_CACHE_CONCURRENCY_STRATEGY = CacheConcurrencyStrategy.fromAccessType( cacheRegionFactory.getDefaultAccessType() );
    }
    return DEFAULT_CACHE_CONCURRENCY_STRATEGY;
  }
View Full Code Here

    DEFAULT_CACHE_CONCURRENCY_STRATEGY = strategy;
  }

  private static CacheConcurrencyStrategy determineCacheConcurrencyStrategy(Mappings mappings) {
    if ( DEFAULT_CACHE_CONCURRENCY_STRATEGY == null ) {
      final RegionFactory cacheRegionFactory = SettingsFactory.createRegionFactory(
          mappings.getConfigurationProperties(), true
      );
      DEFAULT_CACHE_CONCURRENCY_STRATEGY = CacheConcurrencyStrategy.fromAccessType( cacheRegionFactory.getDefaultAccessType() );
    }
    return DEFAULT_CACHE_CONCURRENCY_STRATEGY;
  }
View Full Code Here

    DEFAULT_CACHE_CONCURRENCY_STRATEGY = strategy;
  }

  private static CacheConcurrencyStrategy determineCacheConcurrencyStrategy(ExtendedMappings mappings) {
    if ( DEFAULT_CACHE_CONCURRENCY_STRATEGY == null ) {
      final RegionFactory cacheRegionFactory = SettingsFactory.createRegionFactory(
          mappings.getConfigurationProperties(), true
      );
      DEFAULT_CACHE_CONCURRENCY_STRATEGY = CacheConcurrencyStrategy.fromAccessType( cacheRegionFactory.getDefaultAccessType() );
    }
    return DEFAULT_CACHE_CONCURRENCY_STRATEGY;
  }
View Full Code Here

    * @{inheritDoc}
    * @see org.jboss.test.ejb3.ejbthree1597.PersistenceUnitSettings#getCacheProvider()
    */
   public String getCacheProvider()
   {
      RegionFactory factory = this.settings().getRegionFactory();
     
      try
      {
         // Extract CacheProvider from RegionFactoryCacheProviderBridge
         return factory.getClass().getMethod("getCacheProvider").invoke(factory).getClass().getName();
      }
      catch (Exception e)
      {
         return factory.getClass().getName();
      }
   }
View Full Code Here

    DEFAULT_CACHE_CONCURRENCY_STRATEGY = strategy;
  }

  private static CacheConcurrencyStrategy determineCacheConcurrencyStrategy(Mappings mappings) {
    if ( DEFAULT_CACHE_CONCURRENCY_STRATEGY == null ) {
      final RegionFactory cacheRegionFactory = SettingsFactory.createRegionFactory(
          mappings.getConfigurationProperties(), true
      );
      DEFAULT_CACHE_CONCURRENCY_STRATEGY = CacheConcurrencyStrategy.fromAccessType( cacheRegionFactory.getDefaultAccessType() );
    }
    return DEFAULT_CACHE_CONCURRENCY_STRATEGY;
  }
View Full Code Here

    DEFAULT_CACHE_CONCURRENCY_STRATEGY = strategy;
  }

  private static CacheConcurrencyStrategy determineCacheConcurrencyStrategy(ExtendedMappings mappings) {
    if ( DEFAULT_CACHE_CONCURRENCY_STRATEGY == null ) {
      final RegionFactory cacheRegionFactory = SettingsFactory.createRegionFactory( mappings.getConfigurationProperties(), true );
      DEFAULT_CACHE_CONCURRENCY_STRATEGY = CacheConcurrencyStrategy.fromAccessType( cacheRegionFactory.getDefaultAccessType() );
    }
    return DEFAULT_CACHE_CONCURRENCY_STRATEGY;
  }
View Full Code Here

    DEFAULT_CACHE_CONCURRENCY_STRATEGY = strategy;
  }

  private static CacheConcurrencyStrategy determineCacheConcurrencyStrategy(Mappings mappings) {
    if ( DEFAULT_CACHE_CONCURRENCY_STRATEGY == null ) {
      final RegionFactory cacheRegionFactory = SettingsFactory.createRegionFactory(
          mappings.getConfigurationProperties(), true
      );
      DEFAULT_CACHE_CONCURRENCY_STRATEGY = CacheConcurrencyStrategy.fromAccessType( cacheRegionFactory.getDefaultAccessType() );
    }
    return DEFAULT_CACHE_CONCURRENCY_STRATEGY;
  }
View Full Code Here

TOP

Related Classes of org.hibernate.cache.RegionFactory

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.