Package io.mangoo.core
Class Application
java.lang.Object
io.mangoo.core.Application
Main class that starts all components of a mangoo I/O application
- Author:
- svenkubiak
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.inject.InjectorReturns the Google Guice Injectorstatic <T> TgetInstance(Class<T> clazz) Short form for getting a Google 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 ScheduledExecutorServiceReturns the ScheduledExecutorService where all tasks are scheduledstatic LocalDateTimegetStart()static Durationstatic booleanChecks if the application is running in dev modestatic booleanChecks if the application is running in prod modestatic booleanChecks if the application is running in test modestatic booleanstatic voidstatic voidstatic voidstatic voidStops the underlying undertow server
-
Method Details
-
main
-
start
-
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
Returns the current mode the application is running in- Returns:
- Enum Mode
-
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
- Returns:
- The LocalDateTime of the application start
-
getUptime
- Returns:
- The duration of the application uptime
-
getInstance
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
Retrieves the logo from the logo file and returns the string- Returns:
- The mangoo I/O logo string
-
stopEmbeddedMongoDB
public static void stopEmbeddedMongoDB()
-