org.apache.catalina.connector.Connector.getProperty()方法的使用及代码示例

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

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

Connector.getProperty介绍

[英]Return a configured property.
[中]返回已配置的属性。

代码示例

代码示例来源:origin: SonarSource/sonarqube

@Test
public void bind_to_specific_address() {
 Properties p = new Properties();
 p.setProperty("sonar.web.port", "9000");
 p.setProperty("sonar.web.host", "1.2.3.4");
 TomcatConnectors.configure(tomcat, new Props(p));
 verify(tomcat.getService())
  .addConnector(argThat(c -> c.getScheme().equals("http") && c.getPort() == 9000 && ((InetAddress) c.getProperty("address")).getHostAddress().equals("1.2.3.4")));
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void bind_to_all_addresses_by_default() {
 Properties p = new Properties();
 p.setProperty("sonar.web.port", "9000");
 TomcatConnectors.configure(tomcat, new Props(p));
 verify(tomcat.getService()).addConnector(argThat(c -> c.getScheme().equals("http") && c.getPort() == 9000 && ((InetAddress) c.getProperty("address")).getHostAddress().equals("0.0.0.0")));
}

代码示例来源:origin: SonarSource/sonarqube

private void verifyHttpConnector(int expectedPort, Map<String, Object> expectedProps) {
  verify(tomcat.getService()).addConnector(argThat(c -> {
   if (!c.getScheme().equals("http")) {
    return false;
   }
   if (!c.getProtocol().equals(TomcatConnectors.HTTP_PROTOCOL)) {
    return false;
   }
   if (c.getPort() != expectedPort) {
    return false;
   }
   for (Map.Entry<String, Object> expectedProp : expectedProps.entrySet()) {
    if (!expectedProp.getValue().equals(c.getProperty(expectedProp.getKey()))) {
     return false;
    }
   }
   return true;
  }));
 }
}

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

/**
 * Return a property from the protocol handler.
 *
 * @param name the property name
 * @return the property value
 */
public Object getAttribute(String name) {
  return getProperty(name);
}

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

/**
 * Return a configured property.
 */
public Object getAttribute(String name) {
  return getProperty(name);
}

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

/**
 * Return a configured property.
 */
public Object getAttribute(String name) {
  return getProperty(name);
}

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

/**
 * Return a configured property.
 */
public Object getAttribute(String name) {
  return getProperty(name);
}

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

/**
 * Return a configured property.
 */
public Object getAttribute(String name) {
  return getProperty(name);
}

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

/**
 * Return a configured property.
 */
public Object getAttribute(String name) {
  return getProperty(name);
}

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

/**
 * Return a configured property.
 */
public Object getAttribute(String name) {
  return getProperty(name);
}

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

/**
 * @return the port number on which this connector is listening to requests.
 * If the special value for {@link #getPort} of zero is used then this method
 * will report the actual port bound.
 */
public int getLocalPort() {
  return ((Integer) getProperty("localPort")).intValue();
}

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

/**
 * Return the port number on which this connector is listening to requests.
 * If the special value for {@link #port} of zero is used then this method
 * will report the actual port bound.
 */
public int getLocalPort() {
  return ((Integer) getProperty("localPort")).intValue();
}

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

/**
 * @return the port number on which this connector is listening to requests.
 * If the special value for {@link #getPort} of zero is used then this method
 * will report the actual port bound.
 */
public int getLocalPort() {
  return ((Integer) getProperty("localPort")).intValue();
}

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

/**
 * Return the maximum number of headers that are allowed by the container. A
 * value of less than 0 means no limit.
 */
public int getMaxHeaderCount() {
  return ((Integer) getProperty("maxHeaderCount")).intValue();
}

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

/**
 * Return the port number on which this connector is listening to requests.
 * If the special value for {@link #port} of zero is used then this method
 * will report the actual port bound.
 */
public int getLocalPort() {
  return ((Integer) getProperty("localPort")).intValue();
}

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

/**
 * Return the maximum number of headers that are allowed by the container. A
 * value of less than 0 means no limit.
 */
public int getMaxHeaderCount() {
  return ((Integer) getProperty("maxHeaderCount")).intValue();
}

代码示例来源:origin: org.mobicents.servlet.sip.containers/sip-servlets-as7

protected ObjectName createSipConnectorObjectName(Connector connector, String domain, String type)
   throws MalformedObjectNameException {
   String encodedAddr = null;
   if (connector.getProperty("address") != null) {
     encodedAddr = URLEncoder.encode(connector.getProperty("address").toString());
   }
   String addSuffix = (connector.getProperty("address") == null) ? "" : ",address="
       + encodedAddr;
   ObjectName _oname = new ObjectName(domain + ":type=" + type + ",port="
       + connector.getPort() + ",transport=" + connector.getProperty("transport") + addSuffix);
   return _oname;
}

代码示例来源:origin: org.mobicents.servlet.sip.containers/sip-servlets-catalina

protected ObjectName createSipConnectorObjectName(Connector connector, String domain, String type)
   throws MalformedObjectNameException {
   String encodedAddr = null;
   if (connector.getProperty("address") != null) {
     encodedAddr = URLEncoder.encode(connector.getProperty("address").toString());
   }
   String addSuffix = (connector.getProperty("address") == null) ? "" : ",address="
       + encodedAddr;
   ObjectName _oname = new ObjectName(domain + ":type=" + type + ",port="
       + connector.getPort() + ",transport=" + connector.getProperty("transport") + addSuffix);
   return _oname;
}

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

protected ObjectName createObjectName(String domain, String type)
    throws MalformedObjectNameException {
  String encodedAddr = null;
  if (getProperty("address") != null) {
    encodedAddr = URLEncoder.encode(getProperty("address").toString());
  }
  String addSuffix = (getProperty("address") == null) ? "" : ",address="
      + encodedAddr;
  ObjectName _oname = new ObjectName(domain + ":type=" + type + ",port="
      + getPort() + addSuffix);
  return _oname;
}

代码示例来源:origin: org.glassfish.main.web/web-core

protected ObjectName createObjectName(String domain, String type)
    throws MalformedObjectNameException {
  String encodedAddr = null;
  if (getAddress() != null) {
    encodedAddr = URLEncoder.encode(getProperty("address"));
  }
  String addSuffix = (getAddress() == null) ? "" : ",address="
      + encodedAddr;
  ObjectName _oname = new ObjectName(domain + ":type=" + type + ",port="
      + getPort() + addSuffix);
  return _oname;
}

相关文章

Connector类方法