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


Java ClientConfigFactory.DEFAULT属性代码示例

本文整理汇总了Java中com.netflix.client.config.ClientConfigFactory.DEFAULT属性的典型用法代码示例。如果您正苦于以下问题:Java ClientConfigFactory.DEFAULT属性的具体用法?Java ClientConfigFactory.DEFAULT怎么用?Java ClientConfigFactory.DEFAULT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.netflix.client.config.ClientConfigFactory的用法示例。


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

示例1: testAnnotation

@Test
public void testAnnotation() {
    MyTransportFactory transportFactory = new MyTransportFactory(ClientConfigFactory.DEFAULT);
    RibbonResourceFactory resourceFactory = new DefaultResourceFactory(ClientConfigFactory.DEFAULT, transportFactory);
    RibbonDynamicProxy.newInstance(SampleMovieService.class, resourceFactory, ClientConfigFactory.DEFAULT, transportFactory);
    IClientConfig clientConfig = transportFactory.getClientConfig();
    assertEquals(1000, clientConfig.get(Keys.ConnectTimeout).longValue());
    assertEquals(2000, clientConfig.get(Keys.ReadTimeout).longValue());

    Configuration config = ConfigurationManager.getConfigInstance();
    assertEquals("2000", config.getProperty("SampleMovieService.ribbon.ReadTimeout"));
    assertEquals("1000", config.getProperty("SampleMovieService.ribbon.ConnectTimeout"));

    config.setProperty("SampleMovieService.ribbon.ReadTimeout", "5000");
    assertEquals(5000, clientConfig.get(Keys.ReadTimeout).longValue());
}
 
开发者ID:Netflix,项目名称:ribbon,代码行数:16,代码来源:ClientPropertiesTest.java

示例2: testNoExportToArchaius

@Test
public void testNoExportToArchaius() {
    MyTransportFactory transportFactory = new MyTransportFactory(ClientConfigFactory.DEFAULT);
    RibbonResourceFactory resourceFactory = new DefaultResourceFactory(ClientConfigFactory.DEFAULT, transportFactory);
    RibbonDynamicProxy.newInstance(MovieService.class, resourceFactory, ClientConfigFactory.DEFAULT, transportFactory);
    IClientConfig clientConfig = transportFactory.getClientConfig();
    assertEquals(1000, clientConfig.get(Keys.ConnectTimeout).longValue());
    assertEquals(3000, clientConfig.get(Keys.ReadTimeout).longValue());
    assertEquals(0, clientConfig.get(Keys.MaxAutoRetriesNextServer).longValue());

    Configuration config = ConfigurationManager.getConfigInstance();
    assertNull(config.getProperty("MovieService.ribbon.ReadTimeout"));
    config.setProperty("MovieService.ribbon.ReadTimeout", "5000");
    assertEquals(5000, clientConfig.get(Keys.ReadTimeout).longValue());
}
 
开发者ID:Netflix,项目名称:ribbon,代码行数:15,代码来源:ClientPropertiesTest.java

示例3: SecuredRibbonResourceFactory

public SecuredRibbonResourceFactory(final int maxChunkSize) {
    this(ClientConfigFactory.DEFAULT,
         new SecuredTransportFactory(maxChunkSize),
         AnnotationProcessorsProvider.DEFAULT);
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:5,代码来源:SecuredRibbonResourceFactory.java

示例4: SecuredTransportFactory

protected SecuredTransportFactory(final int maxChunkSize) {
    super(ClientConfigFactory.DEFAULT);
    this.maxChunkSize = maxChunkSize;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:4,代码来源:SecuredTransportFactory.java

示例5: SecuredRibbonResourceFactory

public SecuredRibbonResourceFactory(final int maxChunkSize) {
    this(ClientConfigFactory.DEFAULT,
        new SecuredTransportFactory(maxChunkSize),
        AnnotationProcessorsProvider.DEFAULT);
}
 
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:5,代码来源:SecuredRibbonResourceFactory.java

示例6: ProxyHttpResourceGroupFactory

ProxyHttpResourceGroupFactory(ClassTemplate<T> classTemplate) {
    this(classTemplate, new DefaultResourceFactory(ClientConfigFactory.DEFAULT, RibbonTransportFactory.DEFAULT, AnnotationProcessorsProvider.DEFAULT),
            AnnotationProcessorsProvider.DEFAULT);
}
 
开发者ID:Netflix,项目名称:ribbon,代码行数:4,代码来源:ProxyHttpResourceGroupFactory.java

示例7: HttpResourceGroup

protected HttpResourceGroup(String groupName) {
    super(groupName, ClientOptions.create(), ClientConfigFactory.DEFAULT, RibbonTransportFactory.DEFAULT);
    client = transportFactory.newHttpClient(getClientConfig());
    headers = HttpHeaders.EMPTY_HEADERS;
}
 
开发者ID:Netflix,项目名称:ribbon,代码行数:5,代码来源:HttpResourceGroup.java

示例8: ResourceGroup

protected ResourceGroup(String name) {
    this(name, ClientOptions.create(), ClientConfigFactory.DEFAULT, RibbonTransportFactory.DEFAULT);
}
 
开发者ID:Netflix,项目名称:ribbon,代码行数:3,代码来源:ResourceGroup.java


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