本文整理汇总了Java中io.netty.util.internal.logging.InternalLogger.info方法的典型用法代码示例。如果您正苦于以下问题:Java InternalLogger.info方法的具体用法?Java InternalLogger.info怎么用?Java InternalLogger.info使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.netty.util.internal.logging.InternalLogger
的用法示例。
在下文中一共展示了InternalLogger.info方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createScript
import io.netty.util.internal.logging.InternalLogger; //导入方法依赖的package包/类
/**
* Creates a new Script object.
*
* @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;
}
示例2: retain
import io.netty.util.internal.logging.InternalLogger; //导入方法依赖的package包/类
public void retain() {
if (counter.incrementAndGet() == 1) {
if (instanceCounter.getAndIncrement() > 0) {
InternalLogger instance = InternalLoggerFactory.getInstance(getClass());
instance.info("Initialized PauseDetectorWrapper more than once.");
}
pauseDetector = new SimplePauseDetector(TimeUnit.MILLISECONDS.toNanos(10), TimeUnit.MILLISECONDS.toNanos(10), 3);
Runtime.getRuntime().addShutdownHook(new Thread("ShutdownHook for SimplePauseDetector") {
@Override
public void run() {
if (pauseDetector != null) {
pauseDetector.shutdown();
}
}
});
}
}
示例3: AHessianJmxServer
import io.netty.util.internal.logging.InternalLogger; //导入方法依赖的package包/类
public AHessianJmxServer(MBeanServer mbeanServer, String ipFilter,
String serviceDiscoveryName, int port, InternalLogger logger,
int debug, InetAddress address) 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();
Set<String> channelOptions = new HashSet();
// channelOptions.add("SO_REUSE");
channelOptions.add("TCP_NODELAY");
int serverPort = port;
DefaultServer server = new DefaultServer(OioServerSocketChannel.class,
builder, channelOptions, serverPort, address);
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();
}