Example usage for io.netty.handler.codec UnsupportedMessageTypeException UnsupportedMessageTypeException

List of usage examples for io.netty.handler.codec UnsupportedMessageTypeException UnsupportedMessageTypeException

Introduction

In this page you can find the example usage for io.netty.handler.codec UnsupportedMessageTypeException UnsupportedMessageTypeException.

Prototype

public UnsupportedMessageTypeException(Throwable cause) 

Source Link

Usage

From source file:io.hydramq.core.net.netty.CommandDecoder.java

License:Open Source License

@Override
protected void decode(final ChannelHandlerContext ctx, final ByteBuf buffer, final List<Object> out)
        throws Exception {
    Command command = conversionContext.read(buffer);
    if (command == null) {
        String message = "Type '" + buffer.readInt() + "' not supported";
        throw new UnsupportedMessageTypeException(message);
    }//  w  ww.  j  a  va 2  s.  com
    out.add(command);
}