comparison src/org/eclipse/jetty/server/Connector.java @ 913:17f4fe8271de

simplify connectors
author Franklin Schmidt <fschmidt@gmail.com>
date Sat, 08 Oct 2016 23:57:11 -0600
parents c60c1adfac3e
children 54308d65265a
comparison
equal deleted inserted replaced
912:1d0c304e12b5 913:17f4fe8271de
64 private String _host; 64 private String _host;
65 public final int port; 65 public final int port;
66 private int _acceptors = 1; 66 private int _acceptors = 1;
67 67
68 protected int _maxIdleTime = 200000; 68 protected int _maxIdleTime = 200000;
69 protected int _lowResourceMaxIdleTime = -1;
70 protected int _soLingerTime = -1; 69 protected int _soLingerTime = -1;
71 70
72 protected final HttpBuffersImpl _buffers = new HttpBuffersImpl(); 71 protected final HttpBuffersImpl _buffers = new HttpBuffersImpl();
73 72
74 // from child classes 73 // from child classes
118 * these timeouts were merged. With the advent of NIO, it may be possible to again differentiate these values (if there is demand). 117 * these timeouts were merged. With the advent of NIO, it may be possible to again differentiate these values (if there is demand).
119 * 118 *
120 * @param maxIdleTime 119 * @param maxIdleTime
121 * The maxIdleTime to set. 120 * The maxIdleTime to set.
122 */ 121 */
122 /*
123 public void setMaxIdleTime(int maxIdleTime) 123 public void setMaxIdleTime(int maxIdleTime)
124 { 124 {
125 _maxIdleTime = maxIdleTime; 125 _maxIdleTime = maxIdleTime;
126 } 126 }
127 127 */
128 /* ------------------------------------------------------------ */
129 /**
130 * @return Returns the maxIdleTime when resources are low.
131 */
132 public int getLowResourcesMaxIdleTime()
133 {
134 return _lowResourceMaxIdleTime;
135 }
136
137 /* ------------------------------------------------------------ */
138 /**
139 * @param maxIdleTime
140 * The maxIdleTime to set when resources are low.
141 */
142 public void setLowResourcesMaxIdleTime(int maxIdleTime)
143 {
144 _lowResourceMaxIdleTime = maxIdleTime;
145 }
146
147 /* ------------------------------------------------------------ */
148 /**
149 * @return Returns the maxIdleTime when resources are low.
150 * @deprecated
151 */
152 @Deprecated
153 public final int getLowResourceMaxIdleTime()
154 {
155 return getLowResourcesMaxIdleTime();
156 }
157
158 /* ------------------------------------------------------------ */
159 /**
160 * @param maxIdleTime
161 * The maxIdleTime to set when resources are low.
162 * @deprecated
163 */
164 @Deprecated
165 public final void setLowResourceMaxIdleTime(int maxIdleTime)
166 {
167 setLowResourcesMaxIdleTime(maxIdleTime);
168 }
169 128
170 /* ------------------------------------------------------------ */ 129 /* ------------------------------------------------------------ */
171 /** 130 /**
172 * @return Returns the soLingerTime. 131 * @return Returns the soLingerTime.
173 */ 132 */
222 LOG.info("Started {}",this); 181 LOG.info("Started {}",this);
223 } 182 }
224 183
225 /* ------------------------------------------------------------ */ 184 /* ------------------------------------------------------------ */
226 @Override 185 @Override
227 protected void doStop() throws Exception 186 protected synchronized void doStop() throws Exception
228 { 187 {
229 try 188 try
230 { 189 {
231 close(); 190 if (_acceptChannel != null)
191 _acceptChannel.close();
192 _acceptChannel=null;
232 } 193 }
233 catch (IOException e) 194 catch (IOException e)
234 { 195 {
235 LOG.warn("",e); 196 LOG.warn("",e);
236 } 197 }
423 public final boolean isLowResources() 384 public final boolean isLowResources()
424 { 385 {
425 return server.isLowOnThreads(); 386 return server.isLowOnThreads();
426 } 387 }
427 388
428 // from old interface
429 public abstract void close() throws IOException;
430
431 389
432 // from AbstractNIOConnector 390 // from AbstractNIOConnector
433 391
434 /* ------------------------------------------------------------------------------- */ 392 /* ------------------------------------------------------------------------------- */
435 public boolean getUseDirectBuffers() 393 public boolean getUseDirectBuffers()