Mercurial Hosting > luan
comparison src/org/eclipse/jetty/server/Connector.java @ 907:bc4e299de953
remove AbstractNIOConnector
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Fri, 07 Oct 2016 15:14:16 -0600 |
| parents | eaf271fb747f |
| children | c60c1adfac3e |
comparison
equal
deleted
inserted
replaced
| 906:eaf271fb747f | 907:bc4e299de953 |
|---|---|
| 73 public Connector(Server server,int port) { | 73 public Connector(Server server,int port) { |
| 74 this.server = server; | 74 this.server = server; |
| 75 this.port = port; | 75 this.port = port; |
| 76 server.connectors.add(this); | 76 server.connectors.add(this); |
| 77 addBean(_buffers); | 77 addBean(_buffers); |
| 78 _buffers.setRequestBufferType(Type.DIRECT); | |
| 79 _buffers.setRequestHeaderType(Type.INDIRECT); | |
| 80 _buffers.setResponseBufferType(Type.DIRECT); | |
| 81 _buffers.setResponseHeaderType(Type.INDIRECT); | |
| 78 } | 82 } |
| 79 | 83 |
| 80 /* ------------------------------------------------------------ */ | 84 /* ------------------------------------------------------------ */ |
| 81 /** | 85 /** |
| 82 */ | 86 */ |
| 444 // from old interface | 448 // from old interface |
| 445 public abstract void open() throws IOException; | 449 public abstract void open() throws IOException; |
| 446 public abstract void close() throws IOException; | 450 public abstract void close() throws IOException; |
| 447 public abstract int getLocalPort(); | 451 public abstract int getLocalPort(); |
| 448 public abstract Object getConnection(); | 452 public abstract Object getConnection(); |
| 453 | |
| 454 | |
| 455 // from AbstractNIOConnector | |
| 456 | |
| 457 /* ------------------------------------------------------------------------------- */ | |
| 458 public boolean getUseDirectBuffers() | |
| 459 { | |
| 460 return getRequestBufferType()==Type.DIRECT; | |
| 461 } | |
| 462 | |
| 463 /* ------------------------------------------------------------------------------- */ | |
| 464 /** | |
| 465 * @param direct If True (the default), the connector can use NIO direct buffers. | |
| 466 * Some JVMs have memory management issues (bugs) with direct buffers. | |
| 467 */ | |
| 468 public void setUseDirectBuffers(boolean direct) | |
| 469 { | |
| 470 _buffers.setRequestBufferType(direct?Type.DIRECT:Type.INDIRECT); | |
| 471 _buffers.setResponseBufferType(direct?Type.DIRECT:Type.INDIRECT); | |
| 472 } | |
| 449 } | 473 } |
