diff src/org/eclipse/jetty/io/nio/SelectorManager.java @ 970:d82eb99e8df6

remove ConnectorSelectorManager
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 14 Oct 2016 05:24:18 -0600
parents 0650077fcd6c
children f997df37cec1
line wrap: on
line diff
--- a/src/org/eclipse/jetty/io/nio/SelectorManager.java	Fri Oct 14 02:44:02 2016 -0600
+++ b/src/org/eclipse/jetty/io/nio/SelectorManager.java	Fri Oct 14 05:24:18 2016 -0600
@@ -43,6 +43,7 @@
 import org.eclipse.jetty.util.component.AbstractLifeCycle;
 import org.eclipse.jetty.util.component.AggregateLifeCycle;
 import org.eclipse.jetty.util.component.Dumpable;
+import org.eclipse.jetty.server.nio.SelectChannelConnector;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -53,11 +54,11 @@
  * NIO scheduling to scale to large numbers of connections.
  * <p>
  */
-public abstract class SelectorManager extends AbstractLifeCycle implements Dumpable
+public final class SelectorManager extends AbstractLifeCycle implements Dumpable
 {
 	public static final Logger LOG = LoggerFactory.getLogger("org.eclipse.jetty.io.nio");
 
-	private final int _maxIdleTime;
+	private final SelectChannelConnector scc;
 	private volatile long _now = System.currentTimeMillis();
 	private SaneSelector _selector;
 
@@ -66,9 +67,9 @@
 	 * @param maxIdleTime The maximum period in milli seconds that a connection may be idle before it is closed.
 	 * @see #setLowResourcesMaxIdleTime(long)
 	 */
-	public SelectorManager(int maxIdleTime)
+	public SelectorManager(SelectChannelConnector scc)
 	{
-		_maxIdleTime = maxIdleTime;
+		this.scc = scc;
 	}
 
 	/* ------------------------------------------------------------ */
@@ -86,7 +87,7 @@
 */
 		try {
 			SelectionKey key = _selector.register(channel,0,null);
-			SelectChannelEndPoint endpoint = new SelectChannelEndPoint(channel,this,key, _maxIdleTime);
+			SelectChannelEndPoint endpoint = new SelectChannelEndPoint(channel,this,key, scc.getMaxIdleTime());
 			key.attach(endpoint);
 			_selector.update();
 //System.out.println("qqqqqqqqqqqqqqqqqqqqqqqqqqqqq b");
@@ -102,7 +103,9 @@
 	}
 
 
-	public abstract void execute(Runnable task);
+	public void execute(Runnable task) {
+		scc.server.threadPool.execute(task);
+	}
 
 
 	@Override
@@ -184,7 +187,9 @@
 		super.doStop();
 	}
 
-	public abstract AsyncConnection newConnection(SocketChannel channel, SelectChannelEndPoint endpoint);
+	public AsyncConnection newConnection(SocketChannel channel, SelectChannelEndPoint endpoint) {
+		return scc.newConnection(channel,endpoint);
+	}
 
 	@Override
 	public String dump()