Mercurial Hosting > luan
diff src/org/eclipse/jetty/server/nio/BlockingChannelConnector.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 | 6b210bb66c63 |
children | 1aa58272794f |
line wrap: on
line diff
--- a/src/org/eclipse/jetty/server/nio/BlockingChannelConnector.java Tue Oct 04 20:27:50 2016 -0600 +++ b/src/org/eclipse/jetty/server/nio/BlockingChannelConnector.java Tue Oct 04 23:59:56 2016 -0600 @@ -38,6 +38,7 @@ import org.eclipse.jetty.io.nio.ChannelEndPoint; import org.eclipse.jetty.server.BlockingHttpConnection; import org.eclipse.jetty.server.Request; +import org.eclipse.jetty.server.Server; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -66,8 +67,9 @@ /** Constructor. * */ - public BlockingChannelConnector() + public BlockingChannelConnector(Server server,int port) { + super(server,port); } /* ------------------------------------------------------------ */ @@ -84,7 +86,7 @@ protected void doStart() throws Exception { super.doStart(); - getThreadPool().execute(new Runnable() + server.threadPool.execute(new Runnable() { public void run() @@ -124,7 +126,7 @@ _acceptChannel.configureBlocking(true); // Bind the server socket to the local host and port - InetSocketAddress addr = getHost()==null?new InetSocketAddress(getPort()):new InetSocketAddress(getHost(),getPort()); + InetSocketAddress addr = getHost()==null?new InetSocketAddress(port):new InetSocketAddress(getHost(),port); _acceptChannel.socket().bind(addr,getAcceptQueueSize()); } @@ -182,7 +184,7 @@ throws IOException { super(channel,BlockingChannelConnector.this._maxIdleTime); - _connection = new BlockingHttpConnection(BlockingChannelConnector.this,this,getServer()); + _connection = new BlockingHttpConnection(BlockingChannelConnector.this,this,server); } /* ------------------------------------------------------------ */ @@ -226,7 +228,7 @@ void dispatch() throws IOException { try { - getThreadPool().execute(this); + server.threadPool.execute(this); } catch(RejectedExecutionException e) { LOG.warn("dispatch failed for {}",_connection); super.close(); @@ -280,7 +282,7 @@ _idleTimestamp=System.currentTimeMillis(); if (_connection.isIdle()) { - if (getServer().isLowOnThreads()) + if (server.isLowOnThreads()) { int lrmit = getLowResourcesMaxIdleTime(); if (lrmit>=0 && _timeout!= lrmit)