Q: adding SPRING to an existing application This may be a silly question but I am having a hard time understanding what is the best practice to extend my application with a Spring-powered REST service.
I have a multi-threaded JAVA application and I would like to be able to create a separate Thread and do something like:
package payroll;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class PayrollApplication {
    public static void main(String... args) {
        SpringApplication.run(PayrollApplication.class, args);
    }
}

After having my application and SPRING running, I would also like to be able to call SPRING CRUD API from my application and also notify my application when something happens in SPRING.
One option would be to wrap my class in a bean running in a CommandLineRunner so that my application can access the CRUD interface.
Is this a correct approach? Since I can't find documentation on this I have the feeling there is something fundamental that I am missing or not understanding.
