392237 improved names and examples for documentation

This commit is contained in:
Greg Wilkins 2012-10-29 17:59:39 +11:00
parent 77a7ff3122
commit add3c2b381
40 changed files with 116 additions and 150 deletions

View File

@ -59,7 +59,7 @@ public class LikeJettyXml
// Setup Connectors
HttpConnectionFactory http = new HttpConnectionFactory();
http.getHttpChannelConfig().setSecurePort(8443);
http.getHttpConfiguration().setSecurePort(8443);
ServerConnector connector = new ServerConnector(server,http);
connector.setPort(8080);
connector.setIdleTimeout(30000);

View File

@ -22,7 +22,7 @@ import org.eclipse.jetty.io.ArrayByteBufferPool;
import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.ForwardedRequestCustomizer;
import org.eclipse.jetty.server.HttpChannelConfig;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.SecureRequestCustomizer;
import org.eclipse.jetty.server.Server;
@ -67,7 +67,7 @@ public class ManyConnectors
// A verbosely fully configured connector with SSL, SPDY and HTTP
HttpChannelConfig config = new HttpChannelConfig();
HttpConfiguration config = new HttpConfiguration();
config.setSecureScheme("https");
config.setSecurePort(8443);
config.setOutputBufferSize(32768);

View File

@ -26,7 +26,7 @@ import org.eclipse.jetty.jmx.MBeanContainer;
import org.eclipse.jetty.security.HashLoginService;
import org.eclipse.jetty.server.ForwardedRequestCustomizer;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.HttpChannelConfig;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.NCSARequestLog;
import org.eclipse.jetty.server.SecureRequestCustomizer;
@ -68,7 +68,7 @@ public class SpdyServer
// Common HTTP configuration
HttpChannelConfig config = new HttpChannelConfig();
HttpConfiguration config = new HttpConfiguration();
config.setSecurePort(8443);
config.addCustomizer(new ForwardedRequestCustomizer());
config.addCustomizer(new SecureRequestCustomizer());

View File

@ -6,7 +6,7 @@
<!-- =========================================================== -->
<!-- HttpChannel Configuration -->
<!-- =========================================================== -->
<New id="httpConfig" class="org.eclipse.jetty.server.HttpChannelConfig">
<New id="httpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
<Set name="secureScheme">https</Set>
<Set name="securePort"><SystemProperty name="jetty.spdy.port" default="8443"/></Set>
<Set name="outputBufferSize">32768</Set>

View File

@ -26,7 +26,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.HttpChannelConfig;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.LocalConnector;
import org.eclipse.jetty.server.Request;
@ -53,10 +53,10 @@ public abstract class AbstractRuleTestCase
protected void start(final boolean isSecure) throws Exception
{
_connector = new LocalConnector(_server);
_connector.getConnectionFactory(HttpConnectionFactory.class).getHttpChannelConfig().addCustomizer(new HttpChannelConfig.Customizer()
_connector.getConnectionFactory(HttpConnectionFactory.class).getHttpConfiguration().addCustomizer(new HttpConfiguration.Customizer()
{
@Override
public void customize(Connector connector, HttpChannelConfig channelConfig, Request request)
public void customize(Connector connector, HttpConfiguration channelConfig, Request request)
{
request.setSecure(isSecure);
}

View File

@ -40,7 +40,7 @@ import javax.servlet.annotation.ServletSecurity.TransportGuarantee;
import org.eclipse.jetty.http.HttpStatus;
import org.eclipse.jetty.http.PathMap;
import org.eclipse.jetty.server.HttpChannel;
import org.eclipse.jetty.server.HttpChannelConfig;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Response;
import org.eclipse.jetty.server.UserIdentity;
@ -694,7 +694,7 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
if (dataConstraint == null || dataConstraint == UserDataConstraint.None)
return true;
HttpChannelConfig httpConfig = HttpChannel.getCurrentHttpChannel().getHttpChannelConfig();
HttpConfiguration httpConfig = HttpChannel.getCurrentHttpChannel().getHttpConfiguration();
if (dataConstraint == UserDataConstraint.Confidential || dataConstraint == UserDataConstraint.Integral)
{

View File

@ -28,7 +28,7 @@ import org.eclipse.jetty.http.HttpMethod;
import org.eclipse.jetty.http.HttpScheme;
import org.eclipse.jetty.security.authentication.BasicAuthenticator;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.HttpChannelConfig;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.LocalConnector;
import org.eclipse.jetty.server.Request;
@ -62,16 +62,16 @@ public class DataConstraintsTest
_server = new Server();
HttpConnectionFactory http = new HttpConnectionFactory();
http.getHttpChannelConfig().setSecurePort(9999);
http.getHttpChannelConfig().setSecureScheme("BWTP");
http.getHttpConfiguration().setSecurePort(9999);
http.getHttpConfiguration().setSecureScheme("BWTP");
_connector = new LocalConnector(_server,http);
_connector.setIdleTimeout(300000);
HttpConnectionFactory https = new HttpConnectionFactory();
https.getHttpChannelConfig().addCustomizer(new HttpChannelConfig.Customizer()
https.getHttpConfiguration().addCustomizer(new HttpConfiguration.Customizer()
{
@Override
public void customize(Connector connector, HttpChannelConfig channelConfig, Request request)
public void customize(Connector connector, HttpConfiguration channelConfig, Request request)
{
request.setScheme(HttpScheme.HTTPS.asString());
request.setSecure(true);

View File

@ -27,12 +27,12 @@
</New>
<!-- =========================================================== -->
<!-- Create a TLS specific HttpChannelConfig based on the -->
<!-- common HttpChannelConfig defined in jetty.xml -->
<!-- Create a TLS specific HttpConfiguration based on the -->
<!-- common HttpConfiguration defined in jetty.xml -->
<!-- Add a SecureRequestCustomizer to extract certificate and -->
<!-- session information -->
<!-- =========================================================== -->
<New id="tlsHttpConfig" class="org.eclipse.jetty.server.HttpChannelConfig">
<New id="tlsHttpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
<Arg><Ref id="httpConfig"/></Arg>
<Call name="addCustomizer">
<Arg><New class="org.eclipse.jetty.server.SecureRequestCustomizer"/></Arg>

View File

@ -51,7 +51,7 @@
</Arg>
<!-- =========================================================== -->
<!-- HttpChannel Configuration. -->
<!-- Http Configuration. -->
<!-- This is a common configuration instance used by all -->
<!-- connectors that can carry HTTP semantics (HTTP, HTTPS, SPDY)-->
<!-- It configures the non wire protocol aspects of the HTTP -->
@ -62,10 +62,10 @@
<!-- jetty-spdy.xml configuration files which instantiate the -->
<!-- connectors. -->
<!-- -->
<!-- Consult the javadoc of o.e.j.server.HttpChannelConfig -->
<!-- Consult the javadoc of o.e.j.server.HttpConfiguration -->
<!-- for all configuration that may be set here. -->
<!-- =========================================================== -->
<New id="httpConfig" class="org.eclipse.jetty.server.HttpChannelConfig">
<New id="httpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
<Set name="secureScheme">https</Set>
<Set name="securePort"><Property name="jetty.tls.port" default="8443" /></Set>
<Set name="outputBufferSize">32768</Set>

View File

@ -79,9 +79,9 @@ public abstract class AbstractConnectionFactory extends ContainerLifeCycle imple
for (ConnectionFactory factory : factories)
{
if (factory instanceof HttpChannelConfig.ConnectionFactory)
if (factory instanceof HttpConfiguration.ConnectionFactory)
{
HttpChannelConfig config = ((HttpChannelConfig.ConnectionFactory)factory).getHttpChannelConfig();
HttpConfiguration config = ((HttpConfiguration.ConnectionFactory)factory).getHttpConfiguration();
if (config.getCustomizer(SecureRequestCustomizer.class)==null)
config.addCustomizer(new SecureRequestCustomizer());
}

View File

@ -85,7 +85,7 @@ import org.eclipse.jetty.util.thread.TimerScheduler;
* the method {@link #setDefaultProtocol(String)} or defaults to the protocol of the first configured factory.
* <p>
* Each Connection factory type is responsible for the configuration of the protocols that it accepts. Thus to
* configure the HTTP protocol, you pass a {@link HttpChannelConfig} instance to the {@link HttpConnectionFactory}
* configure the HTTP protocol, you pass a {@link HttpConfiguration} instance to the {@link HttpConnectionFactory}
* (or the SPDY factories that can also provide HTTP Semantics). Similarly the {@link SslConnectionFactory} is
* configured by passing it a {@link SslContextFactory} and a next protocol name.
*

View File

@ -25,7 +25,7 @@ import javax.servlet.ServletRequest;
import org.eclipse.jetty.http.HttpFields;
import org.eclipse.jetty.http.HttpHeader;
import org.eclipse.jetty.http.HttpScheme;
import org.eclipse.jetty.server.HttpChannelConfig.Customizer;
import org.eclipse.jetty.server.HttpConfiguration.Customizer;
public class ForwardedRequestCustomizer implements Customizer
{
@ -185,7 +185,7 @@ public class ForwardedRequestCustomizer implements Customizer
/* ------------------------------------------------------------ */
@Override
public void customize(Connector connector, HttpChannelConfig config, Request request)
public void customize(Connector connector, HttpConfiguration config, Request request)
{
HttpFields httpFields = request.getHttpFields();

View File

@ -78,7 +78,7 @@ public class HttpChannel<T> implements HttpParser.RequestHandler<T>, Runnable
private final AtomicBoolean _committed = new AtomicBoolean();
private final AtomicInteger _requests = new AtomicInteger();
private final Connector _connector;
private final HttpChannelConfig _configuration;
private final HttpConfiguration _configuration;
private final EndPoint _endPoint;
private final HttpTransport _transport;
private final HttpURI _uri;
@ -90,7 +90,7 @@ public class HttpChannel<T> implements HttpParser.RequestHandler<T>, Runnable
private boolean _expect100Continue = false;
private boolean _expect102Processing = false;
public HttpChannel(Connector connector, HttpChannelConfig configuration, EndPoint endPoint, HttpTransport transport, HttpInput<T> input)
public HttpChannel(Connector connector, HttpConfiguration configuration, EndPoint endPoint, HttpTransport transport, HttpInput<T> input)
{
_connector = connector;
_configuration = configuration;
@ -131,7 +131,7 @@ public class HttpChannel<T> implements HttpParser.RequestHandler<T>, Runnable
return _connector.getByteBufferPool();
}
public HttpChannelConfig getHttpChannelConfig()
public HttpConfiguration getHttpConfiguration()
{
return _configuration;
}
@ -240,7 +240,7 @@ public class HttpChannel<T> implements HttpParser.RequestHandler<T>, Runnable
_request.setTimeStamp(System.currentTimeMillis());
_request.setDispatcherType(DispatcherType.REQUEST);
for (HttpChannelConfig.Customizer customizer : _configuration.getCustomizers())
for (HttpConfiguration.Customizer customizer : _configuration.getCustomizers())
customizer.customize(getConnector(),_configuration,_request);
getServer().handle(this);
}

View File

@ -25,8 +25,8 @@ import org.eclipse.jetty.http.HttpScheme;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
@ManagedObject("HTTP Channel Configuration")
public class HttpChannelConfig
@ManagedObject("HTTP Configuration")
public class HttpConfiguration
{
private List<Customizer> _customizers=new CopyOnWriteArrayList<>();
private int _outputBufferSize=32*1024;
@ -37,19 +37,19 @@ public class HttpChannelConfig
public interface Customizer
{
public void customize(Connector connector, HttpChannelConfig channelConfig, Request request);
public void customize(Connector connector, HttpConfiguration channelConfig, Request request);
}
public interface ConnectionFactory
{
HttpChannelConfig getHttpChannelConfig();
HttpConfiguration getHttpConfiguration();
}
public HttpChannelConfig()
public HttpConfiguration()
{
}
public HttpChannelConfig(HttpChannelConfig config)
public HttpConfiguration(HttpConfiguration config)
{
_customizers.addAll(config._customizers);
_outputBufferSize=config._outputBufferSize;

View File

@ -51,7 +51,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
private static final Logger LOG = Log.getLogger(HttpConnection.class);
private static final ThreadLocal<HttpConnection> __currentConnection = new ThreadLocal<>();
private final HttpChannelConfig _config;
private final HttpConfiguration _config;
private final Connector _connector;
private final ByteBufferPool _bufferPool;
private final HttpGenerator _generator;
@ -91,12 +91,12 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
__currentConnection.set(connection);
}
public HttpChannelConfig getHttpChannelConfig()
public HttpConfiguration getHttpConfiguration()
{
return _config;
}
public HttpConnection(HttpChannelConfig config, Connector connector, EndPoint endPoint)
public HttpConnection(HttpConfiguration config, Connector connector, EndPoint endPoint)
{
// Tell AbstractConnector executeOnFillable==false because we are guaranteeing that onfillable
// will never block nor take an excessive amount of CPU. ie it is OK for the selector thread to
@ -116,7 +116,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
protected HttpParser newHttpParser()
{
return new HttpParser(newRequestHandler(), getHttpChannelConfig().getRequestHeaderSize());
return new HttpParser(newRequestHandler(), getHttpConfiguration().getRequestHeaderSize());
}
protected HttpParser.RequestHandler<ByteBuffer> newRequestHandler()
@ -621,7 +621,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
private class HttpChannelOverHttp extends HttpChannel<ByteBuffer>
{
public HttpChannelOverHttp(Connector connector, HttpChannelConfig config, EndPoint endPoint, HttpTransport transport, HttpInput<ByteBuffer> input)
public HttpChannelOverHttp(Connector connector, HttpConfiguration config, EndPoint endPoint, HttpTransport transport, HttpInput<ByteBuffer> input)
{
super(connector,config,endPoint,transport,input);
}

View File

@ -25,17 +25,17 @@ import org.eclipse.jetty.io.Connection;
import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.util.annotation.Name;
public class HttpConnectionFactory extends AbstractConnectionFactory implements HttpChannelConfig.ConnectionFactory
public class HttpConnectionFactory extends AbstractConnectionFactory implements HttpConfiguration.ConnectionFactory
{
private final HttpChannelConfig _config;
private final HttpConfiguration _config;
public HttpConnectionFactory()
{
this(new HttpChannelConfig());
this(new HttpConfiguration());
setInputBufferSize(16384);
}
public HttpConnectionFactory(@Name("config") HttpChannelConfig config)
public HttpConnectionFactory(@Name("config") HttpConfiguration config)
{
super(HttpVersion.HTTP_1_1.toString());
_config=config;
@ -43,7 +43,7 @@ public class HttpConnectionFactory extends AbstractConnectionFactory implements
}
@Override
public HttpChannelConfig getHttpChannelConfig()
public HttpConfiguration getHttpConfiguration()
{
return _config;
}

View File

@ -59,7 +59,7 @@ public class HttpOutput extends ServletOutputStream
public HttpOutput(HttpChannel<?> channel)
{
_channel = channel;
_bufferSize = _channel.getHttpChannelConfig().getOutputBufferSize();
_bufferSize = _channel.getHttpConfiguration().getOutputBufferSize();
}
public boolean isWritten()

View File

@ -32,7 +32,7 @@ import org.eclipse.jetty.util.TypeUtil;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
public class SecureRequestCustomizer implements HttpChannelConfig.Customizer
public class SecureRequestCustomizer implements HttpConfiguration.Customizer
{
private static final Logger LOG = Log.getLogger(SecureRequestCustomizer.class);
@ -43,7 +43,7 @@ public class SecureRequestCustomizer implements HttpChannelConfig.Customizer
@Override
public void customize(Connector connector, HttpChannelConfig channelConfig, Request request)
public void customize(Connector connector, HttpConfiguration channelConfig, Request request)
{
if (request.getHttpChannel().getEndPoint() instanceof DecryptedEndPoint)
{

View File

@ -100,7 +100,7 @@ public class CheckReverseProxyHeadersTest
Server server = new Server();
// Activate reverse proxy headers checking
HttpConnectionFactory http = new HttpConnectionFactory();
http.getHttpChannelConfig().addCustomizer(new ForwardedRequestCustomizer());
http.getHttpConfiguration().addCustomizer(new ForwardedRequestCustomizer());
LocalConnector connector = new LocalConnector(server,http);

View File

@ -66,8 +66,8 @@ public class HttpConnectionTest
server = new Server();
HttpConnectionFactory http = new HttpConnectionFactory();
http.getHttpChannelConfig().setRequestHeaderSize(1024);
http.getHttpChannelConfig().setResponseHeaderSize(1024);
http.getHttpConfiguration().setRequestHeaderSize(1024);
http.getHttpConfiguration().setResponseHeaderSize(1024);
connector = new LocalConnector(server,http,null);
server.addConnector(connector);

View File

@ -43,7 +43,7 @@ public class HttpWriterTest
_bytes = BufferUtil.allocate(2048);
final ByteBufferPool bufferPool = new MappedByteBufferPool();
HttpChannel<?> channel = new HttpChannel<ByteBuffer>(null,new HttpChannelConfig(),null,null,null)
HttpChannel<?> channel = new HttpChannel<ByteBuffer>(null,new HttpConfiguration(),null,null,null)
{
@Override
public ByteBufferPool getByteBufferPool()

View File

@ -73,10 +73,10 @@ public class RequestTest
_server = new Server();
HttpConnectionFactory http = new HttpConnectionFactory();
http.setInputBufferSize(1024);
http.getHttpChannelConfig().setRequestHeaderSize(512);
http.getHttpChannelConfig().setResponseHeaderSize(512);
http.getHttpChannelConfig().setOutputBufferSize(2048);
http.getHttpChannelConfig().addCustomizer(new ForwardedRequestCustomizer());
http.getHttpConfiguration().setRequestHeaderSize(512);
http.getHttpConfiguration().setResponseHeaderSize(512);
http.getHttpConfiguration().setOutputBufferSize(2048);
http.getHttpConfiguration().addCustomizer(new ForwardedRequestCustomizer());
_connector = new LocalConnector(_server,http);
_server.addConnector(_connector);
_handler = new RequestHandler();

View File

@ -72,7 +72,7 @@ public class ResponseTest
{
_server = new Server();
_scheduler = new TimerScheduler();
HttpChannelConfig config = new HttpChannelConfig();
HttpConfiguration config = new HttpConfiguration();
LocalConnector connector = new LocalConnector(_server,null,_scheduler,null,1,new HttpConnectionFactory(config));
_server.addConnector(connector);
_server.setHandler(new DumpHandler());
@ -80,7 +80,7 @@ public class ResponseTest
AbstractEndPoint endp = new ByteArrayEndPoint(_scheduler, 5000);
ByteBufferHttpInput input = new ByteBufferHttpInput();
_channel = new HttpChannel<ByteBuffer>(connector, new HttpChannelConfig(), endp, new HttpTransport()
_channel = new HttpChannel<ByteBuffer>(connector, new HttpConfiguration(), endp, new HttpTransport()
{
@Override
public void send(HttpGenerator.ResponseInfo info, ByteBuffer content, boolean lastContent) throws IOException

View File

@ -54,7 +54,7 @@ public class SlowClientWithPipelinedRequestTest
@Override
public Connection newConnection(Connector connector, EndPoint endPoint)
{
return configure(new HttpConnection(new HttpChannelConfig(),connector,endPoint)
return configure(new HttpConnection(new HttpConfiguration(),connector,endPoint)
{
@Override
public void onFillable()

View File

@ -106,7 +106,7 @@ public class SSLEngineTest
server=new Server();
HttpConnectionFactory http = new HttpConnectionFactory();
http.setInputBufferSize(512);
http.getHttpChannelConfig().setRequestHeaderSize(512);
http.getHttpConfiguration().setRequestHeaderSize(512);
connector=new ServerConnector(server, sslContextFactory, http);
connector.setPort(0);

View File

@ -106,12 +106,12 @@ public class SslBytesServerTest extends SslBytesTest
@Override
public Connection newConnection(Connector connector, EndPoint endPoint)
{
return configure(new HttpConnection(getHttpChannelConfig(), connector, endPoint)
return configure(new HttpConnection(getHttpConfiguration(), connector, endPoint)
{
@Override
protected HttpParser newHttpParser()
{
return new HttpParser(newRequestHandler(), getHttpChannelConfig().getRequestHeaderSize())
return new HttpParser(newRequestHandler(), getHttpConfiguration().getRequestHeaderSize())
{
@Override
public boolean parseNext(ByteBuffer buffer)
@ -124,7 +124,7 @@ public class SslBytesServerTest extends SslBytesTest
}, connector, endPoint);
}
};
httpFactory.getHttpChannelConfig().addCustomizer(new SecureRequestCustomizer());
httpFactory.getHttpConfiguration().addCustomizer(new SecureRequestCustomizer());
SslConnectionFactory sslFactory = new SslConnectionFactory(sslContextFactory, httpFactory.getProtocol())
{
@Override

View File

@ -27,12 +27,12 @@
</New>
<!-- =========================================================== -->
<!-- Create a TLS specific HttpChannelConfig based on the -->
<!-- common HttpChannelConfig defined in jetty.xml -->
<!-- Create a TLS specific HttpConfiguration based on the -->
<!-- common HttpConfiguration defined in jetty.xml -->
<!-- Add a SecureRequestCustomizer to extract certificate and -->
<!-- session information -->
<!-- =========================================================== -->
<New id="tlsHttpConfig" class="org.eclipse.jetty.server.HttpChannelConfig">
<New id="tlsHttpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
<Arg><Ref id="httpConfig"/></Arg>
<Call name="addCustomizer">
<Arg><New class="org.eclipse.jetty.server.SecureRequestCustomizer"/></Arg>

View File

@ -21,7 +21,7 @@ package org.eclipse.jetty.spdy.server.http;
import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.HttpChannelConfig;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.spdy.api.DataInfo;
import org.eclipse.jetty.spdy.api.HeadersInfo;
import org.eclipse.jetty.spdy.api.ReplyInfo;
@ -35,36 +35,36 @@ import org.eclipse.jetty.util.annotation.Name;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
public class HTTPSPDYServerConnectionFactory extends SPDYServerConnectionFactory implements HttpChannelConfig.ConnectionFactory
public class HTTPSPDYServerConnectionFactory extends SPDYServerConnectionFactory implements HttpConfiguration.ConnectionFactory
{
private static final String CHANNEL_ATTRIBUTE = "org.eclipse.jetty.spdy.server.http.HTTPChannelOverSPDY";
private static final Logger logger = Log.getLogger(HTTPSPDYServerConnectionFactory.class);
private final PushStrategy pushStrategy;
private final HttpChannelConfig httpChannelConfig;
private final HttpConfiguration httpConfiguration;
public HTTPSPDYServerConnectionFactory(
@Name("version") int version,
@Name("config") HttpChannelConfig config)
@Name("config") HttpConfiguration config)
{
this(version,config,new PushStrategy.None());
}
public HTTPSPDYServerConnectionFactory(
@Name("version") int version,
@Name("config") HttpChannelConfig config,
@Name("config") HttpConfiguration config,
@Name("pushStrategy") PushStrategy pushStrategy)
{
super(version);
this.pushStrategy = pushStrategy;
httpChannelConfig = config;
addBean(httpChannelConfig);
httpConfiguration = config;
addBean(httpConfiguration);
}
@Override
public HttpChannelConfig getHttpChannelConfig()
public HttpConfiguration getHttpConfiguration()
{
return httpChannelConfig;
return httpConfiguration;
}
@Override
@ -96,9 +96,9 @@ public class HTTPSPDYServerConnectionFactory extends SPDYServerConnectionFactory
logger.debug("Received {} on {}", synInfo, stream);
Fields headers = synInfo.getHeaders();
HttpTransportOverSPDY transport = new HttpTransportOverSPDY(connector, httpChannelConfig, endPoint, pushStrategy, stream, headers);
HttpTransportOverSPDY transport = new HttpTransportOverSPDY(connector, httpConfiguration, endPoint, pushStrategy, stream, headers);
HttpInputOverSPDY input = new HttpInputOverSPDY();
HttpChannelOverSPDY channel = new HttpChannelOverSPDY(connector, httpChannelConfig, endPoint, transport, input, stream);
HttpChannelOverSPDY channel = new HttpChannelOverSPDY(connector, httpConfiguration, endPoint, transport, input, stream);
stream.setAttribute(CHANNEL_ATTRIBUTE, channel);
channel.requestStart(headers, synInfo.isClose());

View File

@ -24,7 +24,7 @@ import java.util.Map;
import org.eclipse.jetty.server.AbstractConnectionFactory;
import org.eclipse.jetty.server.ConnectionFactory;
import org.eclipse.jetty.server.HttpChannelConfig;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
@ -51,24 +51,24 @@ public class HTTPSPDYServerConnector extends ServerConnector
public HTTPSPDYServerConnector(Server server, SslContextFactory sslContextFactory, Map<Short, PushStrategy> pushStrategies)
{
this(server,new HttpChannelConfig(),sslContextFactory,pushStrategies);
this(server,new HttpConfiguration(),sslContextFactory,pushStrategies);
}
public HTTPSPDYServerConnector(Server server, short version, HttpChannelConfig httpChannelConfig, PushStrategy push)
public HTTPSPDYServerConnector(Server server, short version, HttpConfiguration httpConfiguration, PushStrategy push)
{
super(server,new HTTPSPDYServerConnectionFactory(version,httpChannelConfig,push));
super(server,new HTTPSPDYServerConnectionFactory(version,httpConfiguration,push));
}
public HTTPSPDYServerConnector(Server server, HttpChannelConfig config, SslContextFactory sslContextFactory, Map<Short, PushStrategy> pushStrategies)
public HTTPSPDYServerConnector(Server server, HttpConfiguration config, SslContextFactory sslContextFactory, Map<Short, PushStrategy> pushStrategies)
{
super(server,AbstractConnectionFactory.getFactories(sslContextFactory,
sslContextFactory==null
?new ConnectionFactory[] {new HttpConnectionFactory(config)}
:new ConnectionFactory[] {new NPNServerConnectionFactory("spdy/3","spdy/2","http/1.1"),
new HttpConnectionFactory(config),
new HTTPSPDYServerConnectionFactory(SPDY.V3,new HttpChannelConfig(),getPushStrategy(SPDY.V3, pushStrategies)),
new HTTPSPDYServerConnectionFactory(SPDY.V2,new HttpChannelConfig(),getPushStrategy(SPDY.V2, pushStrategies))}));
new HTTPSPDYServerConnectionFactory(SPDY.V3,new HttpConfiguration(),getPushStrategy(SPDY.V3, pushStrategies)),
new HTTPSPDYServerConnectionFactory(SPDY.V2,new HttpConfiguration(),getPushStrategy(SPDY.V2, pushStrategies))}));
if (getConnectionFactory(NPNServerConnectionFactory.class)!=null)
getConnectionFactory(NPNServerConnectionFactory.class).setDefaultProtocol("http/1.1");
}

View File

@ -28,7 +28,7 @@ import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.HttpChannel;
import org.eclipse.jetty.server.HttpChannelConfig;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.HttpTransport;
import org.eclipse.jetty.spdy.api.ByteBufferDataInfo;
import org.eclipse.jetty.spdy.api.DataInfo;
@ -46,7 +46,7 @@ public class HttpChannelOverSPDY extends HttpChannel<DataInfo>
private boolean dispatched; // Guarded by synchronization on tasks
private boolean headersComplete;
public HttpChannelOverSPDY(Connector connector, HttpChannelConfig configuration, EndPoint endPoint, HttpTransport transport, HttpInputOverSPDY input, Stream stream)
public HttpChannelOverSPDY(Connector connector, HttpConfiguration configuration, EndPoint endPoint, HttpTransport transport, HttpInputOverSPDY input, Stream stream)
{
super(connector, configuration, endPoint, transport, input);
this.stream = stream;

View File

@ -31,7 +31,7 @@ import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.io.EofException;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.HttpChannelConfig;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.HttpTransport;
import org.eclipse.jetty.spdy.api.ByteBufferDataInfo;
import org.eclipse.jetty.spdy.api.ReplyInfo;
@ -50,14 +50,14 @@ public class HttpTransportOverSPDY implements HttpTransport
private static final Logger LOG = Log.getLogger(HttpTransportOverSPDY.class);
private final Connector connector;
private final HttpChannelConfig configuration;
private final HttpConfiguration configuration;
private final EndPoint endPoint;
private final PushStrategy pushStrategy;
private final Stream stream;
private final Fields requestHeaders;
private final BlockingCallback streamBlocker = new BlockingCallback();
public HttpTransportOverSPDY(Connector connector, HttpChannelConfig configuration, EndPoint endPoint, PushStrategy pushStrategy, Stream stream, Fields requestHeaders)
public HttpTransportOverSPDY(Connector connector, HttpConfiguration configuration, EndPoint endPoint, PushStrategy pushStrategy, Stream stream, Fields requestHeaders)
{
this.connector = connector;
this.configuration = configuration;

View File

@ -19,7 +19,7 @@
package org.eclipse.jetty.spdy.server.proxy;
import org.eclipse.jetty.server.HttpChannelConfig;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.spdy.api.SPDY;
import org.eclipse.jetty.spdy.server.SPDYServerConnector;
@ -35,6 +35,6 @@ public class HTTPSPDYProxyConnector extends SPDYServerConnector
public HTTPSPDYProxyConnector(Server server, SslContextFactory sslContextFactory, ProxyEngineSelector proxyEngineSelector)
{
super(server, sslContextFactory, proxyEngineSelector);
addConnectionFactory(new ProxyHTTPConnectionFactory(new HttpChannelConfig(), SPDY.V2, proxyEngineSelector));
addConnectionFactory(new ProxyHTTPConnectionFactory(new HttpConfiguration(), SPDY.V2, proxyEngineSelector));
}
}

View File

@ -25,33 +25,33 @@ import org.eclipse.jetty.io.Connection;
import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.server.AbstractConnectionFactory;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.HttpChannelConfig;
import org.eclipse.jetty.server.HttpConfiguration;
public class ProxyHTTPConnectionFactory extends AbstractConnectionFactory implements HttpChannelConfig.ConnectionFactory
public class ProxyHTTPConnectionFactory extends AbstractConnectionFactory implements HttpConfiguration.ConnectionFactory
{
private final short version;
private final ProxyEngineSelector proxyEngineSelector;
private final HttpChannelConfig httpChannelConfig;
private final HttpConfiguration httpConfiguration;
public ProxyHTTPConnectionFactory(HttpChannelConfig httpChannelConfig,short version, ProxyEngineSelector proxyEngineSelector)
public ProxyHTTPConnectionFactory(HttpConfiguration httpConfiguration,short version, ProxyEngineSelector proxyEngineSelector)
{
// replaces http/1.1
super(HttpVersion.HTTP_1_1.asString());
this.version = version;
this.proxyEngineSelector = proxyEngineSelector;
this.httpChannelConfig=httpChannelConfig;
this.httpConfiguration=httpConfiguration;
}
@Override
public Connection newConnection(Connector connector, EndPoint endPoint)
{
return configure(new ProxyHTTPSPDYConnection(connector, httpChannelConfig, endPoint, version, proxyEngineSelector),connector,endPoint);
return configure(new ProxyHTTPSPDYConnection(connector, httpConfiguration, endPoint, version, proxyEngineSelector),connector,endPoint);
}
@Override
public HttpChannelConfig getHttpChannelConfig()
public HttpConfiguration getHttpConfiguration()
{
return httpChannelConfig;
return httpConfiguration;
}
}

View File

@ -32,7 +32,7 @@ import org.eclipse.jetty.http.HttpParser;
import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.HttpChannelConfig;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.HttpConnection;
import org.eclipse.jetty.server.SslConnectionFactory;
import org.eclipse.jetty.spdy.ISession;
@ -62,7 +62,7 @@ public class ProxyHTTPSPDYConnection extends HttpConnection implements HttpParse
private HTTPStream stream;
private ByteBuffer content;
public ProxyHTTPSPDYConnection(Connector connector, HttpChannelConfig config, EndPoint endPoint, short version, ProxyEngineSelector proxyEngineSelector)
public ProxyHTTPSPDYConnection(Connector connector, HttpConfiguration config, EndPoint endPoint, short version, ProxyEngineSelector proxyEngineSelector)
{
super(config,connector,endPoint);
this.version = version;

View File

@ -25,7 +25,7 @@ import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.HttpChannelConfig;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.spdy.api.SPDY;
import org.eclipse.jetty.spdy.api.Session;
@ -92,7 +92,7 @@ public abstract class AbstractHTTPSPDYTest
protected HTTPSPDYServerConnector newHTTPSPDYServerConnector(short version)
{
// For these tests, we need the connector to speak HTTP over SPDY even in non-SSL
HTTPSPDYServerConnector connector = new HTTPSPDYServerConnector(server,version,new HttpChannelConfig(), new PushStrategy.None());
HTTPSPDYServerConnector connector = new HTTPSPDYServerConnector(server,version,new HttpConfiguration(), new PushStrategy.None());
return connector;
}

View File

@ -38,7 +38,7 @@ import org.eclipse.jetty.client.api.ContentResponse;
import org.eclipse.jetty.client.api.Response;
import org.eclipse.jetty.client.api.Result;
import org.eclipse.jetty.server.ConnectionFactory;
import org.eclipse.jetty.server.HttpChannelConfig;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.handler.AbstractHandler;
@ -82,7 +82,7 @@ public class PushStrategyBenchmarkTest extends AbstractHTTPSPDYTest
InetSocketAddress address = startHTTPServer(version, new PushStrategyBenchmarkHandler());
// Plain HTTP
ConnectionFactory factory = new HttpConnectionFactory(new HttpChannelConfig());
ConnectionFactory factory = new HttpConnectionFactory(new HttpConfiguration());
connector.setDefaultProtocol(factory.getProtocol());
HttpClient httpClient = new HttpClient();
// Simulate browsers, that open 6 connection per origin
@ -93,7 +93,7 @@ public class PushStrategyBenchmarkTest extends AbstractHTTPSPDYTest
// First push strategy
PushStrategy pushStrategy = new PushStrategy.None();
factory = new HTTPSPDYServerConnectionFactory(version, new HttpChannelConfig(), pushStrategy);
factory = new HTTPSPDYServerConnectionFactory(version, new HttpConfiguration(), pushStrategy);
connector.setDefaultProtocol(factory.getProtocol());
Session session = startClient(version, address, new ClientSessionFrameListener());
benchmarkSPDY(pushStrategy, session);
@ -101,7 +101,7 @@ public class PushStrategyBenchmarkTest extends AbstractHTTPSPDYTest
// Second push strategy
pushStrategy = new ReferrerPushStrategy();
factory = new HTTPSPDYServerConnectionFactory(version, new HttpChannelConfig(), pushStrategy);
factory = new HTTPSPDYServerConnectionFactory(version, new HttpConfiguration(), pushStrategy);
connector.setDefaultProtocol(factory.getProtocol());
session = startClient(version, address, new ClientSessionFrameListener());
benchmarkSPDY(pushStrategy, session);

View File

@ -28,7 +28,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.server.ConnectionFactory;
import org.eclipse.jetty.server.HttpChannelConfig;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.handler.AbstractHandler;
import org.eclipse.jetty.spdy.api.DataInfo;
@ -58,7 +58,7 @@ public class ReferrerPushStrategyTest extends AbstractHTTPSPDYTest
protected HTTPSPDYServerConnector newHTTPSPDYServerConnector(short version)
{
HTTPSPDYServerConnector connector =
new HTTPSPDYServerConnector(server,version,new HttpChannelConfig(),new ReferrerPushStrategy());
new HTTPSPDYServerConnector(server,version,new HttpConfiguration(),new ReferrerPushStrategy());
return connector;
}
@ -70,7 +70,7 @@ public class ReferrerPushStrategyTest extends AbstractHTTPSPDYTest
ReferrerPushStrategy pushStrategy = new ReferrerPushStrategy();
int referrerPushPeriod = 1000;
pushStrategy.setReferrerPushPeriod(referrerPushPeriod);
ConnectionFactory defaultFactory = new HTTPSPDYServerConnectionFactory(version,new HttpChannelConfig(), pushStrategy);
ConnectionFactory defaultFactory = new HTTPSPDYServerConnectionFactory(version,new HttpConfiguration(), pushStrategy);
connector.addConnectionFactory(defaultFactory);
if (connector.getConnectionFactory(NPNServerConnectionFactory.class)!=null)
connector.getConnectionFactory(NPNServerConnectionFactory.class).setDefaultProtocol(defaultFactory.getProtocol());
@ -98,7 +98,7 @@ public class ReferrerPushStrategyTest extends AbstractHTTPSPDYTest
ReferrerPushStrategy pushStrategy = new ReferrerPushStrategy();
int referrerPushPeriod = 1000;
pushStrategy.setReferrerPushPeriod(referrerPushPeriod);
ConnectionFactory defaultFactory = new HTTPSPDYServerConnectionFactory(version,new HttpChannelConfig(), pushStrategy);
ConnectionFactory defaultFactory = new HTTPSPDYServerConnectionFactory(version,new HttpConfiguration(), pushStrategy);
connector.addConnectionFactory(defaultFactory);
if (connector.getConnectionFactory(NPNServerConnectionFactory.class)!=null)
connector.getConnectionFactory(NPNServerConnectionFactory.class).setDefaultProtocol(defaultFactory.getProtocol());
@ -123,7 +123,7 @@ public class ReferrerPushStrategyTest extends AbstractHTTPSPDYTest
ReferrerPushStrategy pushStrategy = new ReferrerPushStrategy();
pushStrategy.setMaxAssociatedResources(1);
ConnectionFactory defaultFactory = new HTTPSPDYServerConnectionFactory(version,new HttpChannelConfig(), pushStrategy);
ConnectionFactory defaultFactory = new HTTPSPDYServerConnectionFactory(version,new HttpConfiguration(), pushStrategy);
connector.addConnectionFactory(defaultFactory);
connector.setDefaultProtocol(defaultFactory.getProtocol()); // TODO I don't think this is right

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/AllTests.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.jetty.websocket.core.AllTests"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="websocket-core"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
</launchConfiguration>

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/AllTests.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.jetty.websocket.server.AllTests"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="websocket-server"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
</launchConfiguration>

View File

@ -29,7 +29,7 @@ import org.eclipse.jetty.jmx.MBeanContainer;
import org.eclipse.jetty.security.HashLoginService;
import org.eclipse.jetty.server.ForwardedRequestCustomizer;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.HttpChannelConfig;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.NCSARequestLog;
import org.eclipse.jetty.server.Request;
@ -85,7 +85,7 @@ public class TestServer
// Common HTTP configuration
HttpChannelConfig config = new HttpChannelConfig();
HttpConfiguration config = new HttpConfiguration();
config.setSecurePort(8443);
config.addCustomizer(new ForwardedRequestCustomizer());
config.addCustomizer(new SecureRequestCustomizer());