io.servicefabric.transport.SharableSerializerHandler Maven / Gradle / Ivy
The newest version!
package io.servicefabric.transport;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;
@ChannelHandler.Sharable
final class SharableSerializerHandler extends MessageToByteEncoder {
private final MessageSerializer serializer;
public SharableSerializerHandler(MessageSerializer serializer) {
this.serializer = serializer;
}
@Override
protected void encode(ChannelHandlerContext ctx, Message msg, ByteBuf out) throws Exception {
serializer.serialize(msg, out);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy