Add new ChanelFuureListener impl that mimic the old behavior of Netty 3 and so allow to also call fireException for outbound operations
This commit is contained in:
parent
1e9652b47a
commit
8cf9f52919
@ -56,6 +56,19 @@ public interface ChannelFutureListener extends EventListener {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A {@link ChannelFutureListener} that forwards the {@link Throwable} of the {@link ChannelFuture} into the
|
||||||
|
* {@link ChannelPipeline}. This mimics the old behavior of Netty 3.
|
||||||
|
*/
|
||||||
|
ChannelFutureListener FIRE_EXCEPTION_ON_FAILURE = new ChannelFutureListener() {
|
||||||
|
@Override
|
||||||
|
public void operationComplete(ChannelFuture future) {
|
||||||
|
if (!future.isSuccess()) {
|
||||||
|
future.channel().pipeline().fireExceptionCaught(future.cause());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoked when the I/O operation associated with the {@link ChannelFuture}
|
* Invoked when the I/O operation associated with the {@link ChannelFuture}
|
||||||
* has been completed.
|
* has been completed.
|
||||||
|
Loading…
Reference in New Issue
Block a user