Deprecated ChannelConfig.writeTimeoutMillis in favor of WriteTimeoutHandler

This commit is contained in:
Trustin Lee 2009-02-05 07:07:02 +00:00
parent dde0232e19
commit 874fc7db77
4 changed files with 13 additions and 4 deletions

View File

@ -28,6 +28,7 @@ import java.util.Map;
import org.jboss.netty.buffer.ChannelBufferFactory;
import org.jboss.netty.channel.socket.SocketChannelConfig;
import org.jboss.netty.channel.socket.nio.NioSocketChannelConfig;
import org.jboss.netty.handler.timeout.WriteTimeoutHandler;
/**
* A set of configuration properties of a {@link Channel}.
@ -55,8 +56,6 @@ import org.jboss.netty.channel.socket.nio.NioSocketChannelConfig;
* </tr><tr>
* <td>{@code "connectTimeoutMillis"}</td><td>{@link #setConnectTimeoutMillis(int)}</td>
* </tr><tr>
* <td>{@code "writeTimeoutMillis"}</td><td>{@link #setWriteTimeoutMillis(int)}</td>
* </tr><tr>
* <td>{@code "pipelineFactory"}</td><td>{@link #setPipelineFactory(ChannelPipelineFactory)}</td>
* </tr>
* </table>
@ -119,6 +118,8 @@ public interface ChannelConfig {
void setConnectTimeoutMillis(int connectTimeoutMillis);
/**
* @deprecated Use {@link WriteTimeoutHandler} instead if necessary.
*
* Returns the write timeout of the channel in milliseconds. If a write
* operation is not completed within the write timeout, an
* {@link IOException} will be raised. If the {@link Channel} does not
@ -127,9 +128,12 @@ public interface ChannelConfig {
*
* @return the write timeout in milliseconds. {@code 0} if disabled.
*/
@Deprecated
int getWriteTimeoutMillis();
/**
* @deprecated Use {@link WriteTimeoutHandler} instead if necessary.
*
* Sets the write timeout of the channel in milliseconds. If a write
* operation is not completed within the write timeout, an
* {@link IOException} will be raised. If the {@link Channel} does not
@ -139,5 +143,6 @@ public interface ChannelConfig {
* @param writeTimeoutMillis the write timeout in milliseconds.
* {@code 0} to disable.
*/
@Deprecated
void setWriteTimeoutMillis(int writeTimeoutMillis);
}

View File

@ -163,10 +163,12 @@ public class DefaultServerSocketChannelConfig implements ServerSocketChannelConf
// Unused
}
@Deprecated
public int getWriteTimeoutMillis() {
return 0;
}
@Deprecated
public void setWriteTimeoutMillis(int writeTimeoutMillis) {
// Unused
}

View File

@ -83,8 +83,6 @@ public class DefaultSocketChannelConfig implements SocketChannelConfig {
setSoLinger(ConversionUtil.toInt(value));
} else if (key.equals("trafficClass")) {
setTrafficClass(ConversionUtil.toInt(value));
} else if (key.equals("writeTimeoutMillis")) {
setWriteTimeoutMillis(ConversionUtil.toInt(value));
} else if (key.equals("connectTimeoutMillis")) {
setConnectTimeoutMillis(ConversionUtil.toInt(value));
} else if (key.equals("pipelineFactory")) {
@ -237,6 +235,7 @@ public class DefaultSocketChannelConfig implements SocketChannelConfig {
return null;
}
@Deprecated
public int getWriteTimeoutMillis() {
return 0;
}
@ -252,6 +251,7 @@ public class DefaultSocketChannelConfig implements SocketChannelConfig {
// Unused
}
@Deprecated
public void setWriteTimeoutMillis(int writeTimeoutMillis) {
// Unused
}

View File

@ -60,6 +60,7 @@ class EmbeddedChannelConfig implements ChannelConfig {
return bufferFactory;
}
@Deprecated
public int getWriteTimeoutMillis() {
return 0;
}
@ -80,6 +81,7 @@ class EmbeddedChannelConfig implements ChannelConfig {
// Unused
}
@Deprecated
public void setWriteTimeoutMillis(int writeTimeoutMillis) {
// Unused
}