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 18 public class TestChannelManager implements ChannelManager{ 19 20 23 public Channel accept(Channel server) throws IOException , 24 UnsupportedOperationException { 25 throw new UnsupportedOperationException (); 26 } 27 28 31 public Channel create() throws IOException { 32 return new TestChannel(); 33 } 34 35 38 public ChannelHandler createHandler() { 39 throw new UnsupportedOperationException (); 40 } 41 42 45 public Object getAddress(Channel server) throws UnsupportedOperationException { 46 throw new UnsupportedOperationException (); 47 } 48 49 52 public int read(Channel from, ByteBuffer to) throws IOException { 53 return ((TestReadChannel)from).read(to); 54 } 55 56 59 public SelectionKey register(Channel channel, Selector selector, int ops, 60 Object attachment) throws IOException { 61 throw new UnsupportedOperationException (); 62 } 63 64 67 public int write(Channel to, ByteBuffer from) throws IOException { 68 return ((TestWriteChannel)to).write(from); 69 } 70 71 } 72 | Popular Tags |