本文整理汇总了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;未经允许,请勿转载。 |
请发表评论