Revert the buggy commit in AioEventLoop

Also decreased the max stack depth of AioCompletionHandler to 4
(Integer.MAX_VALUE was for testing)
This commit is contained in:
Trustin Lee 2012-07-10 14:12:14 +09:00
parent 701cda2819
commit 170a04fc72
2 changed files with 7 additions and 3 deletions

View File

@ -37,7 +37,7 @@ abstract class AioCompletionHandler<V, A extends Channel> implements CompletionH
*/
protected abstract void failed0(Throwable exc, A channel);
private static final int MAX_STACK_DEPTH = Integer.MAX_VALUE;
private static final int MAX_STACK_DEPTH = 4;
private static final ThreadLocal<Integer> STACK_DEPTH = new ThreadLocal<Integer>() {
@Override
protected Integer initialValue() {

View File

@ -88,9 +88,13 @@ public class AioEventLoop extends MultithreadEventLoop {
return ch;
}
}
if (AbstractAioChannel.class.isAssignableFrom(f.getType())) {
if (f.getType() == Object.class) {
f.setAccessible(true);
return (AbstractAioChannel) f.get(command);
Object candidate = f.get(command);
if (candidate instanceof AbstractAioChannel) {
return (AbstractAioChannel) candidate;
}
}
}