Example usage for io.netty.util.internal.logging InternalLogger info

List of usage examples for io.netty.util.internal.logging InternalLogger info

Introduction

In this page you can find the example usage for io.netty.util.internal.logging InternalLogger info.

Prototype

void info(Throwable t);

Source Link

Document

Log an exception (throwable) at the INFO level.

Usage

From source file:org.rzo.yajsw.script.ScriptFactory.java

License:Apache License

/**
 * Creates a new Script object.//  www.java 2s. c o  m
 * 
 * @param script
 *            the script
 * @param timeout
 * 
 * @return the script
 */
public static Script createScript(String script, String id, WrappedProcess process, String[] args,
        InternalLogger log, int timeout, String encoding, boolean reload, int debug, int maxConcInvocations) {
    if (script == null || "".equals(script))
        return null;
    if (log != null && debug > 1)
        log.info("create script: " + script);
    if (script.endsWith(".bat") || script.endsWith(".sh"))
        return new ShellScript(script, id, process, args, timeout, maxConcInvocations);
    if (script.endsWith(".gv") || script.endsWith(".groovy"))
        try {
            return new GroovyScript(script, id, process, args, timeout, log, encoding, reload,
                    maxConcInvocations);
        } catch (Throwable e) {
            if (log != null)
                log.info("Error in createScript " + script, e);
        }
    return null;
}

From source file:org.rzo.yajsw.tray.ahessian.server.AHessianJmxServer.java

License:Apache License

public AHessianJmxServer(MBeanServer mbeanServer, String ipFilter, String serviceDiscoveryName, int port,
        InternalLogger logger, int debug) throws Exception {

    // InternalLoggerFactory.setDefaultFactory(new SimpleLoggerFactory());

    ChannelPipelineFactoryBuilder builder = new ChannelPipelineFactoryBuilder()
            .serializerFactory(new JmxSerializerFactory()).rpcServiceInterface(MBeanServerConnection.class)
            .rpcServerService(mbeanServer).serviceThreads(10).ipFilter(ipFilter);

    if (debug > 2)
        builder.debug();// w w w  . j  a  v a  2 s.  c  o m

    Set<String> channelOptions = new HashSet();
    // channelOptions.add("SO_REUSE");
    channelOptions.add("TCP_NODELAY");

    int serverPort = port;

    DefaultServer server = new DefaultServer(NioServerSocketChannel.class, builder, channelOptions, serverPort);

    server.start();
    Channel channel = server.getChannel();

    Executor executor = Executors.newCachedThreadPool();

    if (serverPort == 0)
        serverPort = ((InetSocketAddress) channel.localAddress()).getPort();

    if (debug > 2 && logger != null)
        logger.info("ahessian jmx service bound to port " + serverPort);

    DiscoveryServer discovery = new DiscoveryServer();
    discovery.setDebug(debug > 2);
    discovery.setLogger(logger);
    // allow discovery only from localhost. other computers will be ignored
    discovery.setIpSet(new IpFilterRuleList("+n:localhost, -n:*"));
    discovery.setName(serviceDiscoveryName);
    discovery.setPort(serverPort);
    discovery.init();

}