java.lang.Object
io.john.amiscaray.quak.web.application.WebStarter
Used to start a web application by scanning through the project classes and instantiating the provided controllers and filters.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CompletableFuture<WebApplication> beginWebApplication(Class<?> main, String[] args) Begins a web application.static voidon(Application.LifecycleState lifecycleState, Consumer<Application> callback) Adds a callback function to the web application.
-
Constructor Details
-
WebStarter
public WebStarter()
-
-
Method Details
-
on
Adds a callback function to the web application. NOTE: This should be called before callingWebStarter#beginWebApplicationfor the callbacks to properly work.- Parameters:
lifecycleState- A specific state of the application when the callback should be called.callback- A callback called when the lifecycleState has occurred.
-
beginWebApplication
Begins a web application. Scans for classes annotated withControllerand creates instances ofPathControllerbased on them, so we can handle requests.- Parameters:
main- The main entry class of the program.args- The program args.- Returns:
- A completable future returning the web application. Completes after the context loads and the controllers have been parsed.
-