1 package org.sapia.ubik.net.nio; 2 3 import java.nio.ByteBuffer ; 4 import java.nio.channels.Channel ; 5 6 36 public interface Cycle { 37 38 41 public static final int STATE_READ = 0; 42 43 46 public static final int STATE_WRITE = 1; 47 48 51 public static final int STATE_PROCESS = 2; 52 53 56 public static final int STATE_RECYCLE = 3; 57 58 61 public static final int STATE_COMPLETE = 4; 62 63 66 public static final int STATE_ERROR = 5; 67 68 76 public int state(); 77 78 89 public void state(int nextState); 90 91 102 public void error(Throwable err); 103 104 109 public void next(); 110 111 114 public boolean isRead(); 115 116 119 public boolean isWrite(); 120 121 124 public boolean isComplete(); 125 126 129 public boolean isProcess(); 130 131 134 public boolean isRecycle(); 135 136 139 public boolean isError(); 140 141 145 public Throwable getError(); 146 147 150 public ByteBuffer getByteBuffer(); 151 152 155 public void releaseByteBuffer(); 156 157 160 public Channel getChannel(); 161 162 165 public ChannelHandler getHandler(); 166 167 171 public ChannelManager getChannelManager(); 172 173 178 public void destroy(); 179 180 } 181 | Popular Tags |