本文整理了Java中org.mortbay.jetty.Connector.getHost()
方法的一些代码示例,展示了Connector.getHost()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Connector.getHost()
方法的具体详情如下:
包路径:org.mortbay.jetty.Connector
类名称:Connector
方法名:getHost
暂无
代码示例来源:origin: azkaban/azkaban
@Override
public String getHost() {
return this.connector.getHost();
}
代码示例来源:origin: com.linkedin.azkaban/azkaban
@Override
public String getHost() {
return connector.getHost();
}
代码示例来源:origin: com.linkedin.azkaban/azkaban-common
@Override
public String getHost() {
return this.connector.getHost();
}
代码示例来源:origin: io.hops/hadoop-common
@Override
public String toString() {
Preconditions.checkState(!listeners.isEmpty());
StringBuilder sb = new StringBuilder("HttpServer (")
.append(isAlive() ? STATE_DESCRIPTION_ALIVE
: STATE_DESCRIPTION_NOT_LIVE)
.append("), listening at:");
for (Connector l : listeners) {
sb.append(l.getHost()).append(":").append(l.getPort()).append("/,");
}
return sb.toString();
}
代码示例来源:origin: com.github.jiayuhan-it/hadoop-common
@Override
public String toString() {
Preconditions.checkState(!listeners.isEmpty());
StringBuilder sb = new StringBuilder("HttpServer (")
.append(isAlive() ? STATE_DESCRIPTION_ALIVE
: STATE_DESCRIPTION_NOT_LIVE)
.append("), listening at:");
for (Connector l : listeners) {
sb.append(l.getHost()).append(":").append(l.getPort()).append("/,");
}
return sb.toString();
}
代码示例来源:origin: ch.cern.hadoop/hadoop-common
@Override
public String toString() {
Preconditions.checkState(!listeners.isEmpty());
StringBuilder sb = new StringBuilder("HttpServer (")
.append(isAlive() ? STATE_DESCRIPTION_ALIVE
: STATE_DESCRIPTION_NOT_LIVE)
.append("), listening at:");
for (Connector l : listeners) {
sb.append(l.getHost()).append(":").append(l.getPort()).append("/,");
}
return sb.toString();
}
代码示例来源:origin: ch.cern.hadoop/hadoop-common
protected void initSpnego(Configuration conf,
String usernameConfKey, String keytabConfKey) throws IOException {
Map<String, String> params = new HashMap<String, String>();
String principalInConf = conf.get(usernameConfKey);
if (principalInConf != null && !principalInConf.isEmpty()) {
params.put("kerberos.principal",
SecurityUtil.getServerPrincipal(principalInConf, listener.getHost()));
}
String httpKeytab = conf.get(keytabConfKey);
if (httpKeytab != null && !httpKeytab.isEmpty()) {
params.put("kerberos.keytab", httpKeytab);
}
params.put(AuthenticationFilter.AUTH_TYPE, "kerberos");
defineFilter(webAppContext, SPNEGO_FILTER,
AuthenticationFilter.class.getName(), params, null);
}
代码示例来源:origin: com.github.jiayuhan-it/hadoop-common
/**
* Return the bind address of the listener.
* @return InetSocketAddress of the listener
*/
public InetSocketAddress getListenerAddress() {
int port = listener.getLocalPort();
if (port == -1) { // not bound, return requested port
port = listener.getPort();
}
return new InetSocketAddress(listener.getHost(), port);
}
代码示例来源:origin: io.hops/hadoop-common
protected void initSpnego(Configuration conf,
String usernameConfKey, String keytabConfKey) throws IOException {
Map<String, String> params = new HashMap<String, String>();
String principalInConf = conf.get(usernameConfKey);
if (principalInConf != null && !principalInConf.isEmpty()) {
params.put("kerberos.principal",
SecurityUtil.getServerPrincipal(principalInConf, listener.getHost()));
}
String httpKeytab = conf.get(keytabConfKey);
if (httpKeytab != null && !httpKeytab.isEmpty()) {
params.put("kerberos.keytab", httpKeytab);
}
params.put(AuthenticationFilter.AUTH_TYPE, "kerberos");
defineFilter(webAppContext, SPNEGO_FILTER,
AuthenticationFilter.class.getName(), params, null);
}
代码示例来源:origin: io.hops/hadoop-common
/**
* Return the bind address of the listener.
* @return InetSocketAddress of the listener
*/
public InetSocketAddress getListenerAddress() {
int port = listener.getLocalPort();
if (port == -1) { // not bound, return requested port
port = listener.getPort();
}
return new InetSocketAddress(listener.getHost(), port);
}
代码示例来源:origin: ch.cern.hadoop/hadoop-common
/**
* Return the bind address of the listener.
* @return InetSocketAddress of the listener
*/
public InetSocketAddress getListenerAddress() {
int port = listener.getLocalPort();
if (port == -1) { // not bound, return requested port
port = listener.getPort();
}
return new InetSocketAddress(listener.getHost(), port);
}
代码示例来源:origin: io.hops/hadoop-common
/**
* Return the host and port of the HttpServer, if live
* @return the classname and any HTTP URL
*/
@Override
public String toString() {
return listener != null ?
("HttpServer at http://" + listener.getHost() + ":" + listener.getLocalPort() + "/"
+ (isAlive() ? STATE_DESCRIPTION_ALIVE : STATE_DESCRIPTION_NOT_LIVE))
: "Inactive HttpServer";
}
代码示例来源:origin: com.github.jiayuhan-it/hadoop-common
/**
* Return the host and port of the HttpServer, if live
* @return the classname and any HTTP URL
*/
@Override
public String toString() {
return listener != null ?
("HttpServer at http://" + listener.getHost() + ":" + listener.getLocalPort() + "/"
+ (isAlive() ? STATE_DESCRIPTION_ALIVE : STATE_DESCRIPTION_NOT_LIVE))
: "Inactive HttpServer";
}
代码示例来源:origin: ch.cern.hadoop/hadoop-common
/**
* Return the host and port of the HttpServer, if live
* @return the classname and any HTTP URL
*/
@Override
public String toString() {
return listener != null ?
("HttpServer at http://" + listener.getHost() + ":" + listener.getLocalPort() + "/"
+ (isAlive() ? STATE_DESCRIPTION_ALIVE : STATE_DESCRIPTION_NOT_LIVE))
: "Inactive HttpServer";
}
代码示例来源:origin: org.apache.tajo/tajo-core
/**
* Return the host and port of the HttpServer, if live
*
* @return the classname and any HTTP URL
*/
@Override
public String toString() {
return listener != null ? ("HttpServer at http://" + listener.getHost()
+ ":" + listener.getLocalPort() + "/" + (isAlive() ? STATE_DESCRIPTION_ALIVE
: STATE_DESCRIPTION_NOT_LIVE))
: "Inactive HttpServer";
}
}
代码示例来源:origin: apache/tajo
/**
* Return the host and port of the HttpServer, if live
*
* @return the classname and any HTTP URL
*/
@Override
public String toString() {
return listener != null ? ("HttpServer at http://" + listener.getHost()
+ ":" + listener.getLocalPort() + "/" + (isAlive() ? STATE_DESCRIPTION_ALIVE
: STATE_DESCRIPTION_NOT_LIVE))
: "Inactive HttpServer";
}
}
代码示例来源:origin: org.apache.isis.runtimes.dflt/webserver
private String baseFor(final Server jettyServer) {
final Connector connector = jettyServer.getConnectors()[0];
final String scheme = "http";
final String host = StringUtils.coalesce(connector.getHost(), "localhost");
final int port = connector.getPort();
final WebAppContext handler = (WebAppContext) jettyServer.getHandler();
final String contextPath = handler.getContextPath();
final StringBuilder buf = new StringBuilder();
final Formatter formatter = new Formatter(buf);
formatter.format("%s://%s:%d/%s", scheme, host, port, contextPath);
return appendSlashIfRequired(buf).toString();
}
代码示例来源:origin: ch.cern.hadoop/hadoop-kms
private static URL getJettyURL(Server server) {
boolean ssl = server.getConnectors()[0].getClass()
== SslSelectChannelConnectorSecure.class;
try {
String scheme = (ssl) ? "https" : "http";
return new URL(scheme + "://" +
server.getConnectors()[0].getHost() + ":" +
server.getConnectors()[0].getPort());
} catch (MalformedURLException ex) {
throw new RuntimeException("It should never happen, " + ex.getMessage(),
ex);
}
}
代码示例来源:origin: ch.cern.hadoop/hadoop-common
protected String getJettyURL() {
Connector c = jetty.getConnectors()[0];
return "http://" + c.getHost() + ":" + c.getPort();
}
代码示例来源:origin: com.github.jiayuhan-it/hadoop-common
protected String getJettyURL() {
Connector c = jetty.getConnectors()[0];
return "http://" + c.getHost() + ":" + c.getPort();
}
内容来源于网络,如有侵权,请联系作者删除!