org.zodiac.autoconfigure.launcher.LauncherAutoConfiguration Maven / Gradle / Ivy
package org.zodiac.autoconfigure.launcher;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.context.annotation.Bean;
import org.zodiac.commons.constants.Constants;
@SpringBootConfiguration
public class LauncherAutoConfiguration {
public LauncherAutoConfiguration() {
super();
}
@Bean
@ConditionalOnMissingBean
protected ServerConfigProperties serverConfigProperties(ObjectProvider serverPropertiesProvider) {
ServerProperties serverProperties = serverPropertiesProvider.getIfAvailable();
return new ServerConfigProperties(null != serverProperties ? serverProperties.getPort() : Constants.Spring.DEFAULT_SERVER_PORT_NUMBER);
}
}