• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DynamicLongProperty类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createTcpClientConfig

import com.netflix.config.DynamicLongProperty; //导入依赖的package包/类
private TcpClientConfig createTcpClientConfig() {
  TcpClientConfig tcpClientConfig = new TcpClientConfig();
  DynamicLongProperty prop = AbstractTransport.getRequestTimeoutProperty();
  prop.addCallback(new Runnable() {
    public void run() {
      tcpClientConfig.setRequestTimeoutMillis(prop.get());
    }
  });
  tcpClientConfig.setRequestTimeoutMillis(prop.get());

  SSLOptionFactory factory =
      SSLOptionFactory.createSSLOptionFactory(SSL_KEY, null);
  SSLOption sslOption;
  if (factory == null) {
    sslOption = SSLOption.buildFromYaml(SSL_KEY);
  } else {
    sslOption = factory.createSSLOption();
  }
  SSLCustom sslCustom = SSLCustom.createSSLCustom(sslOption.getSslCustomClass());
  VertxTLSBuilder.buildClientOptionsBase(sslOption, sslCustom, tcpClientConfig);

  return tcpClientConfig;
}
 
开发者ID:apache,项目名称:incubator-servicecomb-java-chassis,代码行数:24,代码来源:HighwayClient.java


示例2: testDefaultHystrixCircuitBreakerUsed

import com.netflix.config.DynamicLongProperty; //导入依赖的package包/类
@Test
public void testDefaultHystrixCircuitBreakerUsed() throws InterruptedException {
    // Verify Hystrix config first
    DynamicLongProperty intervalInMilliseconds = DynamicPropertyFactory.getInstance()
            .getLongProperty("hystrix.command.default.metrics.healthSnapshot.intervalInMilliseconds", 500);
    assertEquals(intervalInMilliseconds.get(), 10);

    // CLOSED
    for (int i = 0; i < ShakyServiceClient.REQUEST_THRESHOLD; i++) {
        assertInvocation(false);
    }
    // Should be OPEN now
    HystrixCircuitBreaker breaker = HystrixCircuitBreaker.Factory.getInstance(HystrixCommandKey.Factory.asKey(getCommandKey()));
    assertNotNull(breaker);
    assertFalse(breaker.getClass().getName().contains("org.wildfly.swarm.microprofile.faulttolerance"));
    assertTrue(breaker.isOpen());
    assertInvocation(true);
    TimeUnit.MILLISECONDS.sleep(ShakyServiceClient.DELAY);
    // Should be HALF-OPEN
    assertInvocation(false);
    // OPEN again
    assertInvocation(true);
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:24,代码来源:SyncCircuitBreakerDisabledTest.java


示例3: getRequestTimeoutProperty

import com.netflix.config.DynamicLongProperty; //导入依赖的package包/类
public static DynamicLongProperty getRequestTimeoutProperty() {
  if (prop != null) {
    return prop;
  }

  prop = DynamicPropertyFactory.getInstance()
      .getLongProperty("cse.request.timeout", DEFAULT_TIMEOUT_MILLIS);
  return prop;
}
 
开发者ID:apache,项目名称:incubator-servicecomb-java-chassis,代码行数:10,代码来源:AbstractTransport.java


示例4: getDynamicLongProperty

import com.netflix.config.DynamicLongProperty; //导入依赖的package包/类
public DynamicLongProperty getDynamicLongProperty(String name, long defaultValue) {
    DynamicLongProperty prop = (DynamicLongProperty) fastPropMap.get(name);
    if (prop != null) return prop;

    prop = DynamicPropertyFactory.getInstance().getLongProperty(name, defaultValue);
    fastPropMap.put(name, prop);
    return prop;
}
 
开发者ID:Netflix,项目名称:EVCache,代码行数:9,代码来源:EVCacheConfig.java


示例5: getLongProperty

import com.netflix.config.DynamicLongProperty; //导入依赖的package包/类
@Override
public long getLongProperty(String propertyName, LongConsumer consumer, long defaultValue) {
  DynamicLongProperty prop = propertyFactoryInstance().getLongProperty(propertyName, defaultValue);
  prop.addCallback(() -> consumer.accept(prop.get()));
  return prop.get();
}
 
开发者ID:apache,项目名称:incubator-servicecomb-java-chassis,代码行数:7,代码来源:DynamicPropertiesImpl.java


示例6: getServerTimeout

import com.netflix.config.DynamicLongProperty; //导入依赖的package包/类
public static long getServerTimeout() {
  DynamicLongProperty address =
      DynamicPropertyFactory.getInstance().getLongProperty("cse.rest.server.timeout", DEFAULT_TIMEOUT);
  return address.get();
}
 
开发者ID:apache,项目名称:incubator-servicecomb-java-chassis,代码行数:6,代码来源:ServletConfig.java


示例7: getLong

import com.netflix.config.DynamicLongProperty; //导入依赖的package包/类
@Override
public long getLong(String key, long defaultValue, Runnable callback) {
    final DynamicLongProperty property = DynamicPropertyFactory.getInstance().getLongProperty(key, defaultValue, callback);
    return property.get();
}
 
开发者ID:AsuraTeam,项目名称:asura,代码行数:6,代码来源:ConfigSubscriber.java


示例8: testBasicProperty

import com.netflix.config.DynamicLongProperty; //导入依赖的package包/类
@Test
public void testBasicProperty() {
    DynamicLongProperty dynamicLongProperty = DynamicPropertyFactory.getInstance().getLongProperty("com.kixeye.platform.chassis.testLong", -1);
    assertEquals(42, dynamicLongProperty.get());
}
 
开发者ID:Kixeye,项目名称:chassis,代码行数:6,代码来源:ChassisConfigPropertiesTest.java


示例9: getLong

import com.netflix.config.DynamicLongProperty; //导入依赖的package包/类
public static DynamicLongProperty getLong(String key) {
    return DynamicPropertyFactory.getInstance().getLongProperty(key, 0);
}
 
开发者ID:rancher,项目名称:cattle,代码行数:4,代码来源:ArchaiusUtil.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PrintQuality类代码示例发布时间:2022-05-21
下一篇:
Java AdaptationSet类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap