org.springframework.cloud.netflix.eureka.server.event.EurekaRegistryAvailableEvent Java Examples

The following examples show how to use org.springframework.cloud.netflix.eureka.server.event.EurekaRegistryAvailableEvent. 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: EurekaServerInitializerConfiguration.java    From didi-eureka-server with MIT License 6 votes vote down vote up
@Override
public void start() {
	new Thread(new Runnable() {
		@Override
		public void run() {
			try {
				//TODO: is this class even needed now?
				eurekaServerBootstrap.contextInitialized(EurekaServerInitializerConfiguration.this.servletContext);
				log.info("Started Eureka Server");

				publish(new EurekaRegistryAvailableEvent(getEurekaServerConfig()));
				EurekaServerInitializerConfiguration.this.running = true;
				publish(new EurekaServerStartedEvent(getEurekaServerConfig()));
			}
			catch (Exception ex) {
				// Help!
				log.error("Could not initialize Eureka servlet context", ex);
			}
		}
	}).start();
}
 
Example #2
Source File: EurekaServerInitializerConfiguration.java    From spring-cloud-netflix with Apache License 2.0 6 votes vote down vote up
@Override
public void start() {
	new Thread(() -> {
		try {
			// TODO: is this class even needed now?
			eurekaServerBootstrap.contextInitialized(
					EurekaServerInitializerConfiguration.this.servletContext);
			log.info("Started Eureka Server");

			publish(new EurekaRegistryAvailableEvent(getEurekaServerConfig()));
			EurekaServerInitializerConfiguration.this.running = true;
			publish(new EurekaServerStartedEvent(getEurekaServerConfig()));
		}
		catch (Exception ex) {
			// Help!
			log.error("Could not initialize Eureka servlet context", ex);
		}
	}).start();
}
 
Example #3
Source File: GemFrameEurekaListener.java    From gem with MIT License 4 votes vote down vote up
@EventListener //注册中心启动事件
public void listen(EurekaRegistryAvailableEvent event) {
	System.out.println("注册中心启动事件:"+event);
}
 
Example #4
Source File: EurekaRegistryAvailableListener.java    From api-layer with Eclipse Public License 2.0 4 votes vote down vote up
@SuppressWarnings("NullableProblems")
@Override
public void onApplicationEvent(EurekaRegistryAvailableEvent event) {
    registrationService.registerServices();
}