use of org.adbcj.mysql.codec.ClientRequest in project adbcj by mheath.
the class Handler method handleDownstream.
public void handleDownstream(ChannelHandlerContext context, ChannelEvent event) throws Exception {
if (!(event instanceof MessageEvent)) {
context.sendDownstream(event);
return;
}
MessageEvent e = (MessageEvent) event;
if (!(e.getMessage() instanceof ClientRequest)) {
context.sendDownstream(event);
return;
}
ChannelBuffer buffer = ChannelBuffers.buffer(1024);
ChannelBufferOutputStream out = new ChannelBufferOutputStream(buffer);
encoder.encode((ClientRequest) e.getMessage(), out);
Channels.write(context, e.getFuture(), buffer);
}
Aggregations