Class AbstractServletServer<T>
java.lang.Object
io.micronaut.servlet.engine.server.AbstractServletServer<T>
- Type Parameters:
T
- The server type
- All Implemented Interfaces:
io.micronaut.context.ApplicationContextLifeCycle<io.micronaut.runtime.server.EmbeddedServer>
,io.micronaut.context.ApplicationContextProvider
,io.micronaut.context.LifeCycle
,io.micronaut.runtime.EmbeddedApplication<io.micronaut.runtime.server.EmbeddedServer>
,io.micronaut.runtime.server.EmbeddedServer
,Closeable
,AutoCloseable
- Direct Known Subclasses:
JettyServer
,TomcatServer
,UndertowServer
public abstract class AbstractServletServer<T>
extends Object
implements io.micronaut.runtime.server.EmbeddedServer
Abstract base class for servlet embedded servers.
- Since:
- 1.0.0
- Author:
- graemerocher
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractServletServer
(io.micronaut.context.ApplicationContext applicationContext, io.micronaut.runtime.ApplicationConfiguration applicationConfiguration, T server) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal io.micronaut.runtime.ApplicationConfiguration
final io.micronaut.context.ApplicationContext
final T
final io.micronaut.runtime.server.EmbeddedServer
start()
protected abstract void
Start the server.final io.micronaut.runtime.server.EmbeddedServer
stop()
protected abstract void
Stop the server.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.runtime.EmbeddedApplication
getEnvironment, isForceExit
Methods inherited from interface io.micronaut.runtime.server.EmbeddedServer
getContextURI, getHost, getPort, getScheme, getURI, getURL, isKeepAlive, isServer
Methods inherited from interface io.micronaut.context.LifeCycle
close, isRunning, refresh
-
Constructor Details
-
AbstractServletServer
protected AbstractServletServer(io.micronaut.context.ApplicationContext applicationContext, io.micronaut.runtime.ApplicationConfiguration applicationConfiguration, T server) Default constructor.- Parameters:
applicationContext
- The application contextapplicationConfiguration
- The application configurationserver
- The server object
-
-
Method Details
-
getServer
- Returns:
- The server object.
-
getApplicationContext
public final io.micronaut.context.ApplicationContext getApplicationContext()- Specified by:
getApplicationContext
in interfaceio.micronaut.context.ApplicationContextProvider
- Specified by:
getApplicationContext
in interfaceio.micronaut.runtime.EmbeddedApplication<T>
-
getApplicationConfiguration
public final io.micronaut.runtime.ApplicationConfiguration getApplicationConfiguration()- Specified by:
getApplicationConfiguration
in interfaceio.micronaut.runtime.EmbeddedApplication<T>
-
start
public final io.micronaut.runtime.server.EmbeddedServer start() -
stop
public final io.micronaut.runtime.server.EmbeddedServer stop() -
startServer
Start the server.- Throws:
Exception
- when an error occurred starting the server
-
stopServer
Stop the server.- Throws:
Exception
- when an error occurred stopping the server
-