com.netflix.discovery.converters.JsonXStream Java Examples

The following examples show how to use com.netflix.discovery.converters.JsonXStream. 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: EurekaServerBootstrap.java    From didi-eureka-server with MIT License 6 votes vote down vote up
protected void initEurekaServerContext() throws Exception {
	// For backward compatibility
	JsonXStream.getInstance().registerConverter(new V1AwareInstanceInfoConverter(),
			XStream.PRIORITY_VERY_HIGH);
	XmlXStream.getInstance().registerConverter(new V1AwareInstanceInfoConverter(),
			XStream.PRIORITY_VERY_HIGH);

	if (isAws(this.applicationInfoManager.getInfo())) {
		this.awsBinder = new AwsBinderDelegate(this.eurekaServerConfig,
				this.eurekaClientConfig, this.registry, this.applicationInfoManager);
		this.awsBinder.start();
	}

	EurekaServerContextHolder.initialize(this.serverContext);

	log.info("Initialized server context");

	// Copy registry from neighboring eureka node
	int registryCount = this.registry.syncUp();
	this.registry.openForTraffic(this.applicationInfoManager, registryCount);

	// Register all monitoring statistics.
	EurekaMonitors.registerAllStats();
}
 
Example #2
Source File: EurekaServerBootstrap.java    From spring-cloud-netflix with Apache License 2.0 6 votes vote down vote up
protected void initEurekaServerContext() throws Exception {
	// For backward compatibility
	JsonXStream.getInstance().registerConverter(new V1AwareInstanceInfoConverter(),
			XStream.PRIORITY_VERY_HIGH);
	XmlXStream.getInstance().registerConverter(new V1AwareInstanceInfoConverter(),
			XStream.PRIORITY_VERY_HIGH);

	if (isAws(this.applicationInfoManager.getInfo())) {
		this.awsBinder = new AwsBinderDelegate(this.eurekaServerConfig,
				this.eurekaClientConfig, this.registry, this.applicationInfoManager);
		this.awsBinder.start();
	}

	EurekaServerContextHolder.initialize(this.serverContext);

	log.info("Initialized server context");

	// Copy registry from neighboring eureka node
	int registryCount = this.registry.syncUp();
	this.registry.openForTraffic(this.applicationInfoManager, registryCount);

	// Register all monitoring statistics.
	EurekaMonitors.registerAllStats();
}