Package io.micronaut.runtime.server
Interface EmbeddedServer
-
- All Superinterfaces:
io.micronaut.context.ApplicationContextLifeCycle<EmbeddedServer>,io.micronaut.context.ApplicationContextProvider,java.lang.AutoCloseable,java.io.Closeable,EmbeddedApplication<EmbeddedServer>,io.micronaut.context.LifeCycle
public interface EmbeddedServer extends EmbeddedApplication<EmbeddedServer>
An EmbeddedServer is a general abstraction to manage the lifecycle of any server implementation within a running Micronaut application.
- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.net.URIgetContextURI()java.lang.StringgetHost()intgetPort()java.lang.StringgetScheme()java.net.URIgetURI()java.net.URLgetURL()default booleanisKeepAlive()Most servers provide a way to block such that the server doesn't exit, however some require the creation of a keep alive thread.default booleanisServer()This method returns whether the application is a server application or not.-
Methods inherited from interface io.micronaut.runtime.EmbeddedApplication
getApplicationConfiguration, getApplicationContext, getEnvironment, isForceExit
-
-
-
-
Method Detail
-
getPort
int getPort()
- Returns:
- The port exposed by the server
-
getHost
java.lang.String getHost()
- Returns:
- The host of the server
-
getScheme
java.lang.String getScheme()
- Returns:
- The scheme of the server (http/https)
-
getURL
java.net.URL getURL()
- Returns:
- The full URL to the server
-
getURI
java.net.URI getURI()
- Returns:
- The full URI to the server
-
getContextURI
default java.net.URI getContextURI()
- Returns:
- The full URI to the server with the context path
- Since:
- 3.9.1
-
isServer
default boolean isServer()
Description copied from interface:EmbeddedApplicationThis 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.- Specified by:
isServerin interfaceEmbeddedApplication<EmbeddedServer>- Returns:
- True if the application is a server
-
isKeepAlive
default boolean isKeepAlive()
Most servers provide a way to block such that the server doesn't exit, however some require the creation of a keep alive thread.- Returns:
- True if the server should be kept alive.
-
-