Home » Java » java – How to restart the spring boot application in the middle of endpoint and then start executing from there?-Exceptionshub

java – How to restart the spring boot application in the middle of endpoint and then start executing from there?-Exceptionshub

Posted by: admin February 25, 2020 Leave a comment

Questions:

I want to restart the spring boot application while I am in middle of an endpoint method

Lets consider this example:

    @RequestMapping(value = "/CreateView")
    public ResponseView createView()
    {
//      Here I write something to one of my files at runtime

//          //some more code
//      -------> SOMEWHERE I WANT THE SPRING BOOT APPLICATION TO RESTART<---------
//      And here I want to access those new writing (via reflection) that I have done at the runtime

    }

Is there any way to do the above?

How to&Answers: