Interface NettyCustomizableResponseTypeHandler<T>

  • Type Parameters:
    T - The type to be handled
    All Superinterfaces:
    io.micronaut.core.order.Ordered
    All Known Implementing Classes:
    FileTypeHandler

    @Internal
    @Indexed(NettyCustomizableResponseTypeHandler.class)
    public interface NettyCustomizableResponseTypeHandler<T>
    extends io.micronaut.core.order.Ordered
    Represents a class that is designed to handle specific types that are returned from routes in a netty specific way.
    Since:
    1.0
    • Field Summary

      • Fields inherited from interface io.micronaut.core.order.Ordered

        HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      io.netty.channel.ChannelFuture handle​(T object, io.micronaut.http.HttpRequest<?> request, io.micronaut.http.MutableHttpResponse<?> response, io.netty.channel.ChannelHandlerContext context)
      Responsible for fully handling the response, including any closing of the channel.
      boolean supports​(java.lang.Class<?> type)  
      • Methods inherited from interface io.micronaut.core.order.Ordered

        getOrder
    • Method Detail

      • handle

        io.netty.channel.ChannelFuture handle​(T object,
                                              io.micronaut.http.HttpRequest<?> request,
                                              io.micronaut.http.MutableHttpResponse<?> response,
                                              io.netty.channel.ChannelHandlerContext context)
        Responsible for fully handling the response, including any closing of the channel.
        Parameters:
        object - The object to be handled
        request - The native Netty request
        response - The mutable Micronaut response
        context - The channel context
        Returns:
        The channel future that completes when the response is fully written.
      • supports

        boolean supports​(java.lang.Class<?> type)
        Parameters:
        type - The type to check
        Returns:
        True if the handler supports handling the given type