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


Java ConnectionProvider类代码示例

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


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

示例1: initInternal

import org.jooq.ConnectionProvider; //导入依赖的package包/类
private static void initInternal(final Vertx vertx,
                                 final String name) {
    vertxRef = vertx;
    Fn.pool(CONFIGS, name,
            () -> Infix.init(Plugins.Infix.JOOQ,
                    (config) -> {
                        // Initialized client
                        final Configuration configuration = new DefaultConfiguration();
                        configuration.set(SQLDialect.MYSQL_8_0);
                        final ConnectionProvider provider =
                                new DefaultConnectionProvider(HikariCpPool.getConnection(
                                        config.getJsonObject("provider")
                                ));
                        // Initialized default configuration
                        configuration.set(provider);
                        return configuration;
                    }, JooqInfix.class));
}
 
开发者ID:silentbalanceyh,项目名称:vertx-zero,代码行数:19,代码来源:JooqInfix.java

示例2: DslContextConfiguration

import org.jooq.ConnectionProvider; //导入依赖的package包/类
public DslContextConfiguration(JooqProperties properties,
		ConnectionProvider connectionProvider,
		ObjectProvider<TransactionProvider> transactionProviderProvider,
		ObjectProvider<RecordMapperProvider> recordMapperProviderProvider,
		ObjectProvider<Settings> settingsProvider,
		ObjectProvider<RecordListenerProvider[]> recordListenerProvidersProvider,
		ExecuteListenerProvider[] executeListenerProviders,
		ObjectProvider<VisitListenerProvider[]> visitListenerProvidersProvider) {
	this.properties = properties;
	this.connectionProvider = connectionProvider;
	this.transactionProvider = transactionProviderProvider.getIfAvailable();
	this.recordMapperProvider = recordMapperProviderProvider.getIfAvailable();
	this.settings = settingsProvider.getIfAvailable();
	this.recordListenerProviders = recordListenerProvidersProvider
			.getIfAvailable();
	this.executeListenerProviders = executeListenerProviders;
	this.visitListenerProviders = visitListenerProvidersProvider.getIfAvailable();
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:19,代码来源:JooqAutoConfiguration.java

示例3: configure

import org.jooq.ConnectionProvider; //导入依赖的package包/类
@Override
protected void configure() {
    bind(credentials).to(TwitterCredentials[].class);
    bind(alignments).to(DataSource.class);
    bind(sparqlLocation).named("SPARQLEndpoint").to(String.class);
    bind(ngramsEndpoint).named("NgramsEndpoint").to(String.class);
    bind(wikimachineEndpoint).named("WikimachineEndpoint").to(String.class);
    bind(lsaFilename).named("lsaFilename").to(String.class);
    bind(scaler).to(Scaler.class);
    bind(modelEndpoint).to(ModelEndpoint.class);
    bindFactory(TwitterFactory.class).to(Twitter[].class);
    bindFactory(ConnectionFactory.class).to(ConnectionProvider.class).in(Singleton.class);
    bind(AlignmentsService.class).to(AlignmentsService.class);
    bind(TwitterService.class).to(TwitterService.class);
    bind(KBAccessService.class).to(KBAccessService.class).in(Singleton.class);
    bind(WikimachineService.class).to(WikimachineService.class).in(Singleton.class);
    bind(AnnotationService.class).to(AnnotationService.class).in(Singleton.class);
    bind(MLService.class).to(MLService.class).in(Singleton.class);
    bind(ResourcesService.class).to(ResourcesService.class).in(Singleton.class);
    bind(NGramsService.class).to(NGramsService.class).in(Singleton.class);
    bind(OnlineAlignmentsService.class).to(OnlineAlignmentsService.class).in(Singleton.class);
}
 
开发者ID:Remper,项目名称:sociallink,代码行数:23,代码来源:Application.java

示例4: configure

import org.jooq.ConnectionProvider; //导入依赖的package包/类
@Override
protected void configure() {
    // bind default Configuration to DSLContext
    bindFactory(new DSLContextFactory(configurationMap.values().stream().findFirst().orElse(null)))
            .to(DSLContext.class)
            .in(RequestScoped.class);

    // bind multiple instances of Configuration and ConnectionProvider for Named DSLContext(s)
    for (final Configuration configuration : configurationMap.values()) {

        bind(configuration).to(Configuration.class);

        bind(configuration.connectionProvider())
                .to(ConnectionProvider.class);
    }

    // bind a ValueFactoryProvider for Named DSLContext(s)
    bind(new DSLContextValueFactoryProvider(configurationMap))
            .to(ValueFactoryProvider.class);
}
 
开发者ID:benjamin-bader,项目名称:droptools,代码行数:21,代码来源:JooqBinder.java

示例5: configure

import org.jooq.ConnectionProvider; //导入依赖的package包/类
@Override
public void configure(final Env env, final Config conf, final Binder binder) {
  Key<DataSource> dskey = Key.get(DataSource.class, Names.named(name));
  HikariDataSource ds = (HikariDataSource) env.get(dskey)
      .orElseThrow(() -> new NoSuchElementException("DataSource missing: " + dskey));
  Configuration jooqconf = new DefaultConfiguration();
  ConnectionProvider dscp = new DataSourceConnectionProvider(ds);
  jooqconf.set(JDBCUtils.dialect(ds.getDataSourceProperties().getProperty("url")));
  jooqconf.set(dscp);
  jooqconf.set(new DefaultTransactionProvider(dscp));

  if (callback != null) {
    callback.accept(jooqconf, conf);
  }

  ServiceKey serviceKey = env.serviceKey();
  serviceKey.generate(Configuration.class, name, k -> binder.bind(k).toInstance(jooqconf));

  Provider<DSLContext> dsl = () -> DSL.using(jooqconf);
  serviceKey.generate(DSLContext.class, name, k -> binder.bind(k).toProvider(dsl));
}
 
开发者ID:jooby-project,项目名称:jooby,代码行数:22,代码来源:jOOQ.java

示例6: getDSLContext

import org.jooq.ConnectionProvider; //导入依赖的package包/类
@Bean
public DSLContext getDSLContext() {
	HikariDataSource hikariDataSource = new HikariDataSource();
	hikariDataSource.setJdbcUrl(environment.getProperty("spring.datasource.url"));
	hikariDataSource.setUsername(environment.getProperty("spring.datasource.username"));
	hikariDataSource.setPassword(environment.getProperty("spring.datasource.password"));
	ConnectionProvider connectionProvider = new DataSourceConnectionProvider(hikariDataSource);
	org.jooq.Configuration configuration = new DefaultConfiguration().set(connectionProvider).set(SQLDialect.MYSQL);
	return DSL.using(configuration);
}
 
开发者ID:Sunshine-Constructing,项目名称:sunshine-security,代码行数:11,代码来源:DSLConfig.java

示例7: build

import org.jooq.ConnectionProvider; //导入依赖的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

示例8: produceConnectionProvider

import org.jooq.ConnectionProvider; //导入依赖的package包/类
@Produces
@ApplicationScoped
public ConnectionProvider produceConnectionProvider() {
    JooqConnectionProvider.log.info("Producing a connection provider");
    return new DataSourceConnectionProvider(ds);
}
 
开发者ID:MiguelGL,项目名称:jpa-samples-demo,代码行数:7,代码来源:DSLContextProvider.java

示例9: produceConnectionProvider

import org.jooq.ConnectionProvider; //导入依赖的package包/类
@Produces
@ApplicationScoped
public ConnectionProvider produceConnectionProvider() {
    log.info("Producing a connection provider");
    return new DataSourceConnectionProvider(ds);
}
 
开发者ID:MiguelGL,项目名称:jpa-samples-demo,代码行数:7,代码来源:JooqConnectionProvider.java

示例10: provide

import org.jooq.ConnectionProvider; //导入依赖的package包/类
@Override
public ConnectionProvider provide() {
    return provider;
}
 
开发者ID:Remper,项目名称:sociallink,代码行数:5,代码来源:ConnectionFactory.java

示例11: dispose

import org.jooq.ConnectionProvider; //导入依赖的package包/类
@Override
public void dispose(ConnectionProvider instance) {
}
 
开发者ID:Remper,项目名称:sociallink,代码行数:4,代码来源:ConnectionFactory.java

示例12: getConnectionProvider

import org.jooq.ConnectionProvider; //导入依赖的package包/类
public ConnectionProvider getConnectionProvider() {
    return connectionProvider;
}
 
开发者ID:cloudnautique,项目名称:cloud-cattle,代码行数:4,代码来源:Configuration.java

示例13: setConnectionProvider

import org.jooq.ConnectionProvider; //导入依赖的package包/类
public void setConnectionProvider(ConnectionProvider connectionProvider) {
    this.connectionProvider = connectionProvider;
}
 
开发者ID:cloudnautique,项目名称:cloud-cattle,代码行数:4,代码来源:Configuration.java


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