当前位置: 首页>>代码示例>>Java>>正文


Java Connector.getConnectionFactories方法代码示例

本文整理汇总了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;
}
 
开发者ID:fhissen,项目名称:CrococryptFile,代码行数:27,代码来源:JettyStart.java

示例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;
}
 
开发者ID:line,项目名称:armeria,代码行数:26,代码来源:ThriftOverHttpClientTServletIntegrationTest.java

示例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;
}
 
开发者ID:fhissen,项目名称:CrococryptQuerl,代码行数:27,代码来源:JettyLaunch.java

示例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);
      }
    }
  }    
}
 
开发者ID:cityzendata,项目名称:warp10-platform,代码行数:15,代码来源:JettyUtil.java

示例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");
  }
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:13,代码来源:WebServerTask.java


注:本文中的org.eclipse.jetty.server.Connector.getConnectionFactories方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。