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

org.zodiac.autoconfigure.bootstrap.registry.AutoAppRegistrationAutoConfiguration Maven / Gradle / Ivy

There is a newer version: 1.6.8
Show newest version
package org.zodiac.autoconfigure.bootstrap.registry;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Import;
import org.zodiac.commons.constants.SystemPropertiesConstants;
import org.zodiac.core.bootstrap.registry.AutoAppRegistration;

@SpringBootConfiguration
@Import(value = {AutoAppRegistrationConfiguration.class})
@ConditionalOnProperty(value = SystemPropertiesConstants.Zodiac.SPRING_BOOTSTRAP_REGISTRY_AUTO_REGIS_ENABLED,
    matchIfMissing = true)
public class AutoAppRegistrationAutoConfiguration {

    @Autowired(required = false)
    private AutoAppRegistration autoAppRegistration;

    @Autowired
    private AutoAppRegistrationProperties properties;

    @PostConstruct
    protected void init() {
        if (this.autoAppRegistration == null && this.properties.isFailFast()) {
            throw new IllegalStateException(
                String.format("Auto Application Registration has been requested, but there is no %s bean",
                    AutoAppRegistration.class.getSimpleName()));
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy