src/java.base/share/classes/sun/nio/ch/SelectorImpl.java
changeset 49290 07779973cbe2
parent 49248 15a0e60c8b97
child 49493 814bd31f8da0
equal deleted inserted replaced
49289:148e29df1644 49290:07779973cbe2
    76         if (!isOpen())
    76         if (!isOpen())
    77             throw new ClosedSelectorException();
    77             throw new ClosedSelectorException();
    78         return publicSelectedKeys;
    78         return publicSelectedKeys;
    79     }
    79     }
    80 
    80 
       
    81     /**
       
    82      * Returns the public view of the key sets
       
    83      */
       
    84     protected final Set<SelectionKey> nioKeys() {
       
    85         return publicKeys;
       
    86     }
       
    87     protected final Set<SelectionKey> nioSelectedKeys() {
       
    88         return publicSelectedKeys;
       
    89     }
       
    90 
    81     protected abstract int doSelect(long timeout) throws IOException;
    91     protected abstract int doSelect(long timeout) throws IOException;
    82 
    92 
    83     private int lockAndDoSelect(long timeout) throws IOException {
    93     private int lockAndDoSelect(long timeout) throws IOException {
    84         synchronized (this) {
    94         synchronized (this) {
    85             if (!isOpen())
    95             if (!isOpen())
   123         }
   133         }
   124     }
   134     }
   125 
   135 
   126     protected abstract void implClose() throws IOException;
   136     protected abstract void implClose() throws IOException;
   127 
   137 
   128     public abstract void putEventOps(SelectionKeyImpl sk, int ops);
       
   129 
       
   130     @Override
   138     @Override
   131     protected final SelectionKey register(AbstractSelectableChannel ch,
   139     protected final SelectionKey register(AbstractSelectableChannel ch,
   132                                           int ops,
   140                                           int ops,
   133                                           Object attachment)
   141                                           Object attachment)
   134     {
   142     {
   164                     }
   172                     }
   165                 }
   173                 }
   166             }
   174             }
   167         }
   175         }
   168     }
   176     }
       
   177 
       
   178     /**
       
   179      * Invoked to change the key's interest set
       
   180      */
       
   181     public abstract void putEventOps(SelectionKeyImpl ski, int ops);
   169 }
   182 }