public class Monitor {
private Monitor(CommandLine cmd) throws IOException {
NioSocketAcceptor acceptor = new NioSocketAcceptor(4);
TextLineCodecFactory factory = new TextLineCodecFactory(Charset.forName("UTF-8"));
if (cmd.hasOption("buffer"))
factory.setDecoderMaxLineLength(Integer.valueOf(cmd.getOptionValue("buffer")));
acceptor.getFilterChain().addLast("codec", new ProtocolCodecFilter(factory));
MonitorHandler handler = new MonitorHandler();
if (cmd.hasOption("debug"))