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

org.bidib.wizard.server.startup.InitLegacySingletonsApplicationRunner Maven / Gradle / Ivy

There is a newer version: 2.0.25
Show newest version
package org.bidib.wizard.server.startup;

import org.bidib.jbidibc.core.schema.bidiblabels.LabelFactory;
import org.bidib.jbidibc.exchange.vendorcv.VendorCvFactory;
import org.bidib.wizard.common.event.WizardApplicationReadyEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.context.ApplicationContext;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Component
@Order(1)
public class InitLegacySingletonsApplicationRunner implements ApplicationRunner {

    private static final Logger LOGGER = LoggerFactory.getLogger(InitLegacySingletonsApplicationRunner.class);

    @Autowired
    private ApplicationContext context;

    @Override
    public void run(ApplicationArguments args) {
        LOGGER.info("Initialize the legacy singletons.");

        VendorCvFactory.initialize();

        LabelFactory.initJaxbContext();

        LOGGER.info("Finished initialize the legacy singletons.");

        LOGGER.info("Publish the WizardApplicationReadyEvent.");
        context.publishEvent(new WizardApplicationReadyEvent(this));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy