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

The following examples show how to use org.springframework.cloud.netflix.eureka.server.event.EurekaServerStartedEvent. 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 //Server启动事件
public void listen(EurekaServerStartedEvent event) {
	System.out.println("Server启动事件:"+event);
}