• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java DefaultChannelPipeline类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jboss.netty.channel.DefaultChannelPipeline的典型用法代码示例。如果您正苦于以下问题:Java DefaultChannelPipeline类的具体用法?Java DefaultChannelPipeline怎么用?Java DefaultChannelPipeline使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DefaultChannelPipeline类属于org.jboss.netty.channel包,在下文中一共展示了DefaultChannelPipeline类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: start

import org.jboss.netty.channel.DefaultChannelPipeline; //导入依赖的package包/类
public void start(int listenPort, final ExecutorService threadPool) throws Exception {
  if (!startFlag.compareAndSet(false, true)) {
    return;
  }
  bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
    public ChannelPipeline getPipeline() throws Exception {
      ChannelPipeline pipeline = new DefaultChannelPipeline();
      pipeline.addLast("decoder", new NettyProtocolDecoder());
      pipeline.addLast("encoder", new NettyProtocolEncoder());
      pipeline.addLast("handler", new NettyServerHandler(threadPool));
      return pipeline;
    }
  });
  bootstrap.bind(new InetSocketAddress(listenPort));
  LOGGER.warn("Server started,listen at: " + listenPort);
}
 
开发者ID:leeyazhou,项目名称:nfs-rpc,代码行数:17,代码来源:NettyServer.java


示例2: start

import org.jboss.netty.channel.DefaultChannelPipeline; //导入依赖的package包/类
public void start() {
    bootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(
            Executors.newFixedThreadPool(1),
            Executors.newCachedThreadPool()
    ));

    bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
        public ChannelPipeline getPipeline() throws Exception {
            ChannelPipeline pipeline = new DefaultChannelPipeline();
            pipeline.addLast("ssl", new SslHandler(getSSLEngine()));
            pipeline.addLast("decoder", new LumberjackDecoder());
            pipeline.addLast("logHandler", new LogEventHandler(eventListener));
            return pipeline;
        }
    });
    bootstrap.bind(new InetSocketAddress(configuration.getIpAddress(), configuration.getPort()));
}
 
开发者ID:sivasamyk,项目名称:graylog2-input-lumberjack,代码行数:18,代码来源:LumberjackServer.java


示例3: start

import org.jboss.netty.channel.DefaultChannelPipeline; //导入依赖的package包/类
public void start() {
    bootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(
            Executors.newFixedThreadPool(1),
            Executors.newCachedThreadPool()
    ));

    bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
        public ChannelPipeline getPipeline() throws Exception {
            ChannelPipeline pipeline = new DefaultChannelPipeline();
            if(configuration.isSslEnabled()) {
                pipeline.addLast("ssl", new SslHandler(getSSLEngine()));
            }
            pipeline.addLast("decoder", new LumberjackDecoder());
            pipeline.addLast("logHandler", new EventHandler(eventListener));
            return pipeline;
        }
    });
    bootstrap.bind(new InetSocketAddress(configuration.getIpAddress(), configuration.getPort()));
}
 
开发者ID:sivasamyk,项目名称:graylog-beats-plugin,代码行数:20,代码来源:LumberjackServer.java


示例4: start

import org.jboss.netty.channel.DefaultChannelPipeline; //导入依赖的package包/类
public void start(int listenPort, final ExecutorService threadPool, final long timeout) throws Exception {
	if (!startFlag.compareAndSet(false, true)) {
		return;
	}
	bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
		public ChannelPipeline getPipeline() throws Exception {
			ChannelPipeline pipeline = new DefaultChannelPipeline();
			pipeline.addLast("decoder", new StringDecoder());
			pipeline.addLast("encoder", new StringEncoder());
			pipeline.addLast("handler", new NettyServerHandler(threadPool, timeout));
			return pipeline;
		}
	});
	bootstrap.bind(new InetSocketAddress(listenPort));
	log.warn("Server started,listen at: " + listenPort);
}
 
开发者ID:liuxinglanyue,项目名称:migration-tool,代码行数:17,代码来源:NettyServer.java


示例5: getPipeline

import org.jboss.netty.channel.DefaultChannelPipeline; //导入依赖的package包/类
public ChannelPipeline getPipeline() throws Exception {
  ChannelPipeline pipeline = new DefaultChannelPipeline();
  pipeline.addLast("decoder", new NettyProtocolDecoder());
  pipeline.addLast("encoder", new NettyProtocolEncoder());
  pipeline.addLast("handler", handler);
  return pipeline;
}
 
开发者ID:leeyazhou,项目名称:nfs-rpc,代码行数:8,代码来源:NettyClientPipelineFactory.java


示例6: getPipeline

import org.jboss.netty.channel.DefaultChannelPipeline; //导入依赖的package包/类
@Override
public ChannelPipeline getPipeline() throws Exception {
	final ChannelPipeline pipeline = new DefaultChannelPipeline();
	pipeline.addLast("timeout", new ReadTimeoutHandler(timer, 10));
	pipeline.addLast("encoder", new RS2Encoder());
	pipeline.addLast("decoder", new RS2LoginProtocol());
	pipeline.addLast("handler", new ChannelHandler());
	return pipeline;
}
 
开发者ID:Jarinus,项目名称:osrs-private-server,代码行数:10,代码来源:PipelineFactory.java


示例7: createChannelPipelineFactory

import org.jboss.netty.channel.DefaultChannelPipeline; //导入依赖的package包/类
@Override
protected SSLAwareChannelHandler createChannelPipelineFactory(final SSLConfiguration config, final StorageManager storageManager) {
	return new SSLAwareChannelHandler(this, config, Thread.currentThread().getContextClassLoader(), storageManager) {
		@Override
		public ChannelPipeline getPipeline() throws Exception {
			ChannelPipeline pipeline = new DefaultChannelPipeline();
			PgBackendProtocol pgBackendProtocol = new PgBackendProtocol(maxLobSize, maxBufferSize, config, requireSecure);
		    pipeline.addLast("odbcFrontendProtocol", new PgFrontendProtocol(pgBackendProtocol, 1 << 20)); //$NON-NLS-1$
		    pipeline.addLast("odbcBackendProtocol", pgBackendProtocol); //$NON-NLS-1$
		    pipeline.addLast("handler", this); //$NON-NLS-1$
		    return pipeline;
		}			
	};
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:15,代码来源:ODBCSocketListener.java


示例8: getPipeline

import org.jboss.netty.channel.DefaultChannelPipeline; //导入依赖的package包/类
@Override
public ChannelPipeline getPipeline() throws Exception {
	ChannelPipeline pipeline = new DefaultChannelPipeline();
	pipeline.addLast("decoder", new StringDecoder());
	pipeline.addLast("encoder", new StringEncoder());
	pipeline.addLast("handler", handler);
	return pipeline;
}
 
开发者ID:liuxinglanyue,项目名称:migration-tool,代码行数:9,代码来源:NettyClientPipelineFactory.java


示例9: run

import org.jboss.netty.channel.DefaultChannelPipeline; //导入依赖的package包/类
public void run()
{
    // Configure the server.
    this.bootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool()));
    
    // Set up the event pipeline factory.
    this.bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
        
        @Override
        public ChannelPipeline getPipeline() throws Exception
        {
            WebServerSocketHandler webServerSocketHandler = new WebServerSocketHandler();
            ChannelPipeline pipeline = new DefaultChannelPipeline();
            pipeline.addLast("decoder", new HttpRequestDecoder());
            pipeline.addLast("aggregator", new HttpChunkAggregator(65536));
            pipeline.addLast("encoder", new HttpResponseEncoder());
            pipeline.addLast("handler", webServerSocketHandler);
            
            WebSocketServer.this.t.notifyAccept(webServerSocketHandler);
            
            return pipeline;
        }
    });
    
    // Bind and start to accept incoming connections.
    this.bind = this.bootstrap.bind(new InetSocketAddress(this.host, this.port));
    this.port = ((InetSocketAddress) this.bind.getLocalAddress()).getPort();
    
    System.out.println("Web socket server started at port " + this.port + '.');
    System.out.println("Open your browser and navigate to http://" + this.host + ":" + this.port + '/'); 
}
 
开发者ID:EricssonResearch,项目名称:trap,代码行数:32,代码来源:WebSocketServer.java


示例10: getPipeline

import org.jboss.netty.channel.DefaultChannelPipeline; //导入依赖的package包/类
public ChannelPipeline getPipeline() {
    ChannelPipeline pipeline = new DefaultChannelPipeline();
    pipeline.addLast("framer", new CreeperDelimiterBasedFrameDecoder(8192, Delimiters.lineDelimiter()));
    pipeline.addLast("decoder", new CreeperStringDecoder());
    pipeline.addLast("encoder", new StringEncoder());
    pipeline.addLast("handler", handler);
    return pipeline;
}
 
开发者ID:chriskearney,项目名称:creeper,代码行数:9,代码来源:CreeperServerPipelineFactory.java


示例11: addChunkHandlesNonExistingChunkList

import org.jboss.netty.channel.DefaultChannelPipeline; //导入依赖的package包/类
@Test
public void addChunkHandlesNonExistingChunkList() {
    DefaultLocalClientChannelFactory channelFactory = new DefaultLocalClientChannelFactory();
    DefaultChannelPipeline pipeline = new DefaultChannelPipeline();
    Channel channel = channelFactory.newChannel(pipeline);
    chunkedRequestAssembler.addChunk(channel, EMPTY_CHUNK);
}
 
开发者ID:graylog-labs,项目名称:jersey-netty,代码行数:8,代码来源:ChunkedRequestAssemblerTest.java


示例12: addChunkHandlesNullChunk

import org.jboss.netty.channel.DefaultChannelPipeline; //导入依赖的package包/类
@Test
public void addChunkHandlesNullChunk() {
    DefaultLocalClientChannelFactory channelFactory = new DefaultLocalClientChannelFactory();
    DefaultChannelPipeline pipeline = new DefaultChannelPipeline();
    Channel channel = channelFactory.newChannel(pipeline);
    chunkedRequestAssembler.addChunk(channel, null);
}
 
开发者ID:graylog-labs,项目名称:jersey-netty,代码行数:8,代码来源:ChunkedRequestAssemblerTest.java


示例13: addChunkHandlesExistingChunkList

import org.jboss.netty.channel.DefaultChannelPipeline; //导入依赖的package包/类
@Test
public void addChunkHandlesExistingChunkList() {
    DefaultLocalClientChannelFactory channelFactory = new DefaultLocalClientChannelFactory();
    DefaultChannelPipeline pipeline = new DefaultChannelPipeline();
    Channel channel = channelFactory.newChannel(pipeline);
    HttpRequest httpRequest = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "");
    chunkedRequestAssembler.setup(channel, httpRequest);
    chunkedRequestAssembler.addChunk(channel, EMPTY_CHUNK);
}
 
开发者ID:graylog-labs,项目名称:jersey-netty,代码行数:10,代码来源:ChunkedRequestAssemblerTest.java



注:本文中的org.jboss.netty.channel.DefaultChannelPipeline类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AtmosphereRequest类代码示例发布时间:2022-05-22
下一篇:
Java FSSTAT3Response类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap