@Deprecated public void bind(WebServerInitializedEvent event) { ApplicationContext context = event.getApplicationContext(); if (context instanceof ConfigurableWebServerApplicationContext) { if ("management".equals( ((ConfigurableWebServerApplicationContext) context).getServerNamespace())) { return; } } this.port.compareAndSet(0, event.getWebServer().getPort()); this.start(); }
@Deprecated public void bind(WebServerInitializedEvent event) { ApplicationContext context = event.getApplicationContext(); if (context instanceof ConfigurableWebServerApplicationContext) { if ("management".equals( ((ConfigurableWebServerApplicationContext) context).getServerNamespace())) { return; } } this.port.compareAndSet(0, event.getWebServer().getPort()); this.start(); }
@Override public void onApplicationEvent(ApplicationEvent applicationEvent) { if (applicationEvent instanceof WebServerInitializedEvent) { WebServerInitializedEvent event = (WebServerInitializedEvent) applicationEvent; ApplicationContext context = event.getApplicationContext(); if (context instanceof ConfigurableWebServerApplicationContext) { if ("management".equals( ((ConfigurableWebServerApplicationContext) context).getServerNamespace())) { return; } } this.autoServiceRegistration.setPortIfNeeded(event.getWebServer().getPort()); this.autoServiceRegistration.start(); } }
@Override public void onApplicationEvent(ApplicationEvent applicationEvent) { if (applicationEvent instanceof WebServerInitializedEvent) { WebServerInitializedEvent event = (WebServerInitializedEvent) applicationEvent; ApplicationContext context = event.getApplicationContext(); if (context instanceof ConfigurableWebServerApplicationContext) { if ("management".equals( ((ConfigurableWebServerApplicationContext) context).getServerNamespace())) { return; } } this.autoServiceRegistration.setPortIfNeeded(event.getWebServer().getPort()); this.autoServiceRegistration.start(); } }