当前位置: 首页>>代码示例>>Java>>正文


Java Settings类代码示例

本文整理汇总了Java中org.hibernate.cfg.Settings的典型用法代码示例。如果您正苦于以下问题:Java Settings类的具体用法?Java Settings怎么用?Java Settings使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Settings类属于org.hibernate.cfg包,在下文中一共展示了Settings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SessionBuilderImpl

import org.hibernate.cfg.Settings; //导入依赖的package包/类
SessionBuilderImpl(SessionFactoryImpl sessionFactory) {
	this.sessionFactory = sessionFactory;
	this.sessionOwner = null;
	final Settings settings = sessionFactory.settings;

	// set up default builder values...
	this.interceptor = sessionFactory.getInterceptor();
	this.connectionReleaseMode = settings.getConnectionReleaseMode();
	this.autoClose = settings.isAutoCloseSessionEnabled();
	this.flushBeforeCompletion = settings.isFlushBeforeCompletionEnabled();

	if ( sessionFactory.getCurrentTenantIdentifierResolver() != null ) {
		tenantIdentifier = sessionFactory.getCurrentTenantIdentifierResolver().resolveCurrentTenantIdentifier();
	}

	listeners = settings.getBaselineSessionEventsListenerBuilder().buildBaselineList();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:SessionFactoryImpl.java

示例2: StandardQueryCache

import org.hibernate.cfg.Settings; //导入依赖的package包/类
/**
 * Constructs a StandardQueryCache instance
 *
 * @param settings The SessionFactory settings.
 * @param props Any properties
 * @param updateTimestampsCache The update-timestamps cache to use.
 * @param regionName The base query cache region name
 */
public StandardQueryCache(
		final Settings settings,
		final Properties props,
		final UpdateTimestampsCache updateTimestampsCache,
		final String regionName) {
	String regionNameToUse = regionName;
	if ( regionNameToUse == null ) {
		regionNameToUse = StandardQueryCache.class.getName();
	}
	final String prefix = settings.getCacheRegionPrefix();
	if ( prefix != null ) {
		regionNameToUse = prefix + '.' + regionNameToUse;
	}
	LOG.startingQueryCache( regionNameToUse );

	this.cacheRegion = settings.getRegionFactory().buildQueryResultsRegion( regionNameToUse, props );
	this.updateTimestampsCache = updateTimestampsCache;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:27,代码来源:StandardQueryCache.java

示例3: StandardQueryCache

import org.hibernate.cfg.Settings; //导入依赖的package包/类
public StandardQueryCache(
		final Settings settings, 
		final Properties props, 
		final UpdateTimestampsCache updateTimestampsCache, 
		String regionName) throws HibernateException {
	if ( regionName == null ) {
		regionName = StandardQueryCache.class.getName();
	}
	String prefix = settings.getCacheRegionPrefix();
	if ( prefix != null ) {
		regionName = prefix + '.' + regionName;
	}
	log.info( "starting query cache at region: " + regionName );

	this.queryCache = settings.getCacheProvider().buildCache(regionName, props);
	this.updateTimestampsCache = updateTimestampsCache;
	this.regionName = regionName;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:19,代码来源:StandardQueryCache.java

示例4: getHazelcastInstance

import org.hibernate.cfg.Settings; //导入依赖的package包/类
public HazelcastInstance getHazelcastInstance(Settings settings) {
    Object providerObject = null;
    try {
        Method getCacheProviderMethod = Settings.class.getMethod(METHOD_GET_CACHE_PROVIDER);
        providerObject = getCacheProviderMethod.invoke(settings);
    } catch (Exception e) {
        logger.log(Level.SEVERE, e.getMessage(), e);
        return null;
    }
    if (providerObject == null) {
        logger.log(Level.SEVERE, "Hibernate 2nd level cache has not been enabled!");
        return null;
    }
    final CacheProvider provider = (CacheProvider) providerObject;
    if (provider instanceof HazelcastCacheProvider) {
        return ((HazelcastCacheProvider) provider).getHazelcastInstance();
    }
    logger.log(Level.WARNING, "Current 2nd level cache implementation is not HazelcastCacheProvider!");
    return null;
}
 
开发者ID:mdogan,项目名称:hazelcast-archive,代码行数:21,代码来源:CacheProviderHazelcastAccessor.java

示例5: getHazelcastInstance

import org.hibernate.cfg.Settings; //导入依赖的package包/类
public HazelcastInstance getHazelcastInstance(Settings settings) {
    final RegionFactory rf = settings.getRegionFactory();
    if (rf == null) {
        logger.log(Level.SEVERE, "Hibernate 2nd level cache has not been enabled!");
        return null;
    }
    if (rf instanceof RegionFactoryCacheProviderBridge) {
        final CacheProvider provider = ((RegionFactoryCacheProviderBridge) rf).getCacheProvider();
        if (provider instanceof HazelcastCacheProvider) {
            return ((HazelcastCacheProvider) provider).getHazelcastInstance();
        }
        logger.log(Level.WARNING, "Current 2nd level cache implementation is not HazelcastCacheProvider!");
    } else if (rf instanceof HazelcastCacheRegionFactory) {
        return ((HazelcastCacheRegionFactory) rf).getHazelcastInstance();
    } else {
        logger.log(Level.WARNING, "Current 2nd level cache implementation is not HazelcastCacheRegionFactory!");
    }
    return null;
}
 
开发者ID:mdogan,项目名称:hazelcast-archive,代码行数:20,代码来源:RegionFactoryHazelcastAccessor.java

示例6: SessionBuilderImpl

import org.hibernate.cfg.Settings; //导入依赖的package包/类
SessionBuilderImpl(SessionFactoryImpl sessionFactory) {
	this.sessionFactory = sessionFactory;
	this.sessionOwner = null;
	final Settings settings = sessionFactory.settings;

	// set up default builder values...
	this.interceptor = sessionFactory.getInterceptor();
	this.connectionReleaseMode = settings.getConnectionReleaseMode();
	this.autoClose = settings.isAutoCloseSessionEnabled();
	this.flushBeforeCompletion = settings
			.isFlushBeforeCompletionEnabled();

	if (sessionFactory.getCurrentTenantIdentifierResolver() != null) {
		tenantIdentifier = sessionFactory
				.getCurrentTenantIdentifierResolver()
				.resolveCurrentTenantIdentifier();
	}
}
 
开发者ID:Gary-zhouxianjun,项目名称:hibernate-dynamic-dialects,代码行数:19,代码来源:SessionFactoryImpl.java

示例7: populateTimestamper

import org.hibernate.cfg.Settings; //导入依赖的package包/类
HibernateCacheTimestamper populateTimestamper(Settings settings, OverridableReadOnlyProperties properties) {
    String timestamperClazzName = properties.getProperty(TIMESTAMPER_PROPERTY_KEY,
            DEFAULT_TIMESTAMPER_CLASS.getName());

    HibernateCacheTimestamper timestamper;
    try {
        Class<?> clazz = Class.forName(timestamperClazzName);
        timestamper = (HibernateCacheTimestamper) clazz.newInstance();
    } catch (Exception e) {
        throw new IllegalStateException(e.getMessage(), e);
    }

    timestamper.setSettings(settings);
    timestamper.setProperties(properties);
    timestamper.setMemcachedAdapter(memcachedAdapter);
    timestamper.init();
    return timestamper;
}
 
开发者ID:kwon37xi,项目名称:hibernate4-memcached,代码行数:19,代码来源:Hibernate4MemcachedRegionFactory.java

示例8: getHazelcastInstance

import org.hibernate.cfg.Settings; //导入依赖的package包/类
public HazelcastInstance getHazelcastInstance(Settings settings) {
    final RegionFactory rf = settings.getRegionFactory();
    if (rf == null) {
        logger.log(Level.SEVERE, "Hibernate 2nd level cache has not been enabled!");
        return null;
    }
    if (rf instanceof RegionFactoryCacheProviderBridge) {
        final CacheProvider provider = ((RegionFactoryCacheProviderBridge) rf).getCacheProvider();
        if (provider instanceof HazelcastCacheProvider) {
            return ((HazelcastCacheProvider) provider).getHazelcastInstance();
        }
        logger.log(Level.WARNING, "Current 2nd level cache implementation is not HazelcastCacheProvider!");
    } else if (rf instanceof AbstractHazelcastCacheRegionFactory) {
        return ((AbstractHazelcastCacheRegionFactory) rf).getHazelcastInstance();
    } else {
        logger.log(Level.WARNING, "Current 2nd level cache implementation is not HazelcastCacheRegionFactory!");
    }
    return null;
}
 
开发者ID:health-and-care-developer-network,项目名称:health-and-care-developer-network,代码行数:20,代码来源:RegionFactoryHazelcastAccessor.java

示例9: buildSettings

import org.hibernate.cfg.Settings; //导入依赖的package包/类
@Override
public Settings buildSettings(Properties props, ServiceRegistry serviceRegistry) throws HibernateException {
	Settings settings = super.buildSettings(props, serviceRegistry);
	if (this.cacheRegionFactory != null) {
		try {
			Method setRegionFactory = Settings.class.getDeclaredMethod("setRegionFactory", RegionFactory.class);
			setRegionFactory.setAccessible(true);
			setRegionFactory.invoke(settings, this.cacheRegionFactory);
		}
		catch (Exception ex) {
			throw new IllegalStateException("Failed to invoke Hibernate's setRegionFactory method", ex);
		}
	}
	return settings;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:LocalSessionFactoryBuilder.java

示例10: UpdateTimestampsCache

import org.hibernate.cfg.Settings; //导入依赖的package包/类
/**
 * Constructs an UpdateTimestampsCache.
 *
 * @param settings The SessionFactory settings
 * @param props Any properties
 * @param factory The SessionFactory
 */
public UpdateTimestampsCache(Settings settings, Properties props, final SessionFactoryImplementor factory) {
	this.factory = factory;
	final String prefix = settings.getCacheRegionPrefix();
	final String regionName = prefix == null ? REGION_NAME : prefix + '.' + REGION_NAME;

	LOG.startingUpdateTimestampsCache( regionName );
	this.region = settings.getRegionFactory().buildTimestampsRegion( regionName, props );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:UpdateTimestampsCache.java

示例11: getQueryCache

import org.hibernate.cfg.Settings; //导入依赖的package包/类
@Override
public QueryCache getQueryCache(
		final String regionName,
		final UpdateTimestampsCache updateTimestampsCache,
		final Settings settings,
		final Properties props) throws HibernateException {
	return new StandardQueryCache(settings, props, updateTimestampsCache, regionName);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:StandardQueryCacheFactory.java

示例12: start

import org.hibernate.cfg.Settings; //导入依赖的package包/类
public void start(Settings settings, Properties properties) throws CacheException {
    // Do nothing the hazelcast hazelcastInstance is injected
    log.info("Starting up {}", getClass().getSimpleName());

    if (hazelcastInstance == null) {
        throw new IllegalArgumentException("Hazelcast hazelcastInstance must not be null");
    }
    cleanupService = new CleanupService(hazelcastInstance.getName());
}
 
开发者ID:xetys,项目名称:jhipster-ribbon-hystrix,代码行数:10,代码来源:_HazelcastCacheRegionFactory.java

示例13: start

import org.hibernate.cfg.Settings; //导入依赖的package包/类
public void start(final Settings settings, final Properties properties) throws CacheException {
    log.info("Starting up " + getClass().getSimpleName());
    if (instance == null || !instance.getLifecycleService().isRunning()) {
        instanceLoader = HazelcastInstanceFactory.createInstanceLoader(properties);
        instance = instanceLoader.loadInstance();
    }
    cleanupService = new CleanupService(instance.getName());
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate,代码行数:9,代码来源:AbstractHazelcastCacheRegionFactory.java

示例14: getHazelcastInstance

import org.hibernate.cfg.Settings; //导入依赖的package包/类
/**
 * Tries to extract <code>HazelcastInstance</code> from <code>SessionFactoryImplementor</code>.
 *
 * @param sessionFactory Hibernate <code>SessionFactory</code> to extract settings from
 * @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 instanceof AbstractHazelcastCacheRegionFactory) {
        return ((AbstractHazelcastCacheRegionFactory) rf).getHazelcastInstance();
    } else {
        LOGGER.warning("Current 2nd level cache implementation is not HazelcastCacheRegionFactory!");
    }
    return null;
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate,代码行数:17,代码来源:HazelcastAccessor.java

示例15: start

import org.hibernate.cfg.Settings; //导入依赖的package包/类
@Override
public void start(final Settings settings, final Properties properties) throws CacheException {
    logger.info("Starting up " + getClass().getSimpleName());
    if (instance == null || !instance.getLifecycleService().isRunning()) {
        instanceLoader = HazelcastInstanceFactory.createInstanceLoader(properties);
        instance = instanceLoader.loadInstance();
    }
    cleanupService = new CleanupService(instance.getName());
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate,代码行数:10,代码来源:AbstractHazelcastCacheRegionFactory.java


注:本文中的org.hibernate.cfg.Settings类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。