com.netflix.eureka.resources.ServerCodecs Java Examples

The following examples show how to use com.netflix.eureka.resources.ServerCodecs. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractDocumentationTests.java    From spring-cloud-netflix with Apache License 2.0 6 votes vote down vote up
@Bean
public EurekaServerContext testEurekaServerContext(ServerCodecs serverCodecs,
		PeerAwareInstanceRegistry registry, PeerEurekaNodes peerEurekaNodes,
		ApplicationInfoManager applicationInfoManager,
		EurekaServerConfig eurekaServerConfig) {
	return new DefaultEurekaServerContext(eurekaServerConfig, serverCodecs,
			registry, peerEurekaNodes, applicationInfoManager) {
		@Override
		public void shutdown() {
			logger.info(
					"Shutting down (except ServoControl and EurekaMonitors)..");
			registry.shutdown();
			peerEurekaNodes.shutdown();
			// ServoControl.shutdown();
			// EurekaMonitors.shutdown();
			logger.info("Shut down");
		}
	};
}
 
Example #2
Source File: DiscoveryServerConfig.java    From mPaaS with Apache License 2.0 5 votes vote down vote up
public CustomRefreshablePeerEurekaNodes(
        final PeerAwareInstanceRegistry registry,
        final EurekaServerConfig serverConfig,
        final EurekaClientConfig clientConfig,
        final ServerCodecs serverCodecs,
        final ApplicationInfoManager applicationInfoManager) {
    super(registry, serverConfig, clientConfig, serverCodecs, applicationInfoManager);
}
 
Example #3
Source File: EurekaCustomPeerNodesTests.java    From spring-cloud-netflix with Apache License 2.0 5 votes vote down vote up
CustomEurekaPeerNodes(PeerAwareInstanceRegistry registry,
		EurekaServerConfig serverConfig, EurekaClientConfig clientConfig,
		ServerCodecs serverCodecs,
		ApplicationInfoManager applicationInfoManager) {
	super(registry, serverConfig, clientConfig, serverCodecs,
			applicationInfoManager);
}
 
Example #4
Source File: EurekaCustomPeerNodesTests.java    From spring-cloud-netflix with Apache License 2.0 5 votes vote down vote up
@Bean
public PeerEurekaNodes myPeerEurekaNodes(PeerAwareInstanceRegistry registry,
		EurekaServerConfig eurekaServerConfig,
		EurekaClientConfig eurekaClientConfig, ServerCodecs serverCodecs,
		ApplicationInfoManager applicationInfoManager) {
	return new CustomEurekaPeerNodes(registry, eurekaServerConfig,
			eurekaClientConfig, serverCodecs, applicationInfoManager);
}
 
Example #5
Source File: EurekaServerAutoConfiguration.java    From spring-cloud-netflix with Apache License 2.0 5 votes vote down vote up
RefreshablePeerEurekaNodes(final PeerAwareInstanceRegistry registry,
		final EurekaServerConfig serverConfig,
		final EurekaClientConfig clientConfig, final ServerCodecs serverCodecs,
		final ApplicationInfoManager applicationInfoManager,
		final ReplicationClientAdditionalFilters replicationClientAdditionalFilters) {
	super(registry, serverConfig, clientConfig, serverCodecs,
			applicationInfoManager);
	this.replicationClientAdditionalFilters = replicationClientAdditionalFilters;
}
 
Example #6
Source File: EurekaServerAutoConfiguration.java    From spring-cloud-netflix with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public EurekaServerContext eurekaServerContext(ServerCodecs serverCodecs,
		PeerAwareInstanceRegistry registry, PeerEurekaNodes peerEurekaNodes) {
	return new DefaultEurekaServerContext(this.eurekaServerConfig, serverCodecs,
			registry, peerEurekaNodes, this.applicationInfoManager);
}
 
Example #7
Source File: EurekaServerAutoConfiguration.java    From spring-cloud-netflix with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public PeerEurekaNodes peerEurekaNodes(PeerAwareInstanceRegistry registry,
		ServerCodecs serverCodecs,
		ReplicationClientAdditionalFilters replicationClientAdditionalFilters) {
	return new RefreshablePeerEurekaNodes(registry, this.eurekaServerConfig,
			this.eurekaClientConfig, serverCodecs, this.applicationInfoManager,
			replicationClientAdditionalFilters);
}
 
Example #8
Source File: EurekaServerAutoConfiguration.java    From spring-cloud-netflix with Apache License 2.0 5 votes vote down vote up
@Bean
public PeerAwareInstanceRegistry peerAwareInstanceRegistry(
		ServerCodecs serverCodecs) {
	this.eurekaClient.getApplications(); // force initialization
	return new InstanceRegistry(this.eurekaServerConfig, this.eurekaClientConfig,
			serverCodecs, this.eurekaClient,
			this.instanceRegistryProperties.getExpectedNumberOfClientsSendingRenews(),
			this.instanceRegistryProperties.getDefaultOpenForTrafficCount());
}
 
Example #9
Source File: InstanceRegistry.java    From spring-cloud-netflix with Apache License 2.0 5 votes vote down vote up
public InstanceRegistry(EurekaServerConfig serverConfig,
		EurekaClientConfig clientConfig, ServerCodecs serverCodecs,
		EurekaClient eurekaClient, int expectedNumberOfClientsSendingRenews,
		int defaultOpenForTrafficCount) {
	super(serverConfig, clientConfig, serverCodecs, eurekaClient);

	this.expectedNumberOfClientsSendingRenews = expectedNumberOfClientsSendingRenews;
	this.defaultOpenForTrafficCount = defaultOpenForTrafficCount;
}
 
Example #10
Source File: EurekaCustomPeerNodesTest.java    From didi-eureka-server with MIT License 5 votes vote down vote up
public CustomEurekaPeerNodes(PeerAwareInstanceRegistry registry,
		EurekaServerConfig serverConfig, EurekaClientConfig clientConfig,
		ServerCodecs serverCodecs,
		ApplicationInfoManager applicationInfoManager) {
	super(registry, serverConfig, clientConfig, serverCodecs,
			applicationInfoManager);
}
 
Example #11
Source File: EurekaCustomPeerNodesTest.java    From didi-eureka-server with MIT License 5 votes vote down vote up
@Bean
public PeerEurekaNodes myPeerEurekaNodes(PeerAwareInstanceRegistry registry,
		EurekaServerConfig eurekaServerConfig,
		EurekaClientConfig eurekaClientConfig, ServerCodecs serverCodecs,
		ApplicationInfoManager applicationInfoManager) {
	return new CustomEurekaPeerNodes(registry, eurekaServerConfig,
			eurekaClientConfig, serverCodecs, applicationInfoManager);
}
 
Example #12
Source File: EurekaServerAutoConfiguration.java    From didi-eureka-server with MIT License 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public PeerEurekaNodes peerEurekaNodes(PeerAwareInstanceRegistry registry,
		ServerCodecs serverCodecs) {
	return new PeerEurekaNodes(registry, this.eurekaServerConfig,
			this.eurekaClientConfig, serverCodecs, this.applicationInfoManager);
}
 
Example #13
Source File: EurekaServerAutoConfiguration.java    From didi-eureka-server with MIT License 5 votes vote down vote up
@Bean
public PeerAwareInstanceRegistry peerAwareInstanceRegistry(
		ServerCodecs serverCodecs) {
	this.eurekaClient.getApplications(); // force initialization
	return new InstanceRegistry(this.eurekaServerConfig, this.eurekaClientConfig,
			serverCodecs, this.eurekaClient,
			this.instanceRegistryProperties.getExpectedNumberOfRenewsPerMin(),
			this.instanceRegistryProperties.getDefaultOpenForTrafficCount());
}
 
Example #14
Source File: InstanceRegistry.java    From didi-eureka-server with MIT License 5 votes vote down vote up
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;
}
 
Example #15
Source File: EurekaConsulAdapterConfig.java    From eureka-consul-adapter with MIT License 5 votes vote down vote up
@Bean
@Primary
public RegistrationEventInstanceRegistry registrationEventInstanceRegistry(
        ServerCodecs serverCodecs, EurekaServerConfig eurekaServerConfig, EurekaClient eurekaClient,
        EurekaClientConfig eurekaClientConfig, InstanceRegistryProperties instanceRegistryProperties,
        ServiceChangeDetector serviceChangeDetector) {
    eurekaClient.getApplications(); // force initialization
    return new RegistrationEventInstanceRegistry(eurekaServerConfig, eurekaClientConfig,
            serverCodecs, eurekaClient,
            instanceRegistryProperties.getExpectedNumberOfClientsSendingRenews(),
            instanceRegistryProperties.getDefaultOpenForTrafficCount(), serviceChangeDetector);
}
 
Example #16
Source File: RegistrationEventInstanceRegistry.java    From eureka-consul-adapter with MIT License 5 votes vote down vote up
public RegistrationEventInstanceRegistry(EurekaServerConfig serverConfig, EurekaClientConfig clientConfig,
                                         ServerCodecs serverCodecs, EurekaClient eurekaClient,
                                         int expectedNumberOfRenewsPerMin, int defaultOpenForTrafficCount,
                                         ServiceChangeDetector serviceChangeDetector) {
    super(serverConfig, clientConfig, serverCodecs, eurekaClient, expectedNumberOfRenewsPerMin,
            defaultOpenForTrafficCount);
    this.serviceChangeDetector = serviceChangeDetector;
}
 
Example #17
Source File: ApimlInstanceRegistry.java    From api-layer with Eclipse Public License 2.0 5 votes vote down vote up
public ApimlInstanceRegistry(
    EurekaServerConfig serverConfig,
    EurekaClientConfig clientConfig,
    ServerCodecs serverCodecs,
    EurekaClient eurekaClient,
    InstanceRegistryProperties instanceRegistryProperties,
    ApplicationContext appCntx
) {
    super(serverConfig, clientConfig, serverCodecs, eurekaClient,
        instanceRegistryProperties.getExpectedNumberOfClientsSendingRenews(),
        instanceRegistryProperties.getDefaultOpenForTrafficCount()
    );
    this.appCntx = appCntx;
    init();
}
 
Example #18
Source File: EurekaConfig.java    From api-layer with Eclipse Public License 2.0 5 votes vote down vote up
@Bean
@Primary
public ApimlInstanceRegistry getApimlInstanceRegistry(
    EurekaServerConfig serverConfig,
    EurekaClientConfig clientConfig,
    ServerCodecs serverCodecs,
    EurekaClient eurekaClient,
    InstanceRegistryProperties instanceRegistryProperties,
    ApplicationContext appCntx)
{
    eurekaClient.getApplications(); // force initialization
    return new ApimlInstanceRegistry(serverConfig, clientConfig, serverCodecs, eurekaClient, instanceRegistryProperties,appCntx);
}
 
Example #19
Source File: EurekaStore.java    From qconfig with MIT License 5 votes vote down vote up
protected PeerEurekaNodes getPeerEurekaNodes(PeerAwareInstanceRegistry registry, EurekaServerConfig eurekaServerConfig, EurekaClientConfig eurekaClientConfig, ServerCodecs serverCodecs, ApplicationInfoManager applicationInfoManager) {
    return new PeerEurekaNodes(
            registry,
            eurekaServerConfig,
            eurekaClientConfig,
            serverCodecs,
            applicationInfoManager
    );
}
 
Example #20
Source File: EurekaServerAutoConfiguration.java    From didi-eureka-server with MIT License 4 votes vote down vote up
@Bean
public EurekaServerContext eurekaServerContext(ServerCodecs serverCodecs,
		PeerAwareInstanceRegistry registry, PeerEurekaNodes peerEurekaNodes) {
	return new DefaultEurekaServerContext(this.eurekaServerConfig, serverCodecs,
			registry, peerEurekaNodes, this.applicationInfoManager);
}
 
Example #21
Source File: EurekaServerAutoConfiguration.java    From didi-eureka-server with MIT License 4 votes vote down vote up
@Bean
public ServerCodecs serverCodecs() {
	return new CloudServerCodecs(this.eurekaServerConfig);
}
 
Example #22
Source File: EurekaServerAutoConfiguration.java    From spring-cloud-netflix with Apache License 2.0 4 votes vote down vote up
@Bean
public ServerCodecs serverCodecs() {
	return new CloudServerCodecs(this.eurekaServerConfig);
}
 
Example #23
Source File: DiscoveryServerConfig.java    From mPaaS with Apache License 2.0 3 votes vote down vote up
/**
 * 自定义配置中心节点,主要目的是注册中心间配置拷贝时的认证,可使用自定义的
 *
 * @param registry
 * @param serverCodecs
 * @return
 */
@Bean(destroyMethod = "shutdown")
public PeerEurekaNodes peerEurekaNodes(@SuppressWarnings("SpringJavaAutowiringInspection") PeerAwareInstanceRegistry registry,
                                       @SuppressWarnings("SpringJavaAutowiringInspection") ServerCodecs serverCodecs) {
    return new CustomRefreshablePeerEurekaNodes(registry, this.eurekaServerConfig,
            this.eurekaClientConfig, serverCodecs, this.applicationInfoManager);
}