コード例 #1
0
  // reject if the host doesn't match
  public void setHost(String host) throws ActiveMQStompException {
    if (host == null) {
      ActiveMQStompException error = BUNDLE.nullHostHeader().setHandler(frameHandler);
      error.setBody(BUNDLE.hostCannotBeNull());
      throw error;
    }

    String localHost = manager.getVirtualHostName();
    if (!host.equals(localHost)) {
      ActiveMQStompException error = BUNDLE.hostNotMatch().setHandler(frameHandler);
      error.setBody(BUNDLE.hostNotMatchDetails(host));
      throw error;
    }
  }