@ Override public void contextInitialized ( ServletContextEvent event ) { try { initEurekaEnvironment ( ) ; initEurekaServerContext ( ) ; ServletContext sc = event . getServletContext ( ) ; sc . setAttribute ( EurekaServerContext . class . getName ( ) , serverContext ) ; } catch ( Throwable e ) { logger . error ( "Cannot bootstrap eureka server :" , e ) ; throw new RuntimeException ( "Cannot bootstrap eureka server :" , e ) ; } }
Initializes Eureka including syncing up with other Eureka peers and publishing the registry .