public void onApplicationEvent(WebServerInitializedEvent event) {
		// TODO: take SSL into account
		String contextName = event.getApplicationContext().getServerNamespace();
		if (contextName == null || !contextName.equals("management")) {
			int localPort = event.getWebServer().getPort();
			if (port.get() == 0) {
				log.info("Updating port to " + localPort);
				port.compareAndSet(0, localPort);
				start();
			}
		}
	}
Provides an implementation of {@link AutoServiceRegistration} for registering service
instances in Eureka.

@author Dave Syer
@author Spencer Gibb
@author Jon Schneider
@author Jakub Narloch
@author Raiyan Raiyan
@author Olga Maciaszek-Sharma
spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/serviceregistry/EurekaAutoServiceRegistration.java