Code example for Settings

Methods: getRegionFactory

0
     * @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) {
            return ((AbstractHazelcastCacheRegionFactory) rf).getHazelcastInstance();
        } else { 
            LOGGER.warning("Current 2nd level cache implementation is not HazelcastCacheRegionFactory!");
        } 
        return null; 
    } 
} 
Experience pair programming with AI  Get Codota for Java