java.lang.Object
io.john.amiscaray.quak.web.application.WebStarter

public class WebStarter extends Object
Used to start a web application by scanning through the project classes and instantiating the provided controllers and filters.
  • Constructor Details

    • WebStarter

      public WebStarter()
  • Method Details

    • on

      public static void on(Application.LifecycleState lifecycleState, Consumer<Application> callback)
      Adds a callback function to the web application. NOTE: This should be called before calling WebStarter#beginWebApplication for 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

      public static CompletableFuture<WebApplication> beginWebApplication(Class<?> main, String[] args)
      Begins a web application. Scans for classes annotated with Controller and creates instances of PathController based 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.