{
nextFilter.messageReceived( session, message );
return;
}
ByteBuffer in = ( ByteBuffer ) message;
ProtocolDecoder decoder = getDecoder( session );
ProtocolDecoderOutput decoderOut = getDecoderOut( session, nextFilter );
try
{
decoder.decode( session, in, decoderOut );
}
catch( Throwable t )
{
ProtocolDecoderException pde;
if( t instanceof ProtocolDecoderException )
{
pde = ( ProtocolDecoderException ) t;
}
else
{
pde = new ProtocolDecoderException( t );
}
pde.setHexdump( in.getHexDump() );
throw pde;
}
finally
{
// Dispose the decoder if this session is connectionless.
if( session.getTransportType().isConnectionless() )
{
disposeDecoder( session );
}
// Release the read buffer.
in.release();
decoderOut.flush();
}
}