private ProtocolEncoderImpl() throws Exception {
            MessageEncoderFactory[] encoderFactories = DemuxingProtocolCodecFactory.this.encoderFactories;
            for (int i = encoderFactories.length - 1; i >= 0; i--) {
                MessageEncoder encoder = encoderFactories[i].getEncoder();
                Set<Class<?>> messageTypes = encoder.getMessageTypes();
                if (messageTypes == null) {
                    throw new IllegalStateException(encoder.getClass()
                            .getName()
                            + "#getMessageTypes() may not return null.");
                }

                Iterator<Class<?>> it = messageTypes.iterator();
                while (it.hasNext()) {
                    Class<?> type = it.next();
                    encoders.put(type, encoder);
                }
            }
        }