SpliceHandler Class — netty Architecture
Architecture documentation for the SpliceHandler class in EpollSpliceTest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD c9a84116_fb55_fb37_e20b_00eb6f492d34["SpliceHandler"] 4a8d8d02_d652_cbc3_7bc3_f0b30eca63df["EpollSpliceTest.java"] c9a84116_fb55_fb37_e20b_00eb6f492d34 -->|defined in| 4a8d8d02_d652_cbc3_7bc3_f0b30eca63df b0a43897_35a9_6c9b_99ea_6e8326e77be4["SpliceHandler()"] c9a84116_fb55_fb37_e20b_00eb6f492d34 -->|method| b0a43897_35a9_6c9b_99ea_6e8326e77be4 5a6fbe16_50d1_4f38_a2fc_ef7e67385838["channelActive()"] c9a84116_fb55_fb37_e20b_00eb6f492d34 -->|method| 5a6fbe16_50d1_4f38_a2fc_ef7e67385838 01ec3529_22f5_05f9_d4fa_fed5f65f22a8["exceptionCaught()"] c9a84116_fb55_fb37_e20b_00eb6f492d34 -->|method| 01ec3529_22f5_05f9_d4fa_fed5f65f22a8
Relationship Graph
Source Code
transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollSpliceTest.java lines 282–311
private static class SpliceHandler extends ChannelInboundHandlerAdapter {
private final File file;
volatile ChannelFuture future;
volatile ChannelFuture future2;
final AtomicReference<Throwable> exception = new AtomicReference<Throwable>();
SpliceHandler(File file) {
this.file = file;
}
@Override
public void channelActive(ChannelHandlerContext ctx) throws Exception {
final EpollSocketChannel ch = (EpollSocketChannel) ctx.channel();
final FileDescriptor fd = FileDescriptor.from(file);
// splice two halves separately to test starting offset
future = ch.spliceTo(fd, 0, data.length / 2);
future2 = ch.spliceTo(fd, data.length / 2, data.length / 2);
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx,
Throwable cause) throws Exception {
if (exception.compareAndSet(null, cause)) {
cause.printStackTrace();
ctx.close();
}
}
}
Source
Frequently Asked Questions
What is the SpliceHandler class?
SpliceHandler is a class in the netty codebase, defined in transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollSpliceTest.java.
Where is SpliceHandler defined?
SpliceHandler is defined in transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollSpliceTest.java at line 282.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free