org.apache.coyote.Request.remoteHost()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(267)

本文整理了Java中org.apache.coyote.Request.remoteHost方法的一些代码示例,展示了Request.remoteHost的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.remoteHost方法的具体详情如下:
包路径:org.apache.coyote.Request
类名称:Request
方法名:remoteHost

Request.remoteHost介绍

暂无

代码示例

代码示例来源:origin: line/armeria

coyoteReq.remoteHost().setString(remoteAddr.getHostString());
coyoteReq.setRemotePort(remoteAddr.getPort());

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

@Override
protected final void populateRequestAttributeRemoteHost() {
  // Get remote host name using a DNS resolution
  if (request.remoteHost().isNull()) {
    try {
      request.remoteHost().setString(InetAddress.getByName
          (request.remoteAddr().toString()).getHostName());
    } catch (IOException iex) {
      // Ignore
    }
  }
}

代码示例来源:origin: org.jboss.web/jbossweb

/**
 * Get remote host name
 */
private void requestHostAttribute() {
  if (remoteHost == null && (channel != null)) {
    try {
      remoteHost = ((InetSocketAddress) this.channel.getRemoteAddress()).getHostName();
      if (remoteHost == null) {
        remoteAddr = ((InetSocketAddress) this.channel.getRemoteAddress()).getAddress()
            .getHostAddress();
        remoteHost = remoteAddr;
      }
    } catch (Exception e) {
      CoyoteLogger.HTTP_LOGGER.errorGettingSocketInformation(e);
    }
  }
  request.remoteHost().setString(remoteHost);
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

/**
 * Populate the remote host request attribute. Processors (e.g. AJP) that
 * populate this from an alternative source should override this method.
 */
protected void populateRequestAttributeRemoteHost() {
  if (getPopulateRequestAttributesFromSocket() && socketWrapper != null) {
    request.remoteHost().setString(socketWrapper.getRemoteHost());
  }
}

代码示例来源:origin: org.osivia.portal.core/osivia-portal-jbossas-jbossweb-lib

/*      */   public String getRemoteHost()
/*      */   {
/* 1181 */     if (this.remoteHost == null) {
/* 1182 */       if (!this.connector.getEnableLookups()) {
/* 1183 */         this.remoteHost = getRemoteAddr();
/*      */       } else {
/* 1185 */         this.coyoteRequest.action(ActionCode.ACTION_REQ_HOST_ATTRIBUTE, this.coyoteRequest);
/*      */ 
/* 1187 */         this.remoteHost = this.coyoteRequest.remoteHost().toString();
/*      */       }
/*      */     }
/* 1190 */     return this.remoteHost;
/*      */   }
/*      */

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

/**
 * Return the remote host name making this Request.
 */
@Override
public String getRemoteHost() {
  if (remoteHost == null) {
    if (!connector.getEnableLookups()) {
      remoteHost = getRemoteAddr();
    } else {
      coyoteRequest.action
        (ActionCode.REQ_HOST_ATTRIBUTE, coyoteRequest);
      remoteHost = coyoteRequest.remoteHost().toString();
    }
  }
  return remoteHost;
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

/**
 * @return the remote host name making this Request.
 */
@Override
public String getRemoteHost() {
  if (remoteHost == null) {
    if (!connector.getEnableLookups()) {
      remoteHost = getRemoteAddr();
    } else {
      coyoteRequest.action
        (ActionCode.REQ_HOST_ATTRIBUTE, coyoteRequest);
      remoteHost = coyoteRequest.remoteHost().toString();
    }
  }
  return remoteHost;
}

代码示例来源:origin: org.jboss.web/jbossweb

/**
 * Return the remote host name making this Request.
 */
public String getRemoteHost() {
  if (remoteHost == null) {
    if (!connector.getEnableLookups()) {
      remoteHost = getRemoteAddr();
    } else {
      coyoteRequest.action
        (ActionCode.ACTION_REQ_HOST_ATTRIBUTE, coyoteRequest);
      remoteHost = coyoteRequest.remoteHost().toString();
    }
  }
  return remoteHost;
}

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

/**
 * @return the remote host name making this Request.
 */
@Override
public String getRemoteHost() {
  if (remoteHost == null) {
    if (!connector.getEnableLookups()) {
      remoteHost = getRemoteAddr();
    } else {
      coyoteRequest.action
        (ActionCode.REQ_HOST_ATTRIBUTE, coyoteRequest);
      remoteHost = coyoteRequest.remoteHost().toString();
    }
  }
  return remoteHost;
}

代码示例来源:origin: jboss.web/jbossweb

/**
 * Return the remote host name making this Request.
 */
public String getRemoteHost() {
  if (remoteHost == null) {
    if (!connector.getEnableLookups()) {
      remoteHost = getRemoteAddr();
    } else {
      coyoteRequest.action
        (ActionCode.ACTION_REQ_HOST_ATTRIBUTE, coyoteRequest);
      remoteHost = coyoteRequest.remoteHost().toString();
    }
  }
  return remoteHost;
}

代码示例来源:origin: tomcat/catalina

/**
 * Return the remote host name making this Request.
 */
public String getRemoteHost() {
  if (remoteHost == null) {
    if (!connector.getEnableLookups()) {
      remoteHost = getRemoteAddr();
    } else {
      coyoteRequest.action
        (ActionCode.ACTION_REQ_HOST_ATTRIBUTE, coyoteRequest);
      remoteHost = coyoteRequest.remoteHost().toString();
    }
  }
  return remoteHost;
}

代码示例来源:origin: codefollower/Tomcat-Research

/**
 * Return the remote host name making this Request.
 */
@Override
public String getRemoteHost() {
  if (remoteHost == null) {
    if (!connector.getEnableLookups()) {
      remoteHost = getRemoteAddr();
    } else {
      coyoteRequest.action
        (ActionCode.REQ_HOST_ATTRIBUTE, coyoteRequest);
      remoteHost = coyoteRequest.remoteHost().toString();
    }
  }
  return remoteHost;
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

/**
 * Return the remote host name making this Request.
 */
@Override
public String getRemoteHost() {
  if (remoteHost == null) {
    if (!connector.getEnableLookups()) {
      remoteHost = getRemoteAddr();
    } else {
      coyoteRequest.action
        (ActionCode.REQ_HOST_ATTRIBUTE, coyoteRequest);
      remoteHost = coyoteRequest.remoteHost().toString();
    }
  }
  return remoteHost;
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

/**
 * Return the remote host name making this Request.
 */
@Override
public String getRemoteHost() {
  if (remoteHost == null) {
    if (!connector.getEnableLookups()) {
      remoteHost = getRemoteAddr();
    } else {
      coyoteRequest.action
        (ActionCode.REQ_HOST_ATTRIBUTE, coyoteRequest);
      remoteHost = coyoteRequest.remoteHost().toString();
    }
  }
  return remoteHost;
}

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

/**
 * Return the remote host name making this Request.
 */
@Override
public String getRemoteHost() {
  if (remoteHost == null) {
    if (!connector.getEnableLookups()) {
      remoteHost = getRemoteAddr();
    } else {
      coyoteRequest.action
        (ActionCode.REQ_HOST_ATTRIBUTE, coyoteRequest);
      remoteHost = coyoteRequest.remoteHost().toString();
    }
  }
  return remoteHost;
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

/**
 * Return the remote host name making this Request.
 */
@Override
public String getRemoteHost() {
  if (remoteHost == null) {
    if (!connector.getEnableLookups()) {
      remoteHost = getRemoteAddr();
    } else {
      coyoteRequest.action
        (ActionCode.REQ_HOST_ATTRIBUTE, coyoteRequest);
      remoteHost = coyoteRequest.remoteHost().toString();
    }
  }
  return remoteHost;
}

代码示例来源:origin: jboss.web/jbossweb

if (request.remoteHost().isNull()) {
  try {
    request.remoteHost().setString(InetAddress.getByName
        (request.remoteAddr().toString()).getHostName());
  } catch (IOException iex) {

代码示例来源:origin: org.apache.coyote.springsource/com.springsource.org.apache.coyote.springsource

if (request.remoteHost().isNull()) {
  try {
    request.remoteHost().setString(InetAddress.getByName
        (request.remoteAddr().toString()).getHostName());
  } catch (IOException iex) {

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

remoteHost = remoteAddr;
    } else { // all we can do is punt
      request.remoteHost().recycle();
request.remoteHost().setString(remoteHost);

代码示例来源:origin: org.apache.coyote.springsource/com.springsource.org.apache.coyote.springsource

msg.getBytes(req.remoteHost());
msg.getBytes(req.localName());
req.setLocalPort(msg.getInt());

相关文章

Request类方法