本文整理汇总了Java中org.eclipse.jetty.server.Connector.getConnectionFactories方法的典型用法代码示例。如果您正苦于以下问题:Java Connector.getConnectionFactories方法的具体用法?Java Connector.getConnectionFactories怎么用?Java Connector.getConnectionFactories使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jetty.server.Connector
的用法示例。
在下文中一共展示了Connector.getConnectionFactories方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startup
import org.eclipse.jetty.server.Connector; //导入方法依赖的package包/类
public static boolean startup(int port) {
Server server = new Server(port);
ServletHandler handler = new ServletHandler();
handler.addServletWithMapping(CrocoWebDecryptor.class, "/*");
for(Connector y : server.getConnectors()) {
for(ConnectionFactory x : y.getConnectionFactories()) {
if(x instanceof HttpConnectionFactory) {
((HttpConnectionFactory)x).getHttpConfiguration().setSendServerVersion(false);
}
}
}
server.setHandler(handler);
try {
server.start();
return true;
} catch (Exception e) {
try {
server.stop();
} catch (Exception e2) {}
}
return false;
}
示例2: startHttp1
import org.eclipse.jetty.server.Connector; //导入方法依赖的package包/类
private static Server startHttp1() throws Exception {
Server server = new Server(0);
ServletHandler handler = new ServletHandler();
handler.addServletWithMapping(newServletHolder(thriftServlet), TSERVLET_PATH);
handler.addServletWithMapping(newServletHolder(rootServlet), "/");
handler.addFilterWithMapping(new FilterHolder(new ConnectionCloseFilter()), "/*",
EnumSet.of(DispatcherType.REQUEST));
server.setHandler(handler);
for (Connector c : server.getConnectors()) {
for (ConnectionFactory f : c.getConnectionFactories()) {
for (String p : f.getProtocols()) {
if (p.startsWith("h2c")) {
fail("Attempted to create a Jetty server without HTTP/2 support, but failed: " +
f.getProtocols());
}
}
}
}
server.start();
return server;
}
示例3: startup
import org.eclipse.jetty.server.Connector; //导入方法依赖的package包/类
public static boolean startup(int port) {
Server server = new Server(port);
ServletHandler handler = new ServletHandler();
handler.addServletWithMapping(Querler.class, "/*");
for(Connector y : server.getConnectors()) {
for(ConnectionFactory x : y.getConnectionFactories()) {
if(x instanceof HttpConnectionFactory) {
((HttpConnectionFactory)x).getHttpConfiguration().setSendServerVersion(false);
}
}
}
server.setHandler(handler);
try {
server.start();
return true;
} catch (Exception e) {
try {
server.stop();
} catch (Exception e2) {}
}
return false;
}
示例4: customize
import org.eclipse.jetty.server.Connector; //导入方法依赖的package包/类
@Override
public void customize(Server server) {
ForwardedRequestCustomizer customizer = new ForwardedRequestCustomizer();
for (Connector connector : server.getConnectors()) {
for (ConnectionFactory connectionFactory : connector
.getConnectionFactories()) {
if (connectionFactory instanceof HttpConfiguration.ConnectionFactory) {
((HttpConfiguration.ConnectionFactory) connectionFactory)
.getHttpConfiguration().addCustomizer(customizer);
}
}
}
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:14,代码来源:JettyEmbeddedServletContainerFactory.java
示例5: setSendServerVersion
import org.eclipse.jetty.server.Connector; //导入方法依赖的package包/类
public static void setSendServerVersion(Server server, boolean send) {
//
// Remove display of Server header
// @see http://stackoverflow.com/questions/15652902/remove-the-http-server-header-in-jetty-9
//
for(Connector y : server.getConnectors()) {
for(ConnectionFactory x : y.getConnectionFactories()) {
if(x instanceof HttpConnectionFactory) {
((HttpConnectionFactory)x).getHttpConfiguration().setSendServerVersion(send);
}
}
}
}
示例6: setSSLContext
import org.eclipse.jetty.server.Connector; //导入方法依赖的package包/类
private void setSSLContext() {
for (Connector connector : server.getConnectors()) {
for (ConnectionFactory connectionFactory : connector.getConnectionFactories()) {
if (connectionFactory instanceof SslConnectionFactory) {
runtimeInfo.setSSLContext(((SslConnectionFactory) connectionFactory).getSslContextFactory().getSslContext());
}
}
}
if (runtimeInfo.getSSLContext() == null) {
throw new IllegalStateException("Unexpected error, SSLContext is not set for https enabled server");
}
}