Class NettyConverters
java.lang.Object
io.micronaut.http.server.netty.converters.NettyConverters
- All Implemented Interfaces:
TypeConverterRegistrar
@Prototype
@Internal
public final class NettyConverters
extends Object
implements TypeConverterRegistrar
Factory for bytebuf related converters.
- Since:
- 1.0
- Author:
- graemerocher
-
Constructor Summary
ConstructorDescriptionNettyConverters
(ConversionService conversionService, BeanProvider<MediaTypeCodecRegistry> decoderRegistryProvider, BeanProvider<MessageBodyHandlerRegistry> messageBodyHandlerRegistries, BeanProvider<ChannelOptionFactory> channelOptionFactory) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> void
postProcess
(io.netty.util.ReferenceCounted input, Optional<T> converted) static <T> Optional<T>
refCountAwareConvert
(ConversionService service, io.netty.util.ReferenceCounted input, ArgumentConversionContext<T> context) This method converts anetty reference counted object
and transfers release ownership to the new object.void
register
(MutableConversionService conversionService) Interface for registrars ofTypeConverter
instances.
-
Constructor Details
-
NettyConverters
public NettyConverters(ConversionService conversionService, BeanProvider<MediaTypeCodecRegistry> decoderRegistryProvider, BeanProvider<MessageBodyHandlerRegistry> messageBodyHandlerRegistries, BeanProvider<ChannelOptionFactory> channelOptionFactory) Default constructor.- Parameters:
conversionService
- The conversion servicedecoderRegistryProvider
- The decoder registry providermessageBodyHandlerRegistries
- The message body handlerschannelOptionFactory
- The decoder channel option factory
-
-
Method Details
-
register
Description copied from interface:TypeConverterRegistrar
Interface for registrars ofTypeConverter
instances.- Specified by:
register
in interfaceTypeConverterRegistrar
- Parameters:
conversionService
- TheConversionService
-
refCountAwareConvert
public static <T> Optional<T> refCountAwareConvert(ConversionService service, io.netty.util.ReferenceCounted input, ArgumentConversionContext<T> context) This method converts anetty reference counted object
and transfers release ownership to the new object.- Type Parameters:
T
- Target type- Parameters:
service
- The conversion servicecontext
- The context to convert toinput
- The object to convert- Returns:
- The converted object
-
postProcess
-