8199433: (se) select(Consumer<SelectionKey> action) as alternative to selected-key set

Reviewed-by: bpb
This commit is contained in:
Alan Bateman 2018-06-16 10:10:54 +01:00
parent 4a24d95917
commit db61a602f6
10 changed files with 1188 additions and 157 deletions

View file

@ -291,7 +291,7 @@ public abstract class SelectionKey {
* detects that the corresponding channel is ready for reading, has reached
* end-of-stream, has been remotely shut down for further reading, or has
* an error pending, then it will add {@code OP_READ} to the key's
* ready-operation set and add the key to its selected-key&nbsp;set. </p>
* ready-operation set. </p>
*/
public static final int OP_READ = 1 << 0;
@ -303,8 +303,7 @@ public abstract class SelectionKey {
* href="Selector.html#selop">selection operation</a>. If the selector
* detects that the corresponding channel is ready for writing, has been
* remotely shut down for further writing, or has an error pending, then it
* will add {@code OP_WRITE} to the key's ready set and add the key to its
* selected-key&nbsp;set. </p>
* will add {@code OP_WRITE} to the key's ready set. </p>
*/
public static final int OP_WRITE = 1 << 2;
@ -316,8 +315,7 @@ public abstract class SelectionKey {
* href="Selector.html#selop">selection operation</a>. If the selector
* detects that the corresponding socket channel is ready to complete its
* connection sequence, or has an error pending, then it will add
* {@code OP_CONNECT} to the key's ready set and add the key to its
* selected-key&nbsp;set. </p>
* {@code OP_CONNECT} to the key's ready set. </p>
*/
public static final int OP_CONNECT = 1 << 3;
@ -329,8 +327,7 @@ public abstract class SelectionKey {
* href="Selector.html#selop">selection operation</a>. If the selector
* detects that the corresponding server-socket channel is ready to accept
* another connection, or has an error pending, then it will add
* {@code OP_ACCEPT} to the key's ready set and add the key to its
* selected-key&nbsp;set. </p>
* {@code OP_ACCEPT} to the key's ready set. </p>
*/
public static final int OP_ACCEPT = 1 << 4;