Mercurial Hosting > luan
comparison src/org/eclipse/jetty/server/nio/BlockingChannelConnector.java @ 972:5ee36654b383
simplify AbstractHttpConnection
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sat, 15 Oct 2016 22:42:05 -0600 |
parents | 0d20943cfea2 |
children | 7422ca1ae146 |
comparison
equal
deleted
inserted
replaced
971:f997df37cec1 | 972:5ee36654b383 |
---|---|
29 import java.util.concurrent.ConcurrentHashMap; | 29 import java.util.concurrent.ConcurrentHashMap; |
30 import java.util.concurrent.RejectedExecutionException; | 30 import java.util.concurrent.RejectedExecutionException; |
31 | 31 |
32 import org.eclipse.jetty.http.HttpException; | 32 import org.eclipse.jetty.http.HttpException; |
33 import org.eclipse.jetty.io.Buffer; | 33 import org.eclipse.jetty.io.Buffer; |
34 import org.eclipse.jetty.io.Connection; | |
35 import org.eclipse.jetty.io.EndPoint; | 34 import org.eclipse.jetty.io.EndPoint; |
36 import org.eclipse.jetty.io.EofException; | 35 import org.eclipse.jetty.io.EofException; |
37 import org.eclipse.jetty.io.nio.ChannelEndPoint; | 36 import org.eclipse.jetty.io.nio.ChannelEndPoint; |
38 import org.eclipse.jetty.server.BlockingHttpConnection; | 37 import org.eclipse.jetty.server.BlockingHttpConnection; |
39 import org.eclipse.jetty.server.Connector; | 38 import org.eclipse.jetty.server.Connector; |
138 } | 137 } |
139 | 138 |
140 | 139 |
141 private class BlockingChannelEndPoint extends ChannelEndPoint implements Runnable | 140 private class BlockingChannelEndPoint extends ChannelEndPoint implements Runnable |
142 { | 141 { |
143 private Connection _connection; | 142 private final BlockingHttpConnection _connection; |
144 private int _timeout; | 143 private int _timeout; |
145 private volatile long _idleTimestamp; | 144 private volatile long _idleTimestamp; |
146 | 145 |
147 BlockingChannelEndPoint(ByteChannel channel) | 146 BlockingChannelEndPoint(ByteChannel channel) |
148 throws IOException | 147 throws IOException |
149 { | 148 { |
150 super(channel,BlockingChannelConnector.this._maxIdleTime); | 149 super(channel,BlockingChannelConnector.this._maxIdleTime); |
151 _connection = new BlockingHttpConnection(BlockingChannelConnector.this,this,server); | 150 _connection = new BlockingHttpConnection(BlockingChannelConnector.this,this); |
152 } | |
153 | |
154 public void setConnection(Connection connection) | |
155 { | |
156 _connection=connection; | |
157 } | 151 } |
158 | 152 |
159 public void checkIdleTimestamp(long now) | 153 public void checkIdleTimestamp(long now) |
160 { | 154 { |
161 if (_idleTimestamp!=0 && _timeout>0 && now>(_idleTimestamp+_timeout)) | 155 if (_idleTimestamp!=0 && _timeout>0 && now>(_idleTimestamp+_timeout)) |