class ApplicationThreadDeframer implements Deframer, MessageDeframer.Listener {

  @Override
  public void deframe(final ReadableBuffer data) {
    storedListener.messagesAvailable(
        new InitializingMessageProducer(
            new Runnable() {
              @Override
              public void run() {
                try {
                  deframer.deframe(data);
                } catch (Throwable t) {
                  deframeFailed(t);
                  deframer.close(); // unrecoverable state
                }
              }
            }));
  }

    ApplicationThreadDeframer(
      MessageDeframer.Listener listener,
      TransportExecutor transportExecutor,
      MessageDeframer deframer);

}