Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 1.63 KB

initialization-java-main.md

File metadata and controls

33 lines (24 loc) · 1.63 KB

Initialization in your Java main method

The entry point to Indoqa-Boot is the AbstractIndoqaBootApplication. Extend this class and implement the main method which has to invoke Indoqa-Boot:

public class Application extends AbstractIndoqaBootApplication {

    public static void main(String[] args) {
        new Application().invoke();
    }

    @Override
    protected String getApplicationName() {
        return "My Application";
    }
}

Additionally to getApplicationName there are more template methods that you can override: checkLoggerInitialization, getAsciiLogoPath, getComponentScanBasePackages, getJsonTransformerClass, getVersionProvider and isDevEnvironment. See AbstractIndoqaBootApplication for further details.

Custom StartupLifecycle implementation

If you want to hook into the initialization of Indoqa-Boot, extend AbstractStartupLifecycle and pass it to the invoke method:

public class Application extends AbstractIndoqaBootApplication {

    public static void main(String[] args) {
        new Application().invoke(new CustomStartupLifecycle());
    }
}

The interface StartupLifecycle explains the lifecycle methods in detail.