public abstract class OneToOneEncoder extends Object implements ChannelDownstreamHandler
ChannelPipelinepipeline = ...; // Decoders pipeline.addLast("frameDecoder", newDelimiterBasedFrameDecoder(80,Delimiters.nulDelimiter())); pipeline.addLast("customDecoder", newOneToOneDecoder() { ... }); // Encoder pipeline.addLast("customEncoder", newOneToOneEncoder() { ... });
ChannelHandler.Sharable| Modifier | Constructor and Description |
|---|---|
protected |
OneToOneEncoder() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Object |
encode(ChannelHandlerContext ctx,
Channel channel,
Object msg)
Transforms the specified message into another message and return the
transformed message.
|
void |
handleDownstream(ChannelHandlerContext ctx,
ChannelEvent evt)
Handles the specified downstream event.
|
public void handleDownstream(ChannelHandlerContext ctx, ChannelEvent evt) throws Exception
ChannelDownstreamHandlerhandleDownstream in interface ChannelDownstreamHandlerctx - the context object for this handlerevt - the downstream event to process or interceptExceptionprotected abstract Object encode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception
null, unlike
you can in OneToOneDecoder.decode(ChannelHandlerContext, Channel, Object);
you must return something, at least ChannelBuffers.EMPTY_BUFFER.ExceptionCopyright © 2008-2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.