public void setJMSReplyTo(final Destination dest) throws JMSException {
    if (dest == null) {
      message.removeProperty(REPLYTO_HEADER_NAME);

      replyTo = null;
    } else {
      if (dest instanceof JBossDestination == false) {
        throw new InvalidDestinationException("Not a JBoss destination " + dest);
      }

      JBossDestination jbd = (JBossDestination) dest;

      message.putStringProperty(REPLYTO_HEADER_NAME, jbd.getSimpleAddress());

      replyTo = jbd;
    }
  }
  public Destination getJMSDestination() throws JMSException {
    if (dest == null) {
      SimpleString sdest = message.getDestination();

      dest = sdest == null ? null : JBossDestination.fromAddress(sdest.toString());
    }

    return dest;
  }
  public Destination getJMSReplyTo() throws JMSException {
    if (replyTo == null) {
      SimpleString repl = (SimpleString) message.getProperty(REPLYTO_HEADER_NAME);

      if (repl != null) {
        replyTo = JBossDestination.fromAddress(repl.toString());
      }
    }
    return replyTo;
  }