Code cleanup

This commit is contained in:
Trustin Lee 2009-03-04 14:08:31 +00:00
parent 4979cb6a21
commit fbfebb1fd9

View File

@ -85,11 +85,7 @@ public class WriteTimeoutHandler extends SimpleChannelDownstreamHandler
new WriteTimeoutTask(ctx, future),
timeoutMillis, TimeUnit.MILLISECONDS);
future.addListener(new ChannelFutureListener() {
public void operationComplete(ChannelFuture future) throws Exception {
timeout.cancel();
}
});
future.addListener(new TimeoutCanceller(timeout));
}
super.writeRequested(ctx, e);
@ -129,4 +125,21 @@ public class WriteTimeoutHandler extends SimpleChannelDownstreamHandler
}
}
}
/**
* @author The Netty Project (netty-dev@lists.jboss.org)
* @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*/
private static final class TimeoutCanceller implements ChannelFutureListener {
private final Timeout timeout;
TimeoutCanceller(Timeout timeout) {
this.timeout = timeout;
}
public void operationComplete(ChannelFuture future) throws Exception {
timeout.cancel();
}
}
}