All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.zodiac.autoconfigure.launcher.LauncherAutoConfiguration Maven / Gradle / Ivy

There is a newer version: 1.6.8
Show newest version
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);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy