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


Java IPing类代码示例

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


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

示例1: loadBalancer

import com.netflix.loadbalancer.IPing; //导入依赖的package包/类
/**
 * The load balancer definition.
 *
 * @param config            the client config.
 * @param serverList        the server list.
 * @param serverListFilter  the server list filter.
 * @param rule              the load balancing rule.
 * @param ping              the ping strategy.
 * @param serverListUpdater the server list updater.
 * @return The Dynamic Server List Load Balancer.
 */
@Bean
@ConditionalOnMissingBean
public ILoadBalancer loadBalancer(IClientConfig config,
                                  ServerList<Server> serverList,
                                  ServerListFilter<Server> serverListFilter,
                                  IRule rule, IPing ping,
                                  ServerListUpdater serverListUpdater) {
    log.debug("dynamic server list load balancer enabled.");
    return new DynamicServerListLoadBalancer<>(config, rule, ping, serverList,
            serverListFilter, serverListUpdater);
}
 
开发者ID:enadim,项目名称:spring-cloud-ribbon-extensions,代码行数:23,代码来源:RuleBaseConfig.java

示例2: ribbonLoadBalancer

import com.netflix.loadbalancer.IPing; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean
public ILoadBalancer ribbonLoadBalancer(IClientConfig config,
										ServerList<Server> serverList, ServerListFilter<Server> serverListFilter,
										IRule rule, IPing ping) {
	ZoneAwareLoadBalancer<Server> balancer = LoadBalancerBuilder.newBuilder()
			.withClientConfig(config).withRule(rule).withPing(ping)
			.withServerListFilter(serverListFilter).withDynamicServerList(serverList)
			.buildDynamicServerListLoadBalancer();
	return new DemoLoadBalancer(balancer);
}
 
开发者ID:spencergibb,项目名称:ribbondemo,代码行数:12,代码来源:RibbonDemoRibbonConfig.java

示例3: dependenciesBasedLoadBalancer

import com.netflix.loadbalancer.IPing; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean
@ConditionalOnDependenciesPassed
@ConditionalOnProperty(value = "spring.cloud.zookeeper.dependency.ribbon.loadbalancer", matchIfMissing = true)
public ILoadBalancer dependenciesBasedLoadBalancer(ZookeeperDependencies zookeeperDependencies,
		ServerList<?> serverList, IClientConfig config, IPing iPing) {
	return new DependenciesBasedLoadBalancer(zookeeperDependencies, serverList, config, iPing);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-zookeeper,代码行数:9,代码来源:ZookeeperRibbonClientConfiguration.java

示例4: DependenciesBasedLoadBalancer

import com.netflix.loadbalancer.IPing; //导入依赖的package包/类
public DependenciesBasedLoadBalancer(ZookeeperDependencies zookeeperDependencies, ServerList<?> serverList, IClientConfig config, IPing iPing) {
	super(config);
	this.zookeeperDependencies = zookeeperDependencies;
	setServersList(serverList.getInitialListOfServers());
	setPing(iPing);
	setServerListImpl(serverList);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-zookeeper,代码行数:8,代码来源:DependenciesBasedLoadBalancer.java

示例5: PropertiesFactory

import com.netflix.loadbalancer.IPing; //导入依赖的package包/类
public PropertiesFactory() {
	classToProperty.put(ILoadBalancer.class, "NFLoadBalancerClassName");
	classToProperty.put(IPing.class, "NFLoadBalancerPingClassName");
	classToProperty.put(IRule.class, "NFLoadBalancerRuleClassName");
	classToProperty.put(ServerList.class, "NIWSServerListClassName");
	classToProperty.put(ServerListFilter.class, "NIWSServerListFilterClassName");
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-netflix,代码行数:8,代码来源:PropertiesFactory.java

示例6: ribbonPing

import com.netflix.loadbalancer.IPing; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean
public IPing ribbonPing(IClientConfig config) {
	if (this.propertiesFactory.isSet(IPing.class, name)) {
		return this.propertiesFactory.get(IPing.class, config, name);
	}
	return new DummyPing();
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-netflix,代码行数:9,代码来源:RibbonClientConfiguration.java

示例7: ribbonLoadBalancer

import com.netflix.loadbalancer.IPing; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean
public ILoadBalancer ribbonLoadBalancer(IClientConfig config,
		ServerList<Server> serverList, ServerListFilter<Server> serverListFilter,
		IRule rule, IPing ping, ServerListUpdater serverListUpdater) {
	if (this.propertiesFactory.isSet(ILoadBalancer.class, name)) {
		return this.propertiesFactory.get(ILoadBalancer.class, config, name);
	}
	return new ZoneAwareLoadBalancer<>(config, rule, ping, serverList,
			serverListFilter, serverListUpdater);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-netflix,代码行数:12,代码来源:RibbonClientConfiguration.java

示例8: ribbonPing

import com.netflix.loadbalancer.IPing; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean
public IPing ribbonPing(IClientConfig config) {
	if (this.propertiesFactory.isSet(IPing.class, serviceId)) {
		return this.propertiesFactory.get(IPing.class, config, serviceId);
	}
	NIWSDiscoveryPing ping = new NIWSDiscoveryPing();
	ping.initWithNiwsConfig(config);
	return ping;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-netflix,代码行数:11,代码来源:EurekaRibbonClientConfiguration.java

示例9: ribbonLoadBalancer

import com.netflix.loadbalancer.IPing; //导入依赖的package包/类
@Bean
public ILoadBalancer ribbonLoadBalancer(IClientConfig config,
		ServerList<Server> serverList, IRule rule, IPing ping) {

	goodServer = new Server("localhost", this.port);
	badServer = new Server("mybadhost", 10001);
	badServer2 = new Server("localhost", SocketUtils.findAvailableTcpPort());

	balancer = LoadBalancerBuilder.newBuilder().withClientConfig(config)
			.withRule(rule).withPing(ping).buildFixedServerListLoadBalancer(
					Arrays.asList(badServer, badServer2, goodServer));
	return balancer;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-netflix,代码行数:14,代码来源:RestTemplateRetryTests.java

示例10: ribbonPing

import com.netflix.loadbalancer.IPing; //导入依赖的package包/类
@Bean
public IPing ribbonPing(IClientConfig config) {
	return new PingUrl();
}
 
开发者ID:daflockinger,项目名称:poppynotes,代码行数:5,代码来源:RibbonConfig.java

示例11: ribbonPing

import com.netflix.loadbalancer.IPing; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean
public IPing ribbonPing() {
    return new MarathonPing();
}
 
开发者ID:aatarasoff,项目名称:spring-cloud-marathon,代码行数:6,代码来源:MarathonRibbonClientConfiguration.java

示例12: noOp

import com.netflix.loadbalancer.IPing; //导入依赖的package包/类
@Produces
@LoadBalancer(LoadBalancer.Type.Fixed)
@Dependent
public IPing noOp() {
    return new NoOpPing();
}
 
开发者ID:lreimer,项目名称:cloud-native-javaee,代码行数:7,代码来源:PingProducer.java

示例13: dummy

import com.netflix.loadbalancer.IPing; //导入依赖的package包/类
@Produces
@Default
@Dependent
public IPing dummy() {
    return new DummyPing();
}
 
开发者ID:lreimer,项目名称:cloud-native-javaee,代码行数:7,代码来源:PingProducer.java

示例14: getPing

import com.netflix.loadbalancer.IPing; //导入依赖的package包/类
public IPing getPing() {
    return ping;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:4,代码来源:RibbonConfiguration.java

示例15: setPing

import com.netflix.loadbalancer.IPing; //导入依赖的package包/类
public void setPing(IPing ping) {
    this.ping = ping;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:4,代码来源:RibbonConfiguration.java


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