/** * Dispose the decoder, removing its instance from the session's attributes, and calling the * associated dispose method. */ private void disposeDecoder(IoSession session) { ProtocolDecoder decoder = (ProtocolDecoder) session.removeAttribute(DECODER); if (decoder == null) { return; } try { decoder.dispose(session); } catch (Throwable t) { LOGGER.warn("Failed to dispose: " + decoder.getClass().getName() + " (" + decoder + ')'); } }
public void dispose(IoSession session) throws Exception { synchronized (decoder) { decoder.dispose(session); } }