1 7 8 package java.nio.channels; 9 10 import java.io.IOException ; 11 import java.nio.channels.spi.SelectorProvider ; 12 import java.util.Set ; 13 14 15 187 188 public abstract class Selector { 189 190 193 protected Selector() { } 194 195 208 public static Selector open() throws IOException { 209 return SelectorProvider.provider().openSelector(); 210 } 211 212 217 public abstract boolean isOpen(); 218 219 224 public abstract SelectorProvider provider(); 225 226 241 public abstract Set <SelectionKey > keys(); 242 243 257 public abstract Set <SelectionKey > selectedKeys(); 258 259 279 public abstract int selectNow() throws IOException ; 280 281 311 public abstract int select(long timeout) 312 throws IOException ; 313 314 332 public abstract int select() throws IOException ; 333 334 353 public abstract Selector wakeup(); 354 355 376 public abstract void close() throws IOException ; 377 378 } 379 | Popular Tags |