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


Java HttpConfiguration.setOutputBufferSize方法代码示例

本文整理汇总了Java中org.eclipse.jetty.server.HttpConfiguration.setOutputBufferSize方法的典型用法代码示例。如果您正苦于以下问题:Java HttpConfiguration.setOutputBufferSize方法的具体用法?Java HttpConfiguration.setOutputBufferSize怎么用?Java HttpConfiguration.setOutputBufferSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jetty.server.HttpConfiguration的用法示例。


在下文中一共展示了HttpConfiguration.setOutputBufferSize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: newHttpConfiguration

import org.eclipse.jetty.server.HttpConfiguration; //导入方法依赖的package包/类
public HttpConfiguration newHttpConfiguration() {

        // HTTP Configuration
        
        boolean sendServerVersion = Boolean.parseBoolean(
                System.getProperty(AthenzConsts.ATHENZ_PROP_SEND_SERVER_VERSION, "false"));
        boolean sendDateHeader = Boolean.parseBoolean(
                System.getProperty(AthenzConsts.ATHENZ_PROP_SEND_DATE_HEADER, "false"));
        int outputBufferSize = Integer.parseInt(
                System.getProperty(AthenzConsts.ATHENZ_PROP_OUTPUT_BUFFER_SIZE, "32768"));
        int requestHeaderSize = Integer.parseInt(
                System.getProperty(AthenzConsts.ATHENZ_PROP_REQUEST_HEADER_SIZE, "8192"));
        int responseHeaderSize = Integer.parseInt(
                System.getProperty(AthenzConsts.ATHENZ_PROP_RESPONSE_HEADER_SIZE, "8192"));
        
        HttpConfiguration httpConfig = new HttpConfiguration();
        
        httpConfig.setOutputBufferSize(outputBufferSize);
        httpConfig.setRequestHeaderSize(requestHeaderSize);
        httpConfig.setResponseHeaderSize(responseHeaderSize);
        httpConfig.setSendServerVersion(sendServerVersion);
        httpConfig.setSendDateHeader(sendDateHeader);

        return httpConfig;
    }
 
开发者ID:yahoo,项目名称:athenz,代码行数:26,代码来源:AthenzJettyContainer.java

示例2: buildHttpConfiguration

import org.eclipse.jetty.server.HttpConfiguration; //导入方法依赖的package包/类
protected HttpConfiguration buildHttpConfiguration() {

        HttpConfiguration httpConfig = new HttpConfiguration();

        // most parameters are hardcoded for now... we should turn these
        // into properties

        httpConfig.setHeaderCacheSize(512);
        httpConfig.setOutputBufferSize(32 * 1024);
        httpConfig.setRequestHeaderSize(requestHeaderSize);
        httpConfig.setResponseHeaderSize(responseHeaderSize);
        httpConfig.setSendDateHeader(true);
        httpConfig.setSendServerVersion(true);

        httpConfig.addCustomizer(new ForwardedRequestCustomizer());

        return httpConfig;
    }
 
开发者ID:bootique,项目名称:bootique-jetty,代码行数:19,代码来源:ConnectorFactory.java

示例3: startServer

import org.eclipse.jetty.server.HttpConfiguration; //导入方法依赖的package包/类
/**
 * Start the Jetty Server on the specified port
 * @throws Exception
 */
private static void startServer() throws Exception {
	HttpConfiguration http_config = new HttpConfiguration();
	http_config.setSecureScheme("https");
	http_config.setSecurePort(8443);
	http_config.setOutputBufferSize(32768);
	Server server = new Server();
	ServerConnector http = new ServerConnector(server,
			new HttpConnectionFactory(http_config));
	http.setPort(_port);
	http.setIdleTimeout(30000);
	server.setConnectors(new Connector[] { http });

	// Set a handler
	server.setHandler(new PoolWatcher());

	// Start the server
	server.start();
}
 
开发者ID:shri30,项目名称:ProcessPool,代码行数:23,代码来源:PoolWatcher.java

示例4: generateJettyHttpConfiguration

import org.eclipse.jetty.server.HttpConfiguration; //导入方法依赖的package包/类
private HttpConfiguration generateJettyHttpConfiguration( ConnectorConfiguration theConfiguration ) {
	HttpConfiguration httpConfiguration = new HttpConfiguration();

	if( theConfiguration.getHeaderCacheSize( ) != null ) {
		httpConfiguration.setHeaderCacheSize( theConfiguration.getHeaderCacheSize( ) );
	}
	if( theConfiguration.getRequestHeaderSize( ) != null ) {
		httpConfiguration.setRequestHeaderSize( theConfiguration.getRequestHeaderSize( ) );
	}
	if( theConfiguration.getResponseHeaderSize( ) != null ) {
		httpConfiguration.setResponseHeaderSize( theConfiguration.getResponseHeaderSize( ) );
	}
	if( theConfiguration.getOutputBufferSize( ) != null ) {
		httpConfiguration.setOutputBufferSize( theConfiguration.getOutputBufferSize( ) );
	}
	httpConfiguration.setSendDateHeader( false ); // TODO: verify if I should manually do this, and in what way this sets it (UTC, local, etc)
	httpConfiguration.setSendServerVersion( false );
	httpConfiguration.setSendXPoweredBy( false );

	return httpConfiguration;
}
 
开发者ID:Talvish,项目名称:Tales,代码行数:22,代码来源:HttpInterfaceBase.java

示例5: setBufferSizes

import org.eclipse.jetty.server.HttpConfiguration; //导入方法依赖的package包/类
/**
 * Sets the request and header buffer sizex if they are not zero
 */
private void setBufferSizes(HttpConfiguration buffers) {
    if (requestHeaderSize > 0) {
        LOGGER.info("Request header size set to {} for {}", requestHeaderSize, buffers.getClass().getCanonicalName());
        buffers.setRequestHeaderSize(requestHeaderSize);
    }

    if (responseBufferSize > 0) {
        LOGGER.info("Response buffer size set to {} for {}", responseBufferSize, buffers.getClass().getCanonicalName());
        buffers.setOutputBufferSize(responseBufferSize);
    }
    if (responseHeaderSize > 0) {
        LOGGER.info("Response header size set to {} for {}", responseHeaderSize, buffers.getClass().getCanonicalName());
        buffers.setResponseHeaderSize(responseHeaderSize);
    }
}
 
开发者ID:betfair,项目名称:cougar,代码行数:19,代码来源:JettyServerWrapper.java

示例6: doInstall

import org.eclipse.jetty.server.HttpConfiguration; //导入方法依赖的package包/类
public Connector doInstall(Server server){
	
	// shared http config
	HttpConfiguration http_config = new HttpConfiguration();
	http_config.setSecureScheme("https");
	http_config.setSecurePort(8443);
	http_config.setOutputBufferSize(32768);
	
	// HTTP connector #1
	ServerConnector http = new ServerConnector(server, new HttpConnectionFactory(http_config));
	http.setPort(httpPort);
	http.setIdleTimeout(idleTimeout == null ? 30000 : idleTimeout);
	if(host != null){
		http.setHost(host);			
	}
	
	return http;
	
}
 
开发者ID:danidemi,项目名称:jlubricant,代码行数:20,代码来源:HttpConnectivity.java

示例7: createConfiguration

import org.eclipse.jetty.server.HttpConfiguration; //导入方法依赖的package包/类
/**
 * Creates a Jetty HTTP configuration.
 * 
 * @return A Jetty HTTP configuration.
 */
private HttpConfiguration createConfiguration()
{
	final HttpConfiguration configuration = new HttpConfiguration();
	configuration.setHeaderCacheSize( getHttpHeaderCacheSize() );
	configuration.setRequestHeaderSize( getHttpRequestHeaderSize() );
	configuration.setResponseHeaderSize( getHttpResponseHeaderSize() );
	configuration.setOutputBufferSize( getHttpOutputBufferSize() );
	configuration.setDelayDispatchUntilContent( getHttpDelayDispatchUntilContent() );
	configuration.setOutputAggregationSize( getHttpOutputAggregationSize() );
	configuration.setPersistentConnectionsEnabled( getHttpPersistentConnectionsEnabled() );
	configuration.setSendDateHeader( getHttpSendDateHeader() );
	configuration.setSendServerVersion( getHttpSendVersionHeader() );
	configuration.setSendXPoweredBy( getHttpSendXPoweredBy() );
	return configuration;
}
 
开发者ID:tliron,项目名称:restlet-jetty9,代码行数:21,代码来源:JettyServerHelper.java

示例8: createHttpConfiguration

import org.eclipse.jetty.server.HttpConfiguration; //导入方法依赖的package包/类
private HttpConfiguration createHttpConfiguration(ConfigMap<String, Object> connectorCfg) {
	HttpConfiguration httpConfig = new HttpConfiguration();
	if (connectorCfg.getBoolean("ssl", false) == true) {
		httpConfig.setSecureScheme("https");
		httpConfig.setSecurePort(connectorCfg.getInteger("port", 443));
	}
	
	httpConfig.setOutputBufferSize(connectorCfg.getInteger("output-buffer-size", 32) * KB);
	httpConfig.setRequestHeaderSize(connectorCfg.getInteger("request-header-size", 256) * KB);
	httpConfig.setResponseHeaderSize(connectorCfg.getInteger("response-header-size", 256) * KB);
	
	return httpConfig;
}
 
开发者ID:PinaeOS,项目名称:pumbaa,代码行数:14,代码来源:PumbaaServer.java

示例9: newHttpConnectionFactory

import org.eclipse.jetty.server.HttpConfiguration; //导入方法依赖的package包/类
private HttpConnectionFactory newHttpConnectionFactory() {
    HttpConfiguration httpConfig = new HttpConfiguration();
    httpConfig.setSendDateHeader(true);
    httpConfig.setSendServerVersion(false);
    httpConfig.setSendXPoweredBy(false);
    httpConfig.setHeaderCacheSize(connectorConfig.headerCacheSize());
    httpConfig.setOutputBufferSize(connectorConfig.outputBufferSize());
    httpConfig.setRequestHeaderSize(connectorConfig.requestHeaderSize());
    httpConfig.setResponseHeaderSize(connectorConfig.responseHeaderSize());
    if (connectorConfig.ssl().enabled()) {
        httpConfig.addCustomizer(new SecureRequestCustomizer());
    }
    return new HttpConnectionFactory(httpConfig);
}
 
开发者ID:vespa-engine,项目名称:vespa,代码行数:15,代码来源:ConnectorFactory.java

示例10: configureHttp

import org.eclipse.jetty.server.HttpConfiguration; //导入方法依赖的package包/类
static void configureHttp( HttpConfiguration httpConfig, JettyConfiguration config )
{
    // Date header
    Boolean sendDateHeader = config.sendDateHeader().get();
    if( sendDateHeader != null )
    {
        httpConfig.setSendDateHeader( sendDateHeader );
    }

    // Server version
    Boolean sendServerVersion = config.sendServerVersion().get();
    if( sendServerVersion != null )
    {
        httpConfig.setSendServerVersion( sendServerVersion );
    }

    // Header sizes
    Integer requestHeaderSize = config.requestHeaderSize().get();
    if( requestHeaderSize != null )
    {
        httpConfig.setRequestHeaderSize( requestHeaderSize );
    }
    Integer responseHeaderSize = config.responseHeaderSize().get();
    if( responseHeaderSize != null )
    {
        httpConfig.setResponseHeaderSize( responseHeaderSize );
    }

    // Buffer sizes
    Integer responseBufferSize = config.responseBufferSize().get();
    if( responseBufferSize != null )
    {
        httpConfig.setOutputBufferSize( responseBufferSize );
    }

}
 
开发者ID:apache,项目名称:polygene-java,代码行数:37,代码来源:JettyConfigurationHelper.java

示例11: startServer

import org.eclipse.jetty.server.HttpConfiguration; //导入方法依赖的package包/类
private void startServer(ApiConfiguration apiConfiguration) throws Exception {
    // Creation of the Jetty server
    // === jetty.xml ===
    // Setup Threadpool
    QueuedThreadPool threadPool = new QueuedThreadPool(10);

    servers = new ArrayList<>(apiConfiguration.workers());
    for(int i = 0 ; i < apiConfiguration.workers() ; i++) {
        // Server
        Server server = new Server(threadPool);

        // HTTP Configuration
        HttpConfiguration http_config = new HttpConfiguration();
        http_config.setOutputBufferSize(32768);
        http_config.setRequestHeaderSize(8192);
        http_config.setResponseHeaderSize(8192);
        http_config.setSendServerVersion(true);
        http_config.setSendDateHeader(false);

        // === jetty-http.xml ===
        ServerConnector http = new ServerConnector(server,
                new HttpConnectionFactory(http_config));
        http.setPort(SocketUtils.generateFreePort());
        http.setIdleTimeout(30000);
        server.addConnector(http);

        ServletContextHandler context = new ServletContextHandler(ServletContextHandler.NO_SESSIONS);
        context.setContextPath(apiConfiguration.contextPath());
        ServletHolder servletHolder = new ServletHolder(apiConfiguration.servlet());
        servletHolder.setInitParameter("worker", "worker#" + i);

        context.addServlet(servletHolder, "/*");

        server.setHandler(context);
        server.start();
    }
}
 
开发者ID:gravitee-io,项目名称:gravitee-gateway,代码行数:38,代码来源:ApiPublisherStatement.java

示例12: buildHttpConfiguration

import org.eclipse.jetty.server.HttpConfiguration; //导入方法依赖的package包/类
private HttpConfiguration buildHttpConfiguration(int port) {
    // HTTP Configuration
    HttpConfiguration httpConfig = new HttpConfiguration();
    httpConfig.setSecureScheme("https");
    httpConfig.setSecurePort(port);
    httpConfig.setOutputBufferSize(32768);
    httpConfig.setRequestHeaderSize(8192);
    httpConfig.setResponseHeaderSize(8192);
    httpConfig.setSendServerVersion(true);
    httpConfig.setSendDateHeader(false);
    httpConfig.setBlockingTimeout(30000); // Config
    // httpConfig.addCustomizer(new ForwardedRequestCustomizer());
    return httpConfig;
}
 
开发者ID:jivesoftware,项目名称:routing-bird,代码行数:15,代码来源:RestfulServer.java

示例13: getHttpConfiguration

import org.eclipse.jetty.server.HttpConfiguration; //导入方法依赖的package包/类
/**
 * Get the HttpConfiguration object.
 */
private HttpConfiguration getHttpConfiguration() {
	HttpConfiguration http_config = new HttpConfiguration();
	http_config.setOutputBufferSize(OUTPUT_BUFFER_SIZE);
	http_config.setRequestHeaderSize(REQUEST_HEADER_SIZE);
	http_config.setResponseHeaderSize(RESPONSE_HEADER_SIZE);
	return http_config;
}
 
开发者ID:kpacha,项目名称:yuicompressor-server,代码行数:11,代码来源:YuiCompressorServer.java

示例14: startJetty

import org.eclipse.jetty.server.HttpConfiguration; //导入方法依赖的package包/类
private static void startJetty() throws Exception {
  Server server = new Server();

  HttpConfiguration http_config = new HttpConfiguration();
  http_config.setOutputBufferSize(32768);

  ServerConnector http = new ServerConnector(server,new HttpConnectionFactory(http_config));
  http.setPort(8080);
  http.setIdleTimeout(600000); //10min
  server.addConnector(http);

  WebAppContext context = new WebAppContext();
  String webDir = Launcher.class.getClassLoader().getResource("webapp").toExternalForm();
  context.setResourceBase(webDir);
  context.setContextPath("/websocket");
  context.addServlet(HelloServlet.class, "/helloViaServlet");
  server.setHandler(context);

  if (System.getProperty("os.name").toLowerCase().contains("windows")) {
    // fix for Windows, so Jetty doesn't lock files
    context.getInitParams().put("org.eclipse.jetty.servlet.Default.useFileMappedBuffer", "false");
  }

  ServerContainer wscontainer = WebSocketServerContainerInitializer.configureContext(context);

  // Add WebSocket endpoint to javax.websocket layer
  wscontainer.addEndpoint(WebSocketEndpoint.class);
  server.start();
}
 
开发者ID:poolik,项目名称:callback-websocket-examples,代码行数:30,代码来源:Launcher.java

示例15: startJetty

import org.eclipse.jetty.server.HttpConfiguration; //导入方法依赖的package包/类
private static void startJetty() throws Exception {
  Server server = new Server();

  HttpConfiguration http_config = new HttpConfiguration();
  http_config.setOutputBufferSize(32768);

  ServerConnector http = new ServerConnector(server,new HttpConnectionFactory(http_config));
  http.setPort(8080);
  http.setIdleTimeout(600000); //10min
  server.addConnector(http);

  WebAppContext context = new WebAppContext();
  String webDir = Launcher.class.getClassLoader().getResource("webapp").toExternalForm();
  context.setResourceBase(webDir);
  context.setContextPath("/websocket");
  server.setHandler(context);

  if (System.getProperty("os.name").toLowerCase().contains("windows")) {
    // fix for Windows, so Jetty doesn't lock files
    context.getInitParams().put("org.eclipse.jetty.servlet.Default.useFileMappedBuffer", "false");
  }

  ServerContainer wscontainer = WebSocketServerContainerInitializer.configureContext(context);

  // Add WebSocket endpoint to javax.websocket layer
  wscontainer.addEndpoint(WebsocketEndpoint.class);
  server.start();
}
 
开发者ID:poolik,项目名称:callback-websocket-examples,代码行数:29,代码来源:Launcher.java


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