本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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");
}
示例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();
}
示例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);
}
示例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;
}
示例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;
}
示例10: ribbonPing
import com.netflix.loadbalancer.IPing; //导入依赖的package包/类
@Bean
public IPing ribbonPing(IClientConfig config) {
return new PingUrl();
}
示例11: ribbonPing
import com.netflix.loadbalancer.IPing; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean
public IPing ribbonPing() {
return new MarathonPing();
}
示例12: noOp
import com.netflix.loadbalancer.IPing; //导入依赖的package包/类
@Produces
@LoadBalancer(LoadBalancer.Type.Fixed)
@Dependent
public IPing noOp() {
return new NoOpPing();
}
示例13: dummy
import com.netflix.loadbalancer.IPing; //导入依赖的package包/类
@Produces
@Default
@Dependent
public IPing dummy() {
return new DummyPing();
}
示例14: getPing
import com.netflix.loadbalancer.IPing; //导入依赖的package包/类
public IPing getPing() {
return ping;
}
示例15: setPing
import com.netflix.loadbalancer.IPing; //导入依赖的package包/类
public void setPing(IPing ping) {
this.ping = ping;
}