本文整理汇总了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();
}
};
}
示例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());
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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));
}
示例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));
}
示例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();
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}