I've been trying to get some data from classes instantiated by Spring boot, like controllers and services, to display them in local program, the same on that is supposed to start the whole thing. However, I can't find a way to get a reference of said classes. I want my program to be able to start server not upon starting, but with a button, as well as shutting it down without closing in the same way. Is there a way to do so?
Edit: The program needs to build & run spring application on click of corresponding button, also it has to be able to shut it down entirely on click. While it's built & running, the controller class (or any other annotated class used by Spring) needs to be accessed by the said program to process and display locally some data it receives.