Package io.micronaut.servlet.http
Class ServletHttpHandler<REQ,RES> 
java.lang.Object
io.micronaut.servlet.http.ServletHttpHandler<REQ,RES> 
- Type Parameters:
- REQ- The request object
- RES- The response object
- All Implemented Interfaces:
- io.micronaut.context.LifeCycle<ServletHttpHandler<REQ,,- RES>> - Closeable,- AutoCloseable
- Direct Known Subclasses:
- DefaultServletHttpHandler
public abstract class ServletHttpHandler<REQ,RES> 
extends Object
implements AutoCloseable, io.micronaut.context.LifeCycle<ServletHttpHandler<REQ,RES>> 
An HTTP handler that can deal with Serverless requests.
- Since:
- 1.2.0
- Author:
- graemerocher
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final io.micronaut.context.ApplicationContextprotected static final org.slf4j.LoggerLogger to be used by subclasses for logging.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedServletHttpHandler(io.micronaut.context.ApplicationContext applicationContext, io.micronaut.core.convert.ConversionService conversionService) Default constructor.
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()protected abstract ServletExchange<REQ,RES> createExchange(REQ request, RES response) Creates theDefaultServletExchangeobject.exchange(ServletExchange<REQ, RES> exchange) Handle the give native request and response and return theServletExchangeobject.Handle the give native request and response and return theServletExchangeobject.io.micronaut.context.ApplicationContextio.micronaut.http.codec.MediaTypeCodecRegistrybooleanvoidservice(ServletExchange<REQ, RES> exchange) Handles aDefaultServletExchange.voidHandle the give native request and response.@NonNull ServletHttpHandler<REQ,RES> start()@NonNull ServletHttpHandler<REQ,RES> stop()Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.context.LifeCyclerefresh
- 
Field Details- 
LOGprotected static final org.slf4j.Logger LOGLogger to be used by subclasses for logging.
- 
applicationContextprotected final io.micronaut.context.ApplicationContext applicationContext
 
- 
- 
Constructor Details- 
ServletHttpHandlerprotected ServletHttpHandler(io.micronaut.context.ApplicationContext applicationContext, io.micronaut.core.convert.ConversionService conversionService) Default constructor.- Parameters:
- applicationContext- The application context
- conversionService- The conversion service
 
 
- 
- 
Method Details- 
getApplicationContextpublic io.micronaut.context.ApplicationContext getApplicationContext()- Returns:
- The application context for the function.
 
- 
getMediaTypeCodecRegistrypublic io.micronaut.http.codec.MediaTypeCodecRegistry getMediaTypeCodecRegistry()- Returns:
- The media type codec registry.
 
- 
serviceHandle the give native request and response.- Parameters:
- request- The request
- response- The response
 
- 
exchangeHandle the give native request and response and return theServletExchangeobject.- Parameters:
- request- The request
- response- The response
- Returns:
- The ServletExchangeobject
 
- 
exchangeHandle the give native request and response and return theServletExchangeobject.- Parameters:
- exchange- The exchange
- Returns:
- The ServletExchangeobject
 
- 
isRunningpublic boolean isRunning()- Specified by:
- isRunningin interface- io.micronaut.context.LifeCycle<REQ>
 
- 
serviceHandles aDefaultServletExchange.- Parameters:
- exchange- The exchange
 
- 
closepublic void close()- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Specified by:
- closein interface- io.micronaut.context.LifeCycle<REQ>
 
- 
start- Specified by:
- startin interface- io.micronaut.context.LifeCycle<REQ>
 
- 
stop- Specified by:
- stopin interface- io.micronaut.context.LifeCycle<REQ>
 
- 
createExchangeCreates theDefaultServletExchangeobject.- Parameters:
- request- The request
- response- The response
- Returns:
- The exchange object
 
 
-