* Call the {@link LineHandler}
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception {
ProtocolSession pSession = (ProtocolSession) ctx.getAttachment();
LinkedList<LineHandler> lineHandlers = chain.getHandlers(LineHandler.class);
LinkedList<ProtocolHandlerResultHandler> resultHandlers = chain.getHandlers(ProtocolHandlerResultHandler.class);
if (lineHandlers.size() > 0) {
ChannelBuffer buf = (ChannelBuffer) e.getMessage();
LineHandler lHandler= (LineHandler) lineHandlers.getLast();
long start = System.currentTimeMillis();
Response response = lHandler.onLine(pSession,buf.toByteBuffer());
long executionTime = System.currentTimeMillis() - start;
for (int i = 0; i < resultHandlers.size(); i++) {
// Disable till PROTOCOLS-37 is implemented
if (response instanceof FutureResponse) {
pSession.getLogger().debug("ProtocolHandlerResultHandler are not supported for FutureResponse yet");
break;
}
response = resultHandlers.get(i).onResponse(pSession, response, executionTime, lHandler);
}
if (response != null) {