Class Application

java.lang.Object
io.mangoo.core.Application

public final class Application extends Object
Main class that starts all components of a mangoo I/O application
Author:
svenkubiak
  • Method Details

    • main

      public static void main(String... args)
    • start

      public static void start(Mode mode)
    • inDevMode

      public static boolean inDevMode()
      Checks if the application is running in dev mode
      Returns:
      True if the application is running in dev mode, false otherwise
    • inProdMode

      public static boolean inProdMode()
      Checks if the application is running in prod mode
      Returns:
      True if the application is running in prod mode, false otherwise
    • inTestMode

      public static boolean inTestMode()
      Checks if the application is running in test mode
      Returns:
      True if the application is running in test mode, false otherwise
    • getMode

      public static Mode getMode()
      Returns the current mode the application is running in
      Returns:
      Enum Mode
    • getScheduler

      public static ScheduledExecutorService getScheduler()
      Returns the ScheduledExecutorService where all tasks are scheduled
      Returns:
      ScheduledExecutorService
    • getInjector

      public static com.google.inject.Injector getInjector()
      Returns the Google Guice Injector
      Returns:
      Google Guice injector instance
    • isStarted

      public static boolean isStarted()
      Returns:
      True if the application started successfully, false otherwise
    • getStart

      public static LocalDateTime getStart()
      Returns:
      The LocalDateTime of the application start
    • getUptime

      public static Duration getUptime()
      Returns:
      The duration of the application uptime
    • getInstance

      public static <T> T getInstance(Class<T> clazz)
      Short form for getting a Google Guice injected class by calling getInstance(...)
      Type Parameters:
      T - JavaDoc requires this (just ignore it)
      Parameters:
      clazz - The class to retrieve from the injector
      Returns:
      An instance of the requested class
    • stopUndertow

      public static void stopUndertow()
      Stops the underlying undertow server
    • getLogo

      public static String getLogo()
      Retrieves the logo from the logo file and returns the string
      Returns:
      The mangoo I/O logo string
    • stopEmbeddedMongoDB

      public static void stopEmbeddedMongoDB()