| 1 package org.sapia.ubik.net.nio; 2 3 import java.io.IOException ; 4 import java.nio.ByteBuffer ; 5 import java.nio.channels.Channel ; 6 import java.nio.channels.SelectionKey ; 7 import java.nio.channels.Selector ; 8 9 28 public interface ChannelManager { 29 30 36 public Channel create() throws IOException ; 37 38 50 public Channel accept(Channel server) throws IOException , 51 UnsupportedOperationException ; 52 53 56 public Object getAddress(Channel server) throws UnsupportedOperationException ; 57 58 75 public SelectionKey register(Channel channel, Selector selector, int ops, 76 Object attachment) throws IOException ; 77 78 89 public int read(Channel from, ByteBuffer to) throws IOException ; 90 91 102 public int write(Channel to, ByteBuffer from) throws IOException ; 103 104 110 public ChannelHandler createHandler(); 111 } 112 | Popular Tags |