--- a/src/java.base/share/classes/sun/nio/ch/SelectionKeyImpl.java Thu Apr 05 09:55:16 2018 +0200
+++ b/src/java.base/share/classes/sun/nio/ch/SelectionKeyImpl.java Thu Apr 05 15:01:57 2018 +0100
@@ -39,7 +39,7 @@
public final class SelectionKeyImpl
extends AbstractSelectionKey
{
- final SelChImpl channel; // package-private
+ private final SelChImpl channel;
private final SelectorImpl selector;
private volatile int interestOps;
@@ -61,6 +61,10 @@
throw new CancelledKeyException();
}
+ int getFDVal() {
+ return channel.getFDVal();
+ }
+
@Override
public SelectableChannel channel() {
return (SelectableChannel)channel;
@@ -103,8 +107,8 @@
public SelectionKey nioInterestOps(int ops) {
if ((ops & ~channel().validOps()) != 0)
throw new IllegalArgumentException();
- selector.putEventOps(this, channel.translateInterestOps(ops));
interestOps = ops;
+ selector.setEventOps(this);
return this;
}
@@ -112,6 +116,18 @@
return interestOps;
}
+ int translateInterestOps() {
+ return channel.translateInterestOps(interestOps);
+ }
+
+ boolean translateAndSetReadyOps(int ops) {
+ return channel.translateAndSetReadyOps(ops, this);
+ }
+
+ boolean translateAndUpdateReadyOps(int ops) {
+ return channel.translateAndUpdateReadyOps(ops, this);
+ }
+
void registeredEvents(int events) {
// assert Thread.holdsLock(selector);
this.registeredEvents = events;