Handle the incoming message: pass it to the listener.

@param ctx the context object for this handler.
@param msg the message.
@throws Exception
764975
@Override
  public void channelRead(
      final ChannelHandlerContext ctx, final Object msg) throws Exception {
    try {
      this.listener.channelRead(ctx, msg);
    } finally {
      ReferenceCountUtil.release(msg);
    }
  }
984003
@Override
    public void handleMessage(Message msg) {
        if (msg.what == ASYNC) {
            mAsyncDispatcher.dispatch();
        } else if (msg.what == SYNC) {
            mSyncDispatcher.dispatch();
        } else super.handleMessage(msg);
    }
1024275
public void w(final String msg) {
        logMgr.log(tag, LogLevelConst.WARNING, msg, null);
    }
69018
@Override
    public void channelInactive(ChannelHandlerContext ctx) throws Exception {
        super.channelInactive(ctx);

        if (currentMessage != null && currentMessage.getExtras() != null) {
            if (currentMessage.getExtras().refCnt() > 0) {
                currentMessage.getExtras().release();
            }
        }

        if (currentMessage != null && currentMessage.getFramingExtras() != null) {
            if (currentMessage.getFramingExtras().refCnt() > 0) {
                currentMessage.getFramingExtras().release();
            }
        }

        resetDecoder();
    }
595427
@SuppressWarnings({"ThrowableInstanceNeverThrown"})
    public void warning(String msg, Exception ex) throws SAXException{
        xml.warning(new SAXParseException(msg, null, ex));
    }
327650
void handleSubscriberException(Throwable e, SubscriberExceptionContext context) {
    checkNotNull(e);
    checkNotNull(context);
    try {
      exceptionHandler.handleException(e, context);
    } catch (Throwable e2) {
      // if the handler threw an exception... well, just log it
      logger.log(Level.SEVERE,
          String.format("Exception %s thrown while handling exception: %s", e2, e), e2);
    }
  }
782609
public final String translate (InvocationContext ctx, String msg)
    {
        return _msgmgr.getMessage(ctx.getRequest(), msg);
    }
1008281
public void debug(String msg) {
        logHandler.debug(msg);
        if (debugStore != null) {
            debugStore.log(msg);
        }
    }
888681
protected void logException(CharSequence msg, Exception e) {
    System.err.println(msg + ":" + e.getMessage());
    e.printStackTrace();
  }
330806
def handle_msg(self, c, e):
        
        try:
            self.handler.handle_msg(c, e)
        except Exception as ex:
            backtrace.handle_traceback(ex, c, self.get_target(e), self.config)
354982
public void trace(final IJNRPEExecutionContext ctx, final String message) {
        postEvent(ctx, new LogEvent(source, LogEventType.TRACE, message));
    }
591192
@Override
    public void handle(CommandContext ctx, String commandLine) {
        String[] commands = commandLine.split(" ");
        if (commands.length != 1) {
            ctx.printLine("Invalid command.");
            return;
        }

        ctx.terminateSession();
    }
39024
public void debug(final IJNRPEExecutionContext ctx, final String message) {
        postEvent(ctx, new LogEvent(source, LogEventType.DEBUG, message));
    }
757613
@Override
    public void handle(Message<Void> msg) {
        msg.reply(dependency.getClass().getName());
    }
375570
public void error(final IJNRPEExecutionContext ctx, final String message) {
        postEvent(ctx, new LogEvent(source, LogEventType.ERROR, message));
    }
765689
public void warn(String msg, Throwable t)
	{
		log(LogLevel.WARN, msg, t);
	}
724690
public void send(String msg) {
    try {
      Socket socket = new Socket(graphiteHost, graphitePort);

      try {
        Writer writer = new OutputStreamWriter(socket.getOutputStream());
        try {
          writer.write(msg);
          writer.flush();
        } finally {
          try {
            writer.close();
          } catch (IOException ioe) {
            //ignore, we want to see the outer exception if any
            LOGGER.info("could not close writer");
          }
        }
        if (connectionState != ConnectionState.SUCCESS) {
          LOGGER.info("Connection to graphite Host {}",
            ((connectionState == ConnectionState.UNKNOWN) ? "established" : "recovered"));
          connectionState = ConnectionState.SUCCESS;
        }

      } catch (IOException e) {
        String action = "write";
        handleException(e, action);
      } finally {
        socket.close();
      }
    } catch (IOException e) {
      String action = "connect";
      handleException(e, action);
    }
  }