< prev index next >

src/java.base/share/classes/sun/nio/ch/SelectorImpl.java

Print this page
rev 49271 : [mq]: selector-cleanup

@@ -76,10 +76,20 @@
         if (!isOpen())
             throw new ClosedSelectorException();
         return publicSelectedKeys;
     }
 
+    /**
+     * Returns the public view of the key sets
+     */
+    protected final Set<SelectionKey> nioKeys() {
+        return publicKeys;
+    }
+    protected final Set<SelectionKey> nioSelectedKeys() {
+        return publicSelectedKeys;
+    }
+
     protected abstract int doSelect(long timeout) throws IOException;
 
     private int lockAndDoSelect(long timeout) throws IOException {
         synchronized (this) {
             if (!isOpen())

@@ -123,12 +133,10 @@
         }
     }
 
     protected abstract void implClose() throws IOException;
 
-    public abstract void putEventOps(SelectionKeyImpl sk, int ops);
-
     @Override
     protected final SelectionKey register(AbstractSelectableChannel ch,
                                           int ops,
                                           Object attachment)
     {

@@ -164,6 +172,11 @@
                     }
                 }
             }
         }
     }
+
+    /**
+     * Invoked to change the key's interest set
+     */
+    public abstract void putEventOps(SelectionKeyImpl ski, int ops);
 }
< prev index next >