Esempio n. 1
0
  private void outputAuthInfo(ConnectionSpec auth) {
    String sCRLF = System.getProperty("line.separator");
    StringBuffer sbText = new StringBuffer();
    sbText.append("RpcTemplate: Dumping contents of auth: " + sCRLF);

    if (auth != null) {
      sbText.append("    clientHostName: " + auth.getClientHostName() + sCRLF);
      sbText.append("    clientAddress: " + auth.getClientAddress() + sCRLF);
      sbText.append("    hashCode: " + auth.hashCode() + sCRLF);
    } else {
      sbText.append("    auth was null" + sCRLF);
    }

    logger.debug(sbText.toString());
  }
Esempio n. 2
0
  private void outputRequestInfo(String sMessage, RpcRequest request) {
    String sCRLF = System.getProperty("line.separator");
    StringBuffer sbText = new StringBuffer();
    sbText.append(sMessage + sCRLF);
    sbText.append("RpcTemplate: Dumping contents of request: " + sCRLF + sCRLF);
    sbText.append(
        "Got here by the following trace: "
            + Arrays.toString(Thread.currentThread().getStackTrace())
            + sCRLF
            + sCRLF);

    if (request != null) {
      sbText.append("    credentials: " + request.getCredentials() + sCRLF);
      sbText.append("    rpcContext: " + request.getRpcContext() + sCRLF);
      sbText.append("    rpcName: " + request.getRpcName() + sCRLF);
      sbText.append("    rpcVersion: " + request.getRpcVersion() + sCRLF);
      sbText.append("    timeout: " + request.getTimeout() + sCRLF);
      sbText.append("    uriString: " + request.getUriString() + sCRLF);

      if ((request.getParams() != null) && (request.getParams().size() > 0)) {
        int i = 0;
        for (RpcParam oRpcParam : request.getParams()) {
          sbText.append("    rpcParam[" + i + "]:" + sCRLF);
          sbText.append("        type: " + oRpcParam.getType() + sCRLF);
          sbText.append("        value: " + oRpcParam.getValue() + sCRLF);
          i++;
        }
      }

      if (request.getHost() != null) {
        sbText.append("    host:" + sCRLF);
        sbText.append("        hostname: " + request.getHost().getHostname() + sCRLF);
        sbText.append("        port: " + request.getHost().getPort() + sCRLF);
        sbText.append("        scheme: " + request.getHost().getScheme() + sCRLF);
      }
    } else {
      sbText.append("    request was null" + sCRLF);
    }

    logger.debug(sbText.toString());
  }