diff src/org/eclipse/jetty/server/Server.java @ 887:df84a1741687

make Connector reference to server explicit
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 04 Oct 2016 23:59:56 -0600
parents 0d876a03ab0b
children 1d0c304e12b5
line wrap: on
line diff
--- a/src/org/eclipse/jetty/server/Server.java	Tue Oct 04 20:27:50 2016 -0600
+++ b/src/org/eclipse/jetty/server/Server.java	Tue Oct 04 23:59:56 2016 -0600
@@ -62,29 +62,18 @@
 	public static final String version = "8";
 
 	private final AttributesMap _attributes = new AttributesMap();
-	public final ThreadPoolExecutor threadPool;
-	private final List<Connector> connectors = new ArrayList<Connector>();
+	public final ThreadPoolExecutor threadPool = new ThreadPoolExecutor(256, 256, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());
+	final List<Connector> connectors = new ArrayList<Connector>();
 
 
-	/* ------------------------------------------------------------ */
-	/** Convenience constructor
-	 * Creates server and a {@link SelectChannelConnector} at the passed port.
-	 */
+	public Server() {
+		setServer(this);
+	}
+
 	public Server(int port)
 	{
 		setServer(this);
-
-		Connector connector = new SelectChannelConnector();
-		connector.setPort(port);
-		connector.setServer(this);
-		connectors.add(connector);
-
-		threadPool = new ThreadPoolExecutor(256, 256, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());
-	}
-
-	// call before start
-	public void addConnector(Connector connector) {
-		connectors.add(connector);
+		new SelectChannelConnector(this,port);
 	}
 
 	/* ------------------------------------------------------------ */