Req
- The request objectRes
- The response objectpublic abstract class ServletHttpHandler<Req,Res> extends java.lang.Object implements java.lang.AutoCloseable, io.micronaut.context.LifeCycle<ServletHttpHandler<Req,Res>>
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. |
ServletExchange<Req,Res> |
exchange(Req request,
Res response)
Handle the give native request and response and return the
ServletExchange object. |
ServletExchange<Req,Res> |
exchange(ServletExchange<Req,Res> exchange)
Handle the give native request and response and return the
ServletExchange object. |
io.micronaut.context.ApplicationContext |
getApplicationContext() |
io.micronaut.http.codec.MediaTypeCodecRegistry |
getMediaTypeCodecRegistry() |
boolean |
isRunning() |
void |
service(Req request,
Res response)
Handle the give native request and response.
|
void |
service(ServletExchange<Req,Res> exchange)
Handles a
DefaultServletExchange . |
ServletHttpHandler<Req,Res> |
start() |
ServletHttpHandler<Req,Res> |
stop() |
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 ServletExchange<Req,Res> exchange(Req request, Res response)
ServletExchange
object.request
- The requestresponse
- The responseServletExchange
objectpublic ServletExchange<Req,Res> exchange(ServletExchange<Req,Res> exchange)
ServletExchange
object.exchange
- The exchangeServletExchange
objectpublic boolean isRunning()
isRunning
in interface io.micronaut.context.LifeCycle<ServletHttpHandler<Req,Res>>
public void service(ServletExchange<Req,Res> exchange)
DefaultServletExchange
.exchange
- The exchangepublic void close()
close
in interface io.micronaut.context.LifeCycle<ServletHttpHandler<Req,Res>>
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
@Nonnull public ServletHttpHandler<Req,Res> start()
start
in interface io.micronaut.context.LifeCycle<ServletHttpHandler<Req,Res>>
@Nonnull public ServletHttpHandler<Req,Res> stop()
stop
in interface io.micronaut.context.LifeCycle<ServletHttpHandler<Req,Res>>
protected abstract ServletExchange<Req,Res> createExchange(Req request, Res response)
DefaultServletExchange
object.request
- The requestresponse
- The response