Package io.micronaut.runtime
Interface EmbeddedApplication<T extends EmbeddedApplication>
-
- Type Parameters:
T- EmbeddedApplication
- All Superinterfaces:
io.micronaut.context.ApplicationContextLifeCycle<T>,io.micronaut.context.ApplicationContextProvider,java.lang.AutoCloseable,java.io.Closeable,io.micronaut.context.LifeCycle
- All Known Subinterfaces:
EmbeddedServer
public interface EmbeddedApplication<T extends EmbeddedApplication> extends io.micronaut.context.ApplicationContextLifeCycle<T>An
EmbeddedApplicationis a runnable application that starts and manages theApplicationContext.This interface is the parent interface of
EmbeddedServerwhich formalizes the concept of a server that exposes a port and addressApplications that did not expose a port and address (messaging applications, CLI applications etc. may wish to use this interface instead
- Since:
- 1.0
- See Also:
EmbeddedServer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ApplicationConfigurationgetApplicationConfiguration()io.micronaut.context.ApplicationContextgetApplicationContext()default io.micronaut.context.env.EnvironmentgetEnvironment()default booleanisForceExit()Most servers shutdown cleanly, however some integrations make require a forced exist.default booleanisServer()This method returns whether the application is a server application or not.
-
-
-
Method Detail
-
getApplicationContext
io.micronaut.context.ApplicationContext getApplicationContext()
- Specified by:
getApplicationContextin interfaceio.micronaut.context.ApplicationContextProvider- Returns:
- The
ApplicationContextfor the server
-
getApplicationConfiguration
ApplicationConfiguration getApplicationConfiguration()
- Returns:
- The
ApplicationConfigurationinstance
-
getEnvironment
default io.micronaut.context.env.Environment getEnvironment()
- Returns:
- The
Environmentfor the server
-
isServer
default boolean isServer()
This method returns whether the application is a server application or not. Server applications require that the thread be kept a live, preventing the application from exiting.- Returns:
- True if the application is a server
-
isForceExit
default boolean isForceExit()
Most servers shutdown cleanly, however some integrations make require a forced exist. If true is returned Micronaut will explicitly invoke System.exit(..).- Returns:
- Whether exiting the server should be forced.
-
-