Skip to content

Latest commit

 

History

History
18 lines (12 loc) · 1.38 KB

spring-manage-your-components.md

File metadata and controls

18 lines (12 loc) · 1.38 KB

Spring - Manage your components

Option 1: Spring component scan

The AbstractIndoqaBootApplication provides the method getComponentScanBasePackages. Return all packages that should be included in the Spring component scan. The Spring documentation explains how to annotate your classes so that they are registered as components. Consider using JSR 330 standard annotations to reduce the dependencies on Spring in your components.

Option 2: Register a Spring configuration

The Indoqa-boot StartupLifecycle gives access to the Spring application context. Use willRefreshSpringContext to register the Spring configuration:

@Override
public void willRefreshSpringContext(AnnotationConfigApplicationContext context) {
    context.register(SomeSpringComponentConfiguration.class);
}

See Initialization in your Java main method for more detailed information about how to make use of the StartupLifecycle.