@Test public void testDecodeNoChannel() throws Exception { OFMessageDecoder decoder = new OFMessageDecoder(); ChannelBuffer channelBuffer = getHelloMessageBuffer(); Object message = decoder.decode(new ChannelHandlerContextAdapter(), new ChannelAdapter(), channelBuffer); assertThat(message, nullValue()); }
@Override protected Object decode(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer) throws Exception { if (!channel.isConnected()) { return null; } OFMessageReader<OFMessage> reader = OFFactories.getGenericReader(); OFMessage message = reader.readFrom(buffer); return message; }
OFMessageDecoder extends FrameDecoder { @Override protected Object decode(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer) throws Exception { if (!channel.isConnected()) { return null; } OFMessageReader<OFMessage> reader = OFFactories.getGenericReader(); OFMessage message = reader.readFrom(buffer); return message; } }
OFMessageDecoder extends FrameDecoder { @Override protected Object decode(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer) throws Exception { if (!channel.isConnected()) { return null; } OFMessageReader<OFMessage> reader = OFFactories.getGenericReader(); OFMessage message = reader.readFrom(buffer); return message; }  }
OFMessageDecoder extends FrameDecoder { @Override protected Object decode(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer) throws Exception { if (!channel.isConnected()) { return null; } OFMessageReader<OFMessage> reader = OFFactories.getGenericReader(); OFMessage message = reader.readFrom(buffer); return message; }   }
OFMessageDecoder extends FrameDecoder { @Override protected Object decode(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer) throws Exception { if (!channel.isConnected()) { return null; } OFMessageReader<OFMessage> reader = OFFactories.getGenericReader(); OFMessage message = reader.readFrom(buffer); return message; }    }