本文整理汇总了Java中org.jboss.netty.handler.logging.LoggingHandler类的典型用法代码示例。如果您正苦于以下问题:Java LoggingHandler类的具体用法?Java LoggingHandler怎么用?Java LoggingHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LoggingHandler类属于org.jboss.netty.handler.logging包,在下文中一共展示了LoggingHandler类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: main
import org.jboss.netty.handler.logging.LoggingHandler; //导入依赖的package包/类
public static void main(String[] args) {
String hostname = "127.0.0.1";
int port = 5044;
if (args.length >= 2) {
hostname = args[0];
port = firstNonNull(Ints.tryParse(args[1]), 5044);
}
if (args.length >= 1) {
port = firstNonNull(Ints.tryParse(args[1]), 5044);
}
final ChannelFactory factory =
new NioServerSocketChannelFactory(
Executors.newCachedThreadPool(),
Executors.newCachedThreadPool());
final ServerBootstrap b = new ServerBootstrap(factory);
b.getPipeline().addLast("beats-frame-decoder", new BeatsFrameDecoder());
b.getPipeline().addLast("beats-codec", new BeatsCodecHandler());
b.getPipeline().addLast("logging", new LoggingHandler());
System.out.println("Starting listener on " + hostname + ":" + port);
b.bind(new InetSocketAddress(hostname, port));
}
开发者ID:Graylog2,项目名称:graylog-plugin-beats,代码行数:23,代码来源:ConsolePrinter.java
示例2: getPipeline
import org.jboss.netty.handler.logging.LoggingHandler; //导入依赖的package包/类
@Override
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline pipeline = pipeline();
pipeline.addLast("idle-detection", IDLE_STATE_HANDLER);
pipeline.addLast("logging", new LoggingHandler(InternalLogLevel.DEBUG));
pipeline.addLast("http-deflater", new HttpContentCompressor());
pipeline.addLast("decoder", new HttpResponseDecoder(RESPONSE_MAX_INITIAL_LINE_LENGTH, RESPONSE_MAX_HEADER_SIZE, RESPONSE_MAX_CHUNK_SIZE));
pipeline.addLast("encoder", new HttpRequestEncoder());
pipeline.addLast("http-inflater", new HttpContentDecompressor());
pipeline.addLast("remote-hop-timer", new ClientTimingHandler("outbound"));
pipeline.addLast("exception-surfacer", EXCEPTION_SURFACER);
pipeline.addLast("idle-watchdog", new IdleChannelWatchdog("outbound"));
return pipeline;
}
开发者ID:neilbeveridge,项目名称:zuul-netty,代码行数:17,代码来源:HttpOutboundPipeline.java
示例3: getPipeline
import org.jboss.netty.handler.logging.LoggingHandler; //导入依赖的package包/类
@Override
public ChannelPipeline getPipeline() throws Exception {
RpcServerHandler handler = new RpcServerHandler();
handler.setExecutor(executor);
ChannelPipeline pipeline = Channels.pipeline();
pipeline.addLast("logger", new LoggingHandler(InternalLogLevel.DEBUG));
pipeline.addLast("decoder", new RpcRequestDecoder());
pipeline.addLast("encoder", new RpcResponseEncoder());
pipeline.addLast("handler", handler);
return pipeline;
}
开发者ID:OSEHRA,项目名称:vista-soa-ri,代码行数:14,代码来源:RpcServerPipelineFactory.java
示例4: getPipeline
import org.jboss.netty.handler.logging.LoggingHandler; //导入依赖的package包/类
@Override
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline pipeline = Channels.pipeline();
pipeline.addLast("logger", new LoggingHandler(InternalLogLevel.DEBUG));
pipeline.addLast("decoder", new RpcResponseDecoder());
pipeline.addLast("encoder", new RpcRequestEncoder());
pipeline.addLast("handler", new RpcClientHandler());
return pipeline;
}
开发者ID:OSEHRA,项目名称:vista-soa-ri,代码行数:12,代码来源:RpcClientPipelineFactory.java
示例5: getPipeline
import org.jboss.netty.handler.logging.LoggingHandler; //导入依赖的package包/类
@Override
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline pipeline = Channels.pipeline();
pipeline.addLast("logger", new LoggingHandler(InternalLogLevel.INFO));
pipeline.addLast("decoder", new RpcRequestDecoder());
pipeline.addLast("encoder", new RpcResponseEncoder());
pipeline.addLast("handler", new ServerChannelHandler(consumer));
return pipeline;
}
开发者ID:OSEHRA,项目名称:vista-soa-ri,代码行数:12,代码来源:RpcServerPipelineFactory.java
示例6: getPipeline
import org.jboss.netty.handler.logging.LoggingHandler; //导入依赖的package包/类
@Override
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline pipeline = Channels.pipeline();
pipeline.addLast("logger", new LoggingHandler(InternalLogLevel.INFO));
pipeline.addLast("decoder", new RpcResponseDecoder());
pipeline.addLast("encoder", new RpcRequestEncoder());
pipeline.addLast("handler", new ClientChannelHandler(producer));
return pipeline;
}
开发者ID:OSEHRA,项目名称:vista-soa-ri,代码行数:12,代码来源:RpcClientPipelineFactory.java
示例7: start
import org.jboss.netty.handler.logging.LoggingHandler; //导入依赖的package包/类
/**
* Start sending DHCPv6 SOLICITs.
*/
public void start()
{
DatagramChannelFactory factory =
new OioDatagramChannelFactory(Executors.newCachedThreadPool());
server = new InetSocketAddress(serverAddr, serverPort);
client = new InetSocketAddress(clientPort);
ChannelPipeline pipeline = Channels.pipeline();
pipeline.addLast("logger", new LoggingHandler());
pipeline.addLast("encoder", new DhcpV6ChannelEncoder());
pipeline.addLast("decoder", new DhcpV6ChannelDecoder(client, false));
pipeline.addLast("executor", new ExecutionHandler(
new OrderedMemoryAwareThreadPoolExecutor(16, 1048576, 1048576)));
pipeline.addLast("handler", this);
channel = factory.newChannel(pipeline);
channel.getConfig().setNetworkInterface(mcastNetIf);
channel.bind(client);
for (int i=1; i<=numRequests; i++) {
executor.execute(new ClientMachine(i));
}
synchronized (syncDone) {
long ms = timeout * 1000;
try {
log.info("Waiting total of " + timeout + " milliseconds for completion");
syncDone.wait(ms);
}
catch (InterruptedException ex) {
log.error("Interrupted", ex);
}
}
log.info("Complete: solicitsSent=" + solicitsSent +
" advertisementsReceived=" + advertisementsReceived +
" requestsSent=" + requestsSent +
" requestRepliesReceived=" + requestRepliesReceived +
" releasesSent=" + releasesSent +
" releaseRepliesReceived=" + releaseRepliesReceived +
" elapsedTime=" + (endTime - startTime) + "ms");
log.info("Shutting down executor...");
executor.shutdownNow();
log.info("Closing channel...");
channel.close();
log.info("Done.");
if ((solicitsSent.get() == advertisementsReceived.get()) &&
(requestsSent.get() == requestRepliesReceived.get()) &&
(releasesSent.get() == releaseRepliesReceived.get())) {
System.exit(0);
}
else {
System.exit(1);
}
}
开发者ID:jagornet,项目名称:dhcp,代码行数:62,代码来源:ClientSimulatorV6.java
示例8: start
import org.jboss.netty.handler.logging.LoggingHandler; //导入依赖的package包/类
/**
* Start sending DHCPv4 DISCOVERs.
*/
public void start()
{
DatagramChannelFactory factory =
new NioDatagramChannelFactory(Executors.newCachedThreadPool());
server = new InetSocketAddress(serverAddr, serverPort);
client = new InetSocketAddress(clientPort);
ChannelPipeline pipeline = Channels.pipeline();
pipeline.addLast("logger", new LoggingHandler());
pipeline.addLast("encoder", new DhcpV4ChannelEncoder());
pipeline.addLast("decoder", new DhcpV4ChannelDecoder(client, false));
pipeline.addLast("executor", new ExecutionHandler(
new OrderedMemoryAwareThreadPoolExecutor(16, 1048576, 1048576)));
pipeline.addLast("handler", this);
channel = factory.newChannel(pipeline);
channel.bind(client);
for (int i=1; i<=numRequests; i++) {
executor.execute(new ClientMachine(i));
}
synchronized (syncDone) {
long ms = timeout * 1000;
try {
log.info("Waiting total of " + timeout + " milliseconds for completion");
syncDone.wait(ms);
}
catch (InterruptedException ex) {
log.error("Interrupted", ex);
}
}
log.info("Complete: discoversSent=" + discoversSent +
" offersReceived=" + offersReceived +
" requestsSent=" + requestsSent +
" acksReceived=" + acksReceived +
" releasesSent=" + releasesSent +
" elapsedTime=" + (endTime - startTime) + "ms");
log.info("Shutting down executor...");
executor.shutdownNow();
log.info("Closing channel...");
channel.close();
log.info("Done.");
if ((discoversSent.get() == offersReceived.get()) &&
(requestsSent.get() == acksReceived.get()) &&
(releasesSent.get() == numRequests)) {
System.exit(0);
}
else {
System.exit(1);
}
}
开发者ID:jagornet,项目名称:dhcp,代码行数:60,代码来源:ClientSimulatorV4.java
注:本文中的org.jboss.netty.handler.logging.LoggingHandler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论