Mercurial > hg > RemoteEditor > REPSessionManager
view rep/channel/REPSelector.java @ 144:0bf7f8d0f5f7
*** empty log message ***
author | pin |
---|---|
date | Wed, 27 Aug 2008 22:55:43 +0900 |
parents | 785a3e8ea858 |
children | 4ed6393ec68e |
line wrap: on
line source
package rep.channel; import java.io.IOException; import java.nio.channels.ClosedChannelException; import java.nio.channels.SelectableChannel; import java.nio.channels.SelectionKey; import java.nio.channels.Selector; import java.nio.channels.spi.AbstractSelector; import java.nio.channels.spi.SelectorProvider; import java.util.Set; public class REPSelector extends Selector{ Selector selector; public REPSelector(AbstractSelector selector) { this.selector = selector; } public static REPSelector create() throws IOException{ if(REPServerSocketChannel.isSimulation){ return new SelectorSimulator(); } return new REPSelector(SelectorProvider.provider().openSelector()); } @Override public void close() throws IOException { selector.close(); } @Override public boolean isOpen() { return selector.isOpen(); } @Override public Set<SelectionKey> keys() { return selector.keys(); } @Override public SelectorProvider provider() { return selector.provider(); } @Override public int select() throws IOException { return selector.select(); } @Override public int select(long timeout) throws IOException { return selector.select(timeout); } @Override public int selectNow() throws IOException { return selector.selectNow(); } @Override public Set<SelectionKey> selectedKeys() { return selector.selectedKeys(); } @Override public Selector wakeup() { return selector.wakeup(); } public SelectionKey register(SelectableChannel ch, int ops, Object att){ return null; } }