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


Java ConditionalOnMissingClass类代码示例

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


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

示例1: cacheManager

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass; //导入依赖的package包/类
/**
 * (基于内存的)用户授权信息Cache
 */
@Bean(name = "cacheManager")
@ConditionalOnMissingBean(name = "cacheManager")
@ConditionalOnMissingClass(value = {"org.apache.shiro.cache.ehcache.EhCacheManager"})
public CacheManager cacheManager() {
    return new MemoryConstrainedCacheManager();
}
 
开发者ID:johntostring,项目名称:spring-boot-shiro,代码行数:10,代码来源:ShiroConfiguration.java

示例2: dataSource

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass; //导入依赖的package包/类
@Bean(destroyMethod = "shutdown")
@ConditionalOnMissingClass(name = "es.cesga.hadoop.config.HerokuDatabaseConfiguration")
@Profile("!" + Constants.SPRING_PROFILE_CLOUD)
public DataSource dataSource() {
    log.debug("Configuring Datasource");
    if (propertyResolver.getProperty("url") == null && propertyResolver.getProperty("databaseName") == null) {
        log.error("Your database connection pool configuration is incorrect! The application" +
                "cannot start. Please check your Spring profile, current profiles are: {}",
                Arrays.toString(env.getActiveProfiles()));

        throw new ApplicationContextException("Database connection pool is not configured correctly");
    }
    HikariConfig config = new HikariConfig();
    config.setDataSourceClassName(propertyResolver.getProperty("dataSourceClassName"));
    if(StringUtils.isEmpty(propertyResolver.getProperty("url"))) {
        config.addDataSourceProperty("databaseName", propertyResolver.getProperty("databaseName"));
        config.addDataSourceProperty("serverName", propertyResolver.getProperty("serverName"));
    } else {
        config.addDataSourceProperty("url", propertyResolver.getProperty("url"));
    }
    config.addDataSourceProperty("user", propertyResolver.getProperty("username"));
    config.addDataSourceProperty("password", propertyResolver.getProperty("password"));

    //MySQL optimizations, see https://github.com/brettwooldridge/HikariCP/wiki/MySQL-Configuration
    if ("com.mysql.jdbc.jdbc2.optional.MysqlDataSource".equals(propertyResolver.getProperty("dataSourceClassName"))) {
        config.addDataSourceProperty("cachePrepStmts", propertyResolver.getProperty("cachePrepStmts", "true"));
        config.addDataSourceProperty("prepStmtCacheSize", propertyResolver.getProperty("prepStmtCacheSize", "250"));
        config.addDataSourceProperty("prepStmtCacheSqlLimit", propertyResolver.getProperty("prepStmtCacheSqlLimit", "2048"));
        config.addDataSourceProperty("useServerPrepStmts", propertyResolver.getProperty("useServerPrepStmts", "true"));
    }
    if (metricRegistry != null) {
        config.setMetricRegistry(metricRegistry);
    }
    return new HikariDataSource(config);
}
 
开发者ID:javicacheiro,项目名称:hadoop-on-demand-rest-jhipster,代码行数:36,代码来源:DatabaseConfiguration.java

示例3: dataSource

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass; //导入依赖的package包/类
@Bean(destroyMethod = "shutdown")
@ConditionalOnMissingClass(name = "de.kumpelblase2.jhipsterwebsocket.config.HerokuDatabaseConfiguration")
@Profile("!" + Constants.SPRING_PROFILE_CLOUD)
public DataSource dataSource() {
    log.debug("Configuring Datasource");
    if (propertyResolver.getProperty("url") == null && propertyResolver.getProperty("databaseName") == null) {
        log.error("Your database connection pool configuration is incorrect! The application" +
                "cannot start. Please check your Spring profile, current profiles are: {}",
                Arrays.toString(env.getActiveProfiles()));

        throw new ApplicationContextException("Database connection pool is not configured correctly");
    }
    HikariConfig config = new HikariConfig();
    config.setDataSourceClassName(propertyResolver.getProperty("dataSourceClassName"));
    if (propertyResolver.getProperty("url") == null || "".equals(propertyResolver.getProperty("url"))) {
        config.addDataSourceProperty("databaseName", propertyResolver.getProperty("databaseName"));
        config.addDataSourceProperty("serverName", propertyResolver.getProperty("serverName"));
    } else {
        config.addDataSourceProperty("url", propertyResolver.getProperty("url"));
    }
    config.addDataSourceProperty("user", propertyResolver.getProperty("username"));
    config.addDataSourceProperty("password", propertyResolver.getProperty("password"));

    //MySQL optimizations, see https://github.com/brettwooldridge/HikariCP/wiki/MySQL-Configuration
    if ("com.mysql.jdbc.jdbc2.optional.MysqlDataSource".equals(propertyResolver.getProperty("dataSourceClassName"))) {
        config.addDataSourceProperty("cachePrepStmts", propertyResolver.getProperty("cachePrepStmts", "true"));
        config.addDataSourceProperty("prepStmtCacheSize", propertyResolver.getProperty("prepStmtCacheSize", "250"));
        config.addDataSourceProperty("prepStmtCacheSqlLimit", propertyResolver.getProperty("prepStmtCacheSqlLimit", "2048"));
        config.addDataSourceProperty("useServerPrepStmts", propertyResolver.getProperty("useServerPrepStmts", "true"));
    }
    if (metricRegistry != null) {
        config.setMetricRegistry(metricRegistry);
    }
    return new HikariDataSource(config);
}
 
开发者ID:kumpelblase2,项目名称:jhipster-websocket-example,代码行数:36,代码来源:DatabaseConfiguration.java

示例4: dataSource

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass; //导入依赖的package包/类
@Bean(destroyMethod = "shutdown")
@ConditionalOnMissingClass(name = "com.jittrack.gts.config.HerokuDatabaseConfiguration")
@Profile("!" + Constants.SPRING_PROFILE_CLOUD)
public DataSource dataSource() {
    log.debug("Configuring Datasource");
    if (propertyResolver.getProperty("url") == null && propertyResolver.getProperty("databaseName") == null) {
        log.error("Your database connection pool configuration is incorrect! The application" +
                "cannot start. Please check your Spring profile, current profiles are: {}",
                Arrays.toString(env.getActiveProfiles()));

        throw new ApplicationContextException("Database connection pool is not configured correctly");
    }
    HikariConfig config = new HikariConfig();
    config.setDataSourceClassName(propertyResolver.getProperty("dataSourceClassName"));
    if (propertyResolver.getProperty("url") == null || "".equals(propertyResolver.getProperty("url"))) {
        config.addDataSourceProperty("databaseName", propertyResolver.getProperty("databaseName"));
        config.addDataSourceProperty("serverName", propertyResolver.getProperty("serverName"));
    } else {
        config.addDataSourceProperty("url", propertyResolver.getProperty("url"));
    }
    config.addDataSourceProperty("user", propertyResolver.getProperty("username"));
    config.addDataSourceProperty("password", propertyResolver.getProperty("password"));

    //MySQL optimizations, see https://github.com/brettwooldridge/HikariCP/wiki/MySQL-Configuration
    if ("com.mysql.jdbc.jdbc2.optional.MysqlDataSource".equals(propertyResolver.getProperty("dataSourceClassName"))) {
        config.addDataSourceProperty("cachePrepStmts", propertyResolver.getProperty("cachePrepStmts", "true"));
        config.addDataSourceProperty("prepStmtCacheSize", propertyResolver.getProperty("prepStmtCacheSize", "250"));
        config.addDataSourceProperty("prepStmtCacheSqlLimit", propertyResolver.getProperty("prepStmtCacheSqlLimit", "2048"));
        config.addDataSourceProperty("useServerPrepStmts", propertyResolver.getProperty("useServerPrepStmts", "true"));
    }
    if (metricRegistry != null) {
        config.setMetricRegistry(metricRegistry);
    }
    return new HikariDataSource(config);
}
 
开发者ID:sanketbajoria,项目名称:jittrackGTS,代码行数:36,代码来源:DatabaseConfiguration.java

示例5: dataSource

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass; //导入依赖的package包/类
@Bean(destroyMethod = "shutdown")
@ConditionalOnMissingClass(name = "com.miagebdx.website.config.HerokuDatabaseConfiguration")
@Profile("!" + Constants.SPRING_PROFILE_CLOUD)
public DataSource dataSource() {
    log.debug("Configuring Datasource");
    if (propertyResolver.getProperty("url") == null && propertyResolver.getProperty("databaseName") == null) {
        log.error("Your database connection pool configuration is incorrect! The application" +
                "cannot start. Please check your Spring profile, current profiles are: {}",
                Arrays.toString(env.getActiveProfiles()));

        throw new ApplicationContextException("Database connection pool is not configured correctly");
    }
    HikariConfig config = new HikariConfig();
    config.setDataSourceClassName(propertyResolver.getProperty("dataSourceClassName"));
    if (propertyResolver.getProperty("url") == null || "".equals(propertyResolver.getProperty("url"))) {
        config.addDataSourceProperty("databaseName", propertyResolver.getProperty("databaseName"));
        config.addDataSourceProperty("serverName", propertyResolver.getProperty("serverName"));
    } else {
        config.addDataSourceProperty("url", propertyResolver.getProperty("url"));
    }
    config.addDataSourceProperty("user", propertyResolver.getProperty("username"));
    config.addDataSourceProperty("password", propertyResolver.getProperty("password"));

    //MySQL optimizations, see https://github.com/brettwooldridge/HikariCP/wiki/MySQL-Configuration
    if ("com.mysql.jdbc.jdbc2.optional.MysqlDataSource".equals(propertyResolver.getProperty("dataSourceClassName"))) {
        config.addDataSourceProperty("cachePrepStmts", propertyResolver.getProperty("cachePrepStmts", "true"));
        config.addDataSourceProperty("prepStmtCacheSize", propertyResolver.getProperty("prepStmtCacheSize", "250"));
        config.addDataSourceProperty("prepStmtCacheSqlLimit", propertyResolver.getProperty("prepStmtCacheSqlLimit", "2048"));
        config.addDataSourceProperty("useServerPrepStmts", propertyResolver.getProperty("useServerPrepStmts", "true"));
    }
    if (metricRegistry != null) {
        config.setMetricRegistry(metricRegistry);
    }
    return new HikariDataSource(config);
}
 
开发者ID:miagebdx,项目名称:website,代码行数:36,代码来源:DatabaseConfiguration.java

示例6: dataSource

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass; //导入依赖的package包/类
@Bean(destroyMethod = "shutdown")
@ConditionalOnMissingClass(name = "com.tomkasp.config.HerokuDatabaseConfiguration")
@Profile("!" + Constants.SPRING_PROFILE_CLOUD)
public DataSource dataSource() {
    log.debug("Configuring Datasource");
    if (propertyResolver.getProperty("url") == null && propertyResolver.getProperty("databaseName") == null) {
        log.error("Your database connection pool configuration is incorrect! The application" +
                " cannot start. Please check your Spring profile, current profiles are: {}",
                Arrays.toString(env.getActiveProfiles()));

        throw new ApplicationContextException("Database connection pool is not configured correctly");
    }
    HikariConfig config = new HikariConfig();
    config.setDataSourceClassName(propertyResolver.getProperty("dataSourceClassName"));
    if(StringUtils.isEmpty(propertyResolver.getProperty("url"))) {
        config.addDataSourceProperty("databaseName", propertyResolver.getProperty("databaseName"));
        config.addDataSourceProperty("serverName", propertyResolver.getProperty("serverName"));
    } else {
        config.addDataSourceProperty("url", propertyResolver.getProperty("url"));
    }
    config.addDataSourceProperty("user", propertyResolver.getProperty("username"));
    config.addDataSourceProperty("password", propertyResolver.getProperty("password"));

    if (metricRegistry != null) {
        config.setMetricRegistry(metricRegistry);
    }
    return new HikariDataSource(config);
}
 
开发者ID:tomkasp,项目名称:quartz-hipster-ui,代码行数:29,代码来源:DatabaseConfiguration.java

示例7: dataSource

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass; //导入依赖的package包/类
@Bean(destroyMethod = "close")
@ConditionalOnMissingClass("fr.lpr.membership.config.HerokuDatabaseConfiguration")
@Profile("!" + Constants.SPRING_PROFILE_CLOUD)
public DataSource dataSource() {
    log.debug("Configuring Datasource");
    if (dataSourcePropertyResolver.getProperty("url") == null && dataSourcePropertyResolver.getProperty("databaseName") == null) {
        log.error("Your database connection pool configuration is incorrect! The application" +
                " cannot start. Please check your Spring profile, current profiles are: {}",
                Arrays.toString(env.getActiveProfiles()));

        throw new ApplicationContextException("Database connection pool is not configured correctly");
    }
    HikariConfig config = new HikariConfig();
    config.setDataSourceClassName(dataSourcePropertyResolver.getProperty("dataSourceClassName"));
    if(StringUtils.isEmpty(dataSourcePropertyResolver.getProperty("url"))) {
        config.addDataSourceProperty("databaseName", dataSourcePropertyResolver.getProperty("databaseName"));
        config.addDataSourceProperty("serverName", dataSourcePropertyResolver.getProperty("serverName"));
    } else {
        config.addDataSourceProperty("url", dataSourcePropertyResolver.getProperty("url"));
    }
    config.addDataSourceProperty("user", dataSourcePropertyResolver.getProperty("username"));
    config.addDataSourceProperty("password", dataSourcePropertyResolver.getProperty("password"));

    if (metricRegistry != null) {
        config.setMetricRegistry(metricRegistry);
    }
    return new HikariDataSource(config);
}
 
开发者ID:glebreton,项目名称:lapetiterennes,代码行数:29,代码来源:DatabaseConfiguration.java

示例8: dataSource

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass; //导入依赖的package包/类
@Bean(destroyMethod = "shutdown")
@ConditionalOnMissingClass(name = "com.jquaternion.jqsa.config.HerokuDatabaseConfiguration.class")
public DataSource dataSource() {
    log.debug("Configuring Datasource");
    if (propertyResolver.getProperty("url") == null && propertyResolver.getProperty("databaseName") == null) {
        log.error("Your database connection pool configuration is incorrect! The application" +
                "cannot start. Please check your Spring profile, current profiles are: {}",
                Arrays.toString(environment.getActiveProfiles()));

        throw new ApplicationContextException("Database connection pool is not configured correctly");
    }
    HikariConfig config = new HikariConfig();
    config.setDataSourceClassName(propertyResolver.getProperty("dataSourceClassName"));
    if (propertyResolver.getProperty("url") == null || "".equals(propertyResolver.getProperty("url"))) {
        config.addDataSourceProperty("databaseName", propertyResolver.getProperty("databaseName"));
        config.addDataSourceProperty("serverName", propertyResolver.getProperty("serverName"));
    } else {
        config.addDataSourceProperty("url", propertyResolver.getProperty("url"));
    }
    config.addDataSourceProperty("user", propertyResolver.getProperty("username"));
    config.addDataSourceProperty("password", propertyResolver.getProperty("password"));

    //MySQL optimizations, see https://github.com/brettwooldridge/HikariCP/wiki/MySQL-Configuration
    if ("com.mysql.jdbc.jdbc2.optional.MysqlDataSource".equals(propertyResolver.getProperty("dataSourceClassName"))) {
        config.addDataSourceProperty("cachePrepStmts", propertyResolver.getProperty("cachePrepStmts", "true"));
        config.addDataSourceProperty("prepStmtCacheSize", propertyResolver.getProperty("prepStmtCacheSize", "250"));
        config.addDataSourceProperty("prepStmtCacheSqlLimit", propertyResolver.getProperty("prepStmtCacheSqlLimit", "2048"));
        config.addDataSourceProperty("useServerPrepStmts", propertyResolver.getProperty("useServerPrepStmts", "true"));
    }
    return new HikariDataSource(config);
}
 
开发者ID:stryng,项目名称:JQuaternion,代码行数:32,代码来源:DatabaseConfiguration.java

示例9: primaryMetricWriter

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass; //导入依赖的package包/类
@Bean
@Primary
@ConditionalOnMissingClass("org.springframework.messaging.MessageChannel")
@ConditionalOnMissingBean(name = "primaryMetricWriter")
public MetricWriter primaryMetricWriter(List<MetricWriter> writers) {
  return new CompositeMetricWriter(writers);
}
 
开发者ID:spinnaker,项目名称:kork,代码行数:8,代码来源:SpectatorConfiguration.java

示例10: dataSource

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass; //导入依赖的package包/类
@Bean(destroyMethod = "shutdown")
@ConditionalOnMissingClass(name = "org.iobrew.config.HerokuDatabaseConfiguration")
@Profile("!cloud")
public DataSource dataSource(MetricRegistry metricRegistry) {
    log.debug("Configuring Datasource");
    if (propertyResolver.getProperty("url") == null && propertyResolver.getProperty("databaseName") == null) {
        log.error("Your database connection pool configuration is incorrect! The application" +
                "cannot start. Please check your Spring profile, current profiles are: {}",
                Arrays.toString(environment.getActiveProfiles()));

        throw new ApplicationContextException("Database connection pool is not configured correctly");
    }
    HikariConfig config = new HikariConfig();
    config.setDataSourceClassName(propertyResolver.getProperty("dataSourceClassName"));
    if (propertyResolver.getProperty("url") == null || "".equals(propertyResolver.getProperty("url"))) {
        config.addDataSourceProperty("databaseName", propertyResolver.getProperty("databaseName"));
        config.addDataSourceProperty("serverName", propertyResolver.getProperty("serverName"));
    } else {
        config.addDataSourceProperty("url", propertyResolver.getProperty("url"));
    }
    config.addDataSourceProperty("user", propertyResolver.getProperty("username"));
    config.addDataSourceProperty("password", propertyResolver.getProperty("password"));

    //MySQL optimizations, see https://github.com/brettwooldridge/HikariCP/wiki/MySQL-Configuration
    if ("com.mysql.jdbc.jdbc2.optional.MysqlDataSource".equals(propertyResolver.getProperty("dataSourceClassName"))) {
        config.addDataSourceProperty("cachePrepStmts", propertyResolver.getProperty("cachePrepStmts", "true"));
        config.addDataSourceProperty("prepStmtCacheSize", propertyResolver.getProperty("prepStmtCacheSize", "250"));
        config.addDataSourceProperty("prepStmtCacheSqlLimit", propertyResolver.getProperty("prepStmtCacheSqlLimit", "2048"));
        config.addDataSourceProperty("useServerPrepStmts", propertyResolver.getProperty("useServerPrepStmts", "true"));
    }
    config.setMetricRegistry(metricRegistry);
    return new HikariDataSource(config);
}
 
开发者ID:ebisi,项目名称:iobrew,代码行数:34,代码来源:DatabaseConfiguration.java

示例11: dataSource

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass; //导入依赖的package包/类
@Bean(destroyMethod = "shutdown")
@ConditionalOnMissingClass(name = "ch.alv.sysinfos.config.HerokuDatabaseConfiguration")
@Profile("!" + Constants.SPRING_PROFILE_CLOUD)
public DataSource dataSource() {
    log.debug("Configuring Datasource");
    if (propertyResolver.getProperty("url") == null && propertyResolver.getProperty("databaseName") == null) {
        log.error("Your database connection pool configuration is incorrect! The application" +
                "cannot start. Please check your Spring profile, current profiles are: {}",
                Arrays.toString(env.getActiveProfiles()));

        throw new ApplicationContextException("Database connection pool is not configured correctly");
    }
    HikariConfig config = new HikariConfig();
    config.setDataSourceClassName(propertyResolver.getProperty("dataSourceClassName"));
    if (propertyResolver.getProperty("url") == null || "".equals(propertyResolver.getProperty("url"))) {
        config.addDataSourceProperty("databaseName", propertyResolver.getProperty("databaseName"));
        config.addDataSourceProperty("serverName", propertyResolver.getProperty("serverName"));
    } else {
        config.addDataSourceProperty("url", propertyResolver.getProperty("url"));
    }
    config.addDataSourceProperty("user", propertyResolver.getProperty("username"));
    config.addDataSourceProperty("password", propertyResolver.getProperty("password"));

    //MySQL optimizations, see https://github.com/brettwooldridge/HikariCP/wiki/MySQL-Configuration
    if ("com.mysql.jdbc.jdbc2.optional.MysqlDataSource".equals(propertyResolver.getProperty("dataSourceClassName"))) {
        config.addDataSourceProperty("cachePrepStmts", propertyResolver.getProperty("cachePrepStmts", "true"));
        config.addDataSourceProperty("prepStmtCacheSize", propertyResolver.getProperty("prepStmtCacheSize", "250"));
        config.addDataSourceProperty("prepStmtCacheSqlLimit", propertyResolver.getProperty("prepStmtCacheSqlLimit", "2048"));
        config.addDataSourceProperty("useServerPrepStmts", propertyResolver.getProperty("useServerPrepStmts", "true"));
    }
    if (metricRegistry != null) {
        config.setMetricRegistry(metricRegistry);
    }
    return new HikariDataSource(config);
}
 
开发者ID:alv-ch,项目名称:alv-ch-sysinfos.api,代码行数:36,代码来源:DatabaseConfiguration.java

示例12: dataSource

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass; //导入依赖的package包/类
@Bean(destroyMethod = "shutdown")
@ConditionalOnMissingClass(name = "de.rwth.idsg.bikeman.config.HerokuDatabaseConfiguration")
@Profile("!" + Constants.SPRING_PROFILE_CLOUD)
public DataSource dataSource() {
    log.debug("Configuring Datasource");
    if (propertyResolver.getProperty("url") == null && propertyResolver.getProperty("databaseName") == null) {
        log.error("Your database connection pool configuration is incorrect! The application" +
                "cannot start. Please check your Spring profile, current profiles are: {}",
                Arrays.toString(env.getActiveProfiles()));

        throw new ApplicationContextException("Database connection pool is not configured correctly");
    }
    HikariConfig config = new HikariConfig();
    config.setDataSourceClassName(propertyResolver.getProperty("dataSourceClassName"));
    if (propertyResolver.getProperty("url") == null || "".equals(propertyResolver.getProperty("url"))) {
        config.addDataSourceProperty("databaseName", propertyResolver.getProperty("databaseName"));
        config.addDataSourceProperty("serverName", propertyResolver.getProperty("serverName"));
    } else {
        config.addDataSourceProperty("url", propertyResolver.getProperty("url"));
    }
    config.addDataSourceProperty("user", propertyResolver.getProperty("username"));
    config.addDataSourceProperty("password", propertyResolver.getProperty("password"));

    if (metricRegistry != null) {
        config.setMetricRegistry(metricRegistry);
    }
    return new HikariDataSource(config);
}
 
开发者ID:RWTH-i5-IDSG,项目名称:BikeMan,代码行数:29,代码来源:DatabaseConfiguration.java

示例13: retryableOkHttpLoadBalancingClient

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(AbstractLoadBalancerAwareClient.class)
@ConditionalOnMissingClass(value = "org.springframework.retry.support.RetryTemplate")
public OkHttpLoadBalancingClient retryableOkHttpLoadBalancingClient(
	IClientConfig config,
	ServerIntrospector serverIntrospector, ILoadBalancer loadBalancer,
	RetryHandler retryHandler, OkHttpClient delegate) {
	OkHttpLoadBalancingClient client = new OkHttpLoadBalancingClient(delegate, config,
			serverIntrospector);
	client.setLoadBalancer(loadBalancer);
	client.setRetryHandler(retryHandler);
	Monitors.registerObject("Client_" + this.name, client);
	return client;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-netflix,代码行数:15,代码来源:OkHttpRibbonConfiguration.java

示例14: ribbonLoadBalancingHttpClient

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(AbstractLoadBalancerAwareClient.class)
@ConditionalOnMissingClass(value = "org.springframework.retry.support.RetryTemplate")
public RibbonLoadBalancingHttpClient ribbonLoadBalancingHttpClient(
	IClientConfig config, ServerIntrospector serverIntrospector,
	ILoadBalancer loadBalancer, RetryHandler retryHandler, CloseableHttpClient httpClient) {
	RibbonLoadBalancingHttpClient client = new RibbonLoadBalancingHttpClient(httpClient, config, serverIntrospector);
	client.setLoadBalancer(loadBalancer);
	client.setRetryHandler(retryHandler);
	Monitors.registerObject("Client_" + this.name, client);
	return client;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-netflix,代码行数:13,代码来源:HttpClientRibbonConfiguration.java

示例15: cachingLBClientFactory

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass; //导入依赖的package包/类
@Bean
@Primary
@ConditionalOnMissingClass("org.springframework.retry.support.RetryTemplate")
public CachingSpringLoadBalancerFactory cachingLBClientFactory(
		SpringClientFactory factory) {
	return new CachingSpringLoadBalancerFactory(factory);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-netflix,代码行数:8,代码来源:FeignRibbonClientAutoConfiguration.java


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