class OutputMessageBuffer implements TextListener {

    public SsmlDocument nextMessage() throws InterruptedException,
            JVoiceXMLEvent, IOException {
        final BufferedSsmlDocument buffer = documents.take();
        if (event != null) {
            throw event;
        }
        final TextMessage message = buffer.getTextMessage();
        acknowledge(message);
        if (message.getType() == TextMessageType.BYE) {
            throw new ConnectionDisconnectHangupEvent();
        }
        return buffer.getDocument();
    }

      OutputMessageBuffer(final TextServer textServer);

}