Change your current RoutingContext interface to this:
You need to reflect those changes in the RoutingContextImpl.
For our RequestHandlerImpl we need to create an empty constructor. Now we need to create a setter for our function:
Create empty constructors in the GetHandler and PostHandler classes.
First of all, now our constructor should accept a ClassProvider, that we need to keep in a field:
Create a new method called initializeServerConfig():
In this method, we will initialize our ControllerAnnotationParser and we are going to save the routes it creates in a map.
Now, we need to traverse that map and create our server routes, based on the annotation routes. We need to iterate our inner map:
First, we need to create a new RequestHandlerImpl based on the request method:
Now we need to create a new RoutingContext and save the route in our private field:
Finally, we need to call this method from our constructor.
|