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


Java EurekaClientConfig类代码示例

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


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

示例1: newTransportClientFactory

import com.netflix.discovery.EurekaClientConfig; //导入依赖的package包/类
public static TransportClientFactory newTransportClientFactory(final EurekaClientConfig clientConfig,
															   final Collection<ClientFilter> additionalFilters
															   ) {
	final TransportClientFactory jerseyFactory = JerseyEurekaHttpClientFactory.create(
			clientConfig, additionalFilters, null, null);
	final TransportClientFactory metricsFactory = MetricsCollectingEurekaHttpClient.createFactory(jerseyFactory);

	return new TransportClientFactory() {
		@Override
		public EurekaHttpClient newClient(EurekaEndpoint serviceUrl) {
			return metricsFactory.newClient(serviceUrl);
		}

		@Override
		public void shutdown() {
			metricsFactory.shutdown();
			jerseyFactory.shutdown();
		}
	};
}
 
开发者ID:spencergibb,项目名称:spring-cloud-netflix-eureka-lite,代码行数:21,代码来源:Eureka.java

示例2: beforeMethod

import com.netflix.discovery.EurekaClientConfig; //导入依赖的package包/类
@Before
public void beforeMethod() {
    eurekaIsDisabledPropertySupplierMock = mock(Supplier.class);
    datacenterTypePropertySupplierMock = mock(Supplier.class);
    cloudInstanceConfigMock = mock(CloudInstanceConfig.class);

    doReturn(false).when(eurekaIsDisabledPropertySupplierMock).get();
    doReturn(MyOwn.name()).when(datacenterTypePropertySupplierMock).get();

    handlerSpy = spy(new EurekaHandler(eurekaIsDisabledPropertySupplierMock, datacenterTypePropertySupplierMock));

    doNothing().when(handlerSpy).initDiscoveryManager(any(EurekaInstanceConfig.class),
                                                      any(EurekaClientConfig.class));
    doNothing().when(handlerSpy).shutdownDiscoveryManager();
    doNothing().when(handlerSpy).setEurekaInstanceStatus(any(InstanceStatus.class));
    doReturn(cloudInstanceConfigMock).when(handlerSpy).createCloudInstanceConfig(anyString());
}
 
开发者ID:Nike-Inc,项目名称:riposte,代码行数:18,代码来源:EurekaHandlerTest.java

示例3: mock

import com.netflix.discovery.EurekaClientConfig; //导入依赖的package包/类
@Test
public void register_uses_createEurekaInstanceConfig_then_calls_initDiscoveryManager_with_it_and_sets_instance_status_UP() {
    // given
    EurekaInstanceConfig instanceConfigMock = mock(EurekaInstanceConfig.class);
    doReturn(instanceConfigMock).when(handlerSpy).createEurekaInstanceConfig();
    assertThat(handlerSpy.registered.get()).isFalse();

    // when
    handlerSpy.register();

    // then
    assertThat(handlerSpy.registered.get()).isTrue();
    verify(handlerSpy).createEurekaInstanceConfig();

    ArgumentCaptor<EurekaClientConfig> clientConfigCaptor = ArgumentCaptor.forClass(EurekaClientConfig.class);
    verify(handlerSpy).initDiscoveryManager(eq(instanceConfigMock),
                                            clientConfigCaptor.capture());
    EurekaClientConfig clientConfigUsed = clientConfigCaptor.getValue();
    assertThat(clientConfigUsed).isInstanceOf(DefaultEurekaClientConfig.class);
    assertThat(Whitebox.getInternalState(clientConfigUsed, "namespace")).isEqualTo(handlerSpy.eurekaClientNamespace);

    verify(handlerSpy).setEurekaInstanceStatus(InstanceStatus.UP);
}
 
开发者ID:Nike-Inc,项目名称:riposte,代码行数:24,代码来源:EurekaHandlerTest.java

示例4: EurekaServerBootstrap

import com.netflix.discovery.EurekaClientConfig; //导入依赖的package包/类
public EurekaServerBootstrap(ApplicationInfoManager applicationInfoManager,
		EurekaClientConfig eurekaClientConfig, EurekaServerConfig eurekaServerConfig,
		PeerAwareInstanceRegistry registry, EurekaServerContext serverContext) {
	this.applicationInfoManager = applicationInfoManager;
	this.eurekaClientConfig = eurekaClientConfig;
	this.eurekaServerConfig = eurekaServerConfig;
	this.registry = registry;
	this.serverContext = serverContext;
}
 
开发者ID:dyc87112,项目名称:didi-eureka-server,代码行数:10,代码来源:EurekaServerBootstrap.java

示例5: InstanceRegistry

import com.netflix.discovery.EurekaClientConfig; //导入依赖的package包/类
public InstanceRegistry(EurekaServerConfig serverConfig,
		EurekaClientConfig clientConfig, ServerCodecs serverCodecs,
		EurekaClient eurekaClient, int expectedNumberOfRenewsPerMin,
		int defaultOpenForTrafficCount) {
	super(serverConfig, clientConfig, serverCodecs, eurekaClient);

	this.expectedNumberOfRenewsPerMin = expectedNumberOfRenewsPerMin;
	this.defaultOpenForTrafficCount = defaultOpenForTrafficCount;
}
 
开发者ID:dyc87112,项目名称:didi-eureka-server,代码行数:10,代码来源:InstanceRegistry.java

示例6: eurekaServerConfig

import com.netflix.discovery.EurekaClientConfig; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean
public EurekaServerConfig eurekaServerConfig(EurekaClientConfig clientConfig) {
	EurekaServerConfigBean server = new EurekaServerConfigBean();
	if (clientConfig.shouldRegisterWithEureka()) {
		// Set a sensible default if we are supposed to replicate
		server.setRegistrySyncRetries(5);
	}
	return server;
}
 
开发者ID:dyc87112,项目名称:didi-eureka-server,代码行数:11,代码来源:EurekaServerAutoConfiguration.java

示例7: myPeerEurekaNodes

import com.netflix.discovery.EurekaClientConfig; //导入依赖的package包/类
@Bean
public PeerEurekaNodes myPeerEurekaNodes(PeerAwareInstanceRegistry registry,
		EurekaServerConfig eurekaServerConfig,
		EurekaClientConfig eurekaClientConfig, ServerCodecs serverCodecs,
		ApplicationInfoManager applicationInfoManager) {
	return new CustomEurekaPeerNodes(registry, eurekaServerConfig,
			eurekaClientConfig, serverCodecs, applicationInfoManager);
}
 
开发者ID:dyc87112,项目名称:didi-eureka-server,代码行数:9,代码来源:EurekaCustomPeerNodesTest.java

示例8: CustomEurekaPeerNodes

import com.netflix.discovery.EurekaClientConfig; //导入依赖的package包/类
public CustomEurekaPeerNodes(PeerAwareInstanceRegistry registry,
		EurekaServerConfig serverConfig, EurekaClientConfig clientConfig,
		ServerCodecs serverCodecs,
		ApplicationInfoManager applicationInfoManager) {
	super(registry, serverConfig, clientConfig, serverCodecs,
			applicationInfoManager);
}
 
开发者ID:dyc87112,项目名称:didi-eureka-server,代码行数:8,代码来源:EurekaCustomPeerNodesTest.java

示例9: register_does_nothing_if_eureka_is_disabled

import com.netflix.discovery.EurekaClientConfig; //导入依赖的package包/类
@Test
public void register_does_nothing_if_eureka_is_disabled() {
    // given
    doReturn(true).when(eurekaIsDisabledPropertySupplierMock).get();

    // when
    handlerSpy.register();

    // then
    verify(handlerSpy, never()).createEurekaInstanceConfig();
    verify(handlerSpy, never()).initDiscoveryManager(any(EurekaInstanceConfig.class),
                                                     any(EurekaClientConfig.class));
    verify(handlerSpy, never()).setEurekaInstanceStatus(any(InstanceStatus.class));
}
 
开发者ID:Nike-Inc,项目名称:riposte,代码行数:15,代码来源:EurekaHandlerTest.java

示例10: register_does_nothing_if_already_registered

import com.netflix.discovery.EurekaClientConfig; //导入依赖的package包/类
@Test
public void register_does_nothing_if_already_registered() {
    // given
    handlerSpy.registered.set(true);

    // when
    handlerSpy.register();

    // then
    verify(handlerSpy, never()).createEurekaInstanceConfig();
    verify(handlerSpy, never()).initDiscoveryManager(any(EurekaInstanceConfig.class),
                                                     any(EurekaClientConfig.class));
    verify(handlerSpy, never()).setEurekaInstanceStatus(any(InstanceStatus.class));
}
 
开发者ID:Nike-Inc,项目名称:riposte,代码行数:15,代码来源:EurekaHandlerTest.java

示例11: configure

import com.netflix.discovery.EurekaClientConfig; //导入依赖的package包/类
@Override
protected void configure() {
    bind(ApplicationInfoManager.class).in(Scopes.SINGLETON);
    bind(EurekaClientConfig.class).in(Scopes.SINGLETON);
    bind(InstanceInfo.class).in(Scopes.SINGLETON);
    bind(EurekaClient.class).in(Scopes.SINGLETON);

    bind(EurekaHealthCheck.class).asEagerSingleton();
    bind(EurekaService.class).asEagerSingleton();
}
 
开发者ID:schibsted,项目名称:ratpack-eureka,代码行数:11,代码来源:EurekaModule.java

示例12: RefreshablePeerEurekaNodes

import com.netflix.discovery.EurekaClientConfig; //导入依赖的package包/类
public RefreshablePeerEurekaNodes(
		final PeerAwareInstanceRegistry registry,
		final EurekaServerConfig serverConfig,
		final EurekaClientConfig clientConfig, 
		final ServerCodecs serverCodecs,
		final ApplicationInfoManager applicationInfoManager) {
	super(registry, serverConfig, clientConfig, serverCodecs, applicationInfoManager);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-netflix,代码行数:9,代码来源:EurekaServerAutoConfiguration.java

示例13: EurekaRibbonClientConfiguration

import com.netflix.discovery.EurekaClientConfig; //导入依赖的package包/类
public EurekaRibbonClientConfiguration(EurekaClientConfig clientConfig,
		String serviceId, EurekaInstanceConfig eurekaConfig,
		boolean approximateZoneFromHostname) {
	this.clientConfig = clientConfig;
	this.serviceId = serviceId;
	this.eurekaConfig = eurekaConfig;
	this.approximateZoneFromHostname = approximateZoneFromHostname;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-netflix,代码行数:9,代码来源:EurekaRibbonClientConfiguration.java

示例14: EurekaHealthIndicator

import com.netflix.discovery.EurekaClientConfig; //导入依赖的package包/类
public EurekaHealthIndicator(EurekaClient eurekaClient,
		EurekaInstanceConfig instanceConfig, EurekaClientConfig clientConfig) {
	super();
	this.eurekaClient = eurekaClient;
	this.instanceConfig = instanceConfig;
	this.clientConfig = clientConfig;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-netflix,代码行数:8,代码来源:EurekaHealthIndicator.java

示例15: CloudEurekaClient

import com.netflix.discovery.EurekaClientConfig; //导入依赖的package包/类
public CloudEurekaClient(ApplicationInfoManager applicationInfoManager,
						 EurekaClientConfig config,
						 AbstractDiscoveryClientOptionalArgs<?> args,
						 ApplicationEventPublisher publisher) {
	super(applicationInfoManager, config, args);
	this.applicationInfoManager = applicationInfoManager;
	this.publisher = publisher;
	this.eurekaTransportField = ReflectionUtils.findField(DiscoveryClient.class, "eurekaTransport");
	ReflectionUtils.makeAccessible(this.eurekaTransportField);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-netflix,代码行数:11,代码来源:CloudEurekaClient.java


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