Req
- The request objectRes
- The response objectpublic abstract class ServletHttpHandler<Req,Res>
extends java.lang.Object
implements java.lang.AutoCloseable
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
LOG
Logger to be used by subclasses for logging.
|
Constructor and Description |
---|
ServletHttpHandler(io.micronaut.context.ApplicationContext applicationContext)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected abstract ServletExchange<Req,Res> |
createExchange(Req request,
Res response)
Creates the
DefaultServletExchange object. |
io.micronaut.context.ApplicationContext |
getApplicationContext() |
io.micronaut.http.codec.MediaTypeCodecRegistry |
getMediaTypeCodecRegistry() |
void |
service(Req request,
Res response)
Handle the give native request and response.
|
void |
service(ServletExchange<Req,Res> exchange)
Handles a
DefaultServletExchange . |
protected static final org.slf4j.Logger LOG
public ServletHttpHandler(io.micronaut.context.ApplicationContext applicationContext)
applicationContext
- The application contextpublic io.micronaut.context.ApplicationContext getApplicationContext()
public io.micronaut.http.codec.MediaTypeCodecRegistry getMediaTypeCodecRegistry()
public void service(Req request, Res response)
request
- The requestresponse
- The responsepublic void service(ServletExchange<Req,Res> exchange)
DefaultServletExchange
.exchange
- The exchangepublic void close()
close
in interface java.lang.AutoCloseable
protected abstract ServletExchange<Req,Res> createExchange(Req request, Res response)
DefaultServletExchange
object.request
- The requestresponse
- The response