• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java HikariCPPoolAdapter类的典型用法和代码示例

java 1次浏览

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

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

示例1: dataSource

点赞 3

import com.vladmihalcea.flexypool.adaptor.HikariCPPoolAdapter; //导入依赖的package包/类
@Bean(initMethod = "start", destroyMethod = "stop")
public DataSource dataSource() {
    com.vladmihalcea.flexypool.config.Configuration<HikariDataSource> configuration = new com.vladmihalcea.flexypool.config.Configuration.Builder<HikariDataSource>(
            datasourcePropertyResolver.getProperty("uniqueId"),
            poolingDataSource(),
            HikariCPPoolAdapter.FACTORY
    )
            .setMetricsFactory(CodahaleMetrics.UNIFORM_RESERVOIR_FACTORY)
            .setConnectionProxyFactory(JdkConnectionProxyFactory.INSTANCE)
            .setJmxEnabled(true)
            .setMetricLogReporterMillis(TimeUnit.SECONDS.toMillis(5))
            .build();
    log.debug("Configuring FlexyPool");
    return new FlexyPoolDataSource<HikariDataSource>(configuration,
            new IncrementPoolOnTimeoutConnectionAcquiringStrategy.Factory(5),
            new RetryConnectionAcquiringStrategy.Factory(2)
    );
}
 

开发者ID:thpham,
项目名称:ithings-demo,
代码行数:19,
代码来源:JpaConfiguration.java

示例2: actualDataSource

点赞 3

import com.vladmihalcea.flexypool.adaptor.HikariCPPoolAdapter; //导入依赖的package包/类
@Override
public DataSource actualDataSource() {
    final HikariDataSource dataSource = (HikariDataSource) super.actualDataSource();

    com.vladmihalcea.flexypool.config.Configuration<HikariDataSource> configuration =
        new com.vladmihalcea.flexypool.config.Configuration.Builder<>(
            "flexy-pool-test",
            dataSource,
            HikariCPPoolAdapter.FACTORY
        )
    .build();

    return new FlexyPoolDataSource<>(
        configuration
    );
}
 

开发者ID:vladmihalcea,
项目名称:high-performance-java-persistence,
代码行数:17,
代码来源:FlexyPoolTestConfiguration.java

示例3: configuration

点赞 2

import com.vladmihalcea.flexypool.adaptor.HikariCPPoolAdapter; //导入依赖的package包/类
@Bean
public Configuration<HikariDataSource> configuration() {
    return new Configuration.Builder<HikariDataSource>(
            uniqueId,
            poolingDataSource,
            HikariCPPoolAdapter.FACTORY
    ).build();
}
 

开发者ID:vladmihalcea,
项目名称:flexy-pool,
代码行数:9,
代码来源:FlexyPoolConfiguration.java

示例4: createConfiguration

点赞 2

import com.vladmihalcea.flexypool.adaptor.HikariCPPoolAdapter; //导入依赖的package包/类
private Configuration<HikariDataSource> createConfiguration(String name, Config config, HikariDataSource dataSource) {
    String uniqueId = config.getOptionalValue(format(UNIQUE_ID_PROPERTY_FORMAT, name), String.class).orElse(name);
    Configuration.Builder<HikariDataSource> builder = new Configuration.Builder<>(uniqueId, dataSource, HikariCPPoolAdapter.FACTORY);
    if(metricsFactoryInstance.isResolvable()) {
        MetricsFactory metricsFactory = metricsFactoryInstance.get();
        builder.setMetricsFactory(metricsFactory);
    }
    return builder.build();
}
 

开发者ID:hammock-project,
项目名称:hammock,
代码行数:10,
代码来源:FlexyPoolWrapper.java

示例5: flexyPoolDataSourceDecorator

点赞 2

import com.vladmihalcea.flexypool.adaptor.HikariCPPoolAdapter; //导入依赖的package包/类
@Bean
public FlexyPoolDataSourceDecorator flexyPoolDataSourceDecorator() {
    return new FlexyPoolDataSourceDecorator(
            mergeFactories(connectionAcquiringStrategyFactories, dataSourceDecoratorProperties.getFlexyPool()),
            HikariCPPoolAdapter.FACTORY, HikariDataSource.class);
}
 

开发者ID:gavlyukovskiy,
项目名称:spring-boot-data-source-decorator,
代码行数:7,
代码来源:FlexyPoolConfiguration.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)