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


Java PooledDataSourceFactory.build方法代码示例

本文整理汇总了Java中io.dropwizard.db.PooledDataSourceFactory.build方法的典型用法代码示例。如果您正苦于以下问题:Java PooledDataSourceFactory.build方法的具体用法?Java PooledDataSourceFactory.build怎么用?Java PooledDataSourceFactory.build使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.dropwizard.db.PooledDataSourceFactory的用法示例。


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

示例1: build

import io.dropwizard.db.PooledDataSourceFactory; //导入方法依赖的package包/类
public Jdbi build(Environment environment,
                  PooledDataSourceFactory configuration,
                  String name) {
    ManagedDataSource dataSource = configuration.build(environment.metrics(), name);
    String validationQuery = configuration.getValidationQuery();
    Jdbi jdbi = Jdbi.create(dataSource);
    jdbi.setTimingCollector(new InstrumentedTimingCollector(environment.metrics(), nameStrategy));
    jdbi.installPlugins();

    environment.lifecycle().manage(dataSource);
    environment.healthChecks().register(name, new JdbiHealthCheck(
            environment.getHealthCheckExecutorService(),
            configuration.getValidationQueryTimeout().orElseGet(() -> Duration.seconds(5)),
            jdbi, validationQuery));

    return jdbi;
}
 
开发者ID:arteam,项目名称:dropwizard-jdbi3,代码行数:18,代码来源:JdbiFactory.java

示例2: initialize

import io.dropwizard.db.PooledDataSourceFactory; //导入方法依赖的package包/类
public void initialize(Environment environment, PooledDataSourceFactory dataSourceFactory, String name) {
   dataSource = dataSourceFactory.build(environment.metrics(), name);
   bCryptPasswordEncryptor = BCryptPasswordEncryptor.newInstance(12);
   environment.lifecycle().manage(dataSource);
   environment.healthChecks().register(name,
                                       new DataSourceHealthCheck(environment.getHealthCheckExecutorService(),
                                                                 dataSourceFactory.getValidationQueryTimeout()
                                                                       .orElse(Duration.seconds(5)),
                                                                 dataSource,
                                                                 dataSourceFactory.getValidationQuery()));
}
 
开发者ID:acciente,项目名称:oacc-example-securetodo,代码行数:12,代码来源:AccessControlContextFactory.java

示例3: build

import io.dropwizard.db.PooledDataSourceFactory; //导入方法依赖的package包/类
public SessionFactory build(final RemoteCredentialHibernateBundle<?> bundle,
        final Environment environment,
        final PooledDataSourceFactory dbConfig,
        final List<Class<?>> entities,
        final String name) {
    final ManagedDataSource dataSource = dbConfig.build(environment.metrics(), name);
    return this.build(bundle, environment, dbConfig, dataSource, entities);
}
 
开发者ID:mtakaki,项目名称:CredentialStorageService-dw-hibernate,代码行数:9,代码来源:SessionFactoryFactory.java

示例4: build

import io.dropwizard.db.PooledDataSourceFactory; //导入方法依赖的package包/类
EntityManagerFactory build(EntityManagerBundle<?> bundle,
                            Environment environment,
                            PooledDataSourceFactory dbConfig,
                            List<Class<?>> entities,
                            String name) {
    final ManagedDataSource dataSource = dbConfig.build(environment.metrics(), name);
    return build(bundle, environment, dbConfig, dataSource, entities);
}
 
开发者ID:scottescue,项目名称:dropwizard-entitymanager,代码行数:9,代码来源:EntityManagerFactoryFactory.java

示例5: build

import io.dropwizard.db.PooledDataSourceFactory; //导入方法依赖的package包/类
public Configuration build(Environment environment, PooledDataSourceFactory factory, String name) throws ClassNotFoundException {
    final Settings settings = buildSettings();
    final ManagedDataSource dataSource = factory.build(environment.metrics(), name);
    final SQLDialect dialect = determineDialect(factory, dataSource);
    final ConnectionProvider connectionProvider = new DataSourceConnectionProvider(dataSource);
    final Configuration config = new DefaultConfiguration()
            .set(settings)
            .set(dialect)
            .set(connectionProvider);

    environment.lifecycle().manage(dataSource);

    return config;
}
 
开发者ID:benjamin-bader,项目名称:droptools,代码行数:15,代码来源:JooqFactory.java


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