comparison src/org/eclipse/jetty/io/nio/SelectorManager.java @ 960:3cd4c706a61f

simplify ChannelEndPoint
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 13 Oct 2016 21:29:19 -0600
parents 7b94f5b33c64
children 94498d6daf5b
comparison
equal deleted inserted replaced
959:7b94f5b33c64 960:3cd4c706a61f
159 159
160 }); 160 });
161 } 161 }
162 162
163 163
164 /* ------------------------------------------------------------------------------- */
165 @Override 164 @Override
166 protected void doStop() throws Exception 165 protected void doStop() throws Exception
167 { 166 {
168 SelectSet set = _selectSet; 167 SelectSet set = _selectSet;
169 _selectSet = null; 168 _selectSet = null;
174 super.doStop(); 173 super.doStop();
175 } 174 }
176 175
177 public abstract AsyncConnection newConnection(SocketChannel channel, SelectChannelEndPoint endpoint); 176 public abstract AsyncConnection newConnection(SocketChannel channel, SelectChannelEndPoint endpoint);
178 177
178 @Override
179 public String dump() 179 public String dump()
180 { 180 {
181 return AggregateLifeCycle.dump(this); 181 return AggregateLifeCycle.dump(this);
182 } 182 }
183 183
184 @Override
184 public void dump(Appendable out, String indent) throws IOException 185 public void dump(Appendable out, String indent) throws IOException
185 { 186 {
186 AggregateLifeCycle.dumpObject(out,this); 187 AggregateLifeCycle.dumpObject(out,this);
187 AggregateLifeCycle.dump(out,indent,Collections.singletonList(_selectSet)); 188 AggregateLifeCycle.dump(out,indent,Collections.singletonList(_selectSet));
188 } 189 }
293 SaneSelector getSelector() 294 SaneSelector getSelector()
294 { 295 {
295 return _selector; 296 return _selector;
296 } 297 }
297 298
298 synchronized void stop() throws Exception 299 private synchronized void stop() throws Exception
299 { 300 {
300 // close endpoints and selector 301 // close endpoints and selector
301 for (SelectionKey key : _selector.keys()) 302 for (SelectionKey key : _selector.keys())
302 { 303 {
303 EndPoint endpoint = (EndPoint)key.attachment(); 304 EndPoint endpoint = (EndPoint)key.attachment();
319 { 320 {
320 LOG.trace("",e); 321 LOG.trace("",e);
321 } 322 }
322 } 323 }
323 324
325 @Override
324 public String dump() 326 public String dump()
325 { 327 {
326 return AggregateLifeCycle.dump(this); 328 return AggregateLifeCycle.dump(this);
327 } 329 }
328 330
331 @Override
329 public void dump(Appendable out, String indent) throws IOException 332 public void dump(Appendable out, String indent) throws IOException
330 { 333 {
331 out.append(String.valueOf(this)).append("\n"); 334 out.append(String.valueOf(this)).append("\n");
332 AggregateLifeCycle.dump(out,indent,Collections.emptyList()); 335 AggregateLifeCycle.dump(out,indent,Collections.emptyList());
333 } 336 }
334 337
338 @Override
335 public String toString() 339 public String toString()
336 { 340 {
337 SaneSelector selector=_selector; 341 SaneSelector selector=_selector;
338 return String.format("%s keys=%d selected=%d", 342 return String.format("%s keys=%d selected=%d",
339 super.toString(), 343 super.toString(),