Example usage for org.apache.mina.codec ProtocolDecoderException ProtocolDecoderException

List of usage examples for org.apache.mina.codec ProtocolDecoderException ProtocolDecoderException

Introduction

In this page you can find the example usage for org.apache.mina.codec ProtocolDecoderException ProtocolDecoderException.

Prototype

public ProtocolDecoderException(Throwable cause) 

Source Link

Usage

From source file:mqttexperiment.codec.DecodeString.java

License:Apache License

@Override
public void finishDecode(DecodeStringContext ctx) {
    if (ctx.state != DONE) {
        throw new ProtocolDecoderException("unfinished string decoding");
    }//from   w  ww.j  ava 2s  . c  om
}

From source file:mqttexperiment.codec.MqttDecoder.java

License:Apache License

@Override
public void finishDecode(MqttDecoderContext state) {
    if (state.st != MqttDecodingStep.HEADER) {
        throw new ProtocolDecoderException("A partial message is pending");
    }//ww w . j a v a 2s.  c  o m
}

From source file:org.geb.core.mina.ThriftMessageDecoder.java

@Override
public MESSAGE decode(final ByteBuffer input, final Void context) {
    MESSAGE object;// w  w w  .  jav a  2s  . c o m
    try {
        byte array[] = new byte[input.remaining()];
        input.get(array);
        object = clazz.newInstance();
        deserializer.deserialize(object, array);
        return object;
    } catch (TException | InstantiationException | IllegalAccessException e) {
        throw new ProtocolDecoderException(e);
    }
}