Package io.mangoo.core
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 Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.google.inject.InjectorgetInjector()Returns the Google Guice Injectorstatic <T> TgetInstance(Class<T> clazz)Short form for getting an Goolge Guice injected class by calling getInstance(...)static StringgetLogo()Retrieves the logo from the logo file and returns the stringstatic ModegetMode()Returns the current mode the application is running instatic LocalDateTimegetStart()static DurationgetUptime()static booleaninDevMode()Checks if the application is running in dev modestatic booleaninProdMode()Checks if the application is running in prod modestatic booleaninTestMode()Checks if the application is running in test modestatic booleanisStarted()static voidmain(String... args)static voidstart(Mode mode)static voidstopUndertow()Stops the underlying undertow server
-
-
-
Method Detail
-
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
-
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 an Goolge 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
-
-