org.bidib.wizard.server.startup.InitLegacySingletonsApplicationRunner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bidibwizard-server Show documentation
Show all versions of bidibwizard-server Show documentation
jBiDiB BiDiB Wizard Server POM
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));
}
}