use of org.jboss.netty.channel.ChannelPipeline in project pinpoint by naver.
the class ServerPipelineFactory method getPipeline.
@Override
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline pipeline = Channels.pipeline();
pipeline.addLast("decoder", new PacketDecoder());
pipeline.addLast("encoder", new PacketEncoder());
pipeline.addLast("handler", pinpointServerChannelHandler);
return pipeline;
}
use of org.jboss.netty.channel.ChannelPipeline in project pinpoint by naver.
the class PinpointClientPipelineFactory method getPipeline.
@Override
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline pipeline = Channels.pipeline();
pipeline.addLast("encoder", new PacketEncoder());
pipeline.addLast("decoder", new PacketDecoder());
long pingDelay = pinpointClientFactory.getPingDelay();
long enableWorkerPacketDelay = pinpointClientFactory.getEnableWorkerPacketDelay();
long timeoutMillis = pinpointClientFactory.getTimeoutMillis();
DefaultPinpointClientHandler defaultPinpointClientHandler = new DefaultPinpointClientHandler(pinpointClientFactory, pingDelay, enableWorkerPacketDelay, timeoutMillis);
pipeline.addLast("writeTimeout", new WriteTimeoutHandler(defaultPinpointClientHandler.getChannelTimer(), 3000, TimeUnit.MILLISECONDS));
pipeline.addLast("socketHandler", defaultPinpointClientHandler);
return pipeline;
}
use of org.jboss.netty.channel.ChannelPipeline in project neo4j by neo4j.
the class Server method getPipeline.
@Override
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline pipeline = Channels.pipeline();
pipeline.addLast("monitor", new MonitorChannelHandler(byteCounterMonitor));
addLengthFieldPipes(pipeline, frameLength);
pipeline.addLast("serverHandler", this);
return pipeline;
}
use of org.jboss.netty.channel.ChannelPipeline in project yyl_example by Relucent.
the class NettyClient method main.
public static void main(String[] args) {
ClientBootstrap bootstrap = new ClientBootstrap(new //
NioClientSocketChannelFactory(//
Executors.newCachedThreadPool(), //
Executors.newCachedThreadPool()));
// Set up the default event pipeline.
bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
@Override
public ChannelPipeline getPipeline() throws Exception {
return Channels.pipeline(new StringDecoder(), new StringEncoder(), new ClientHandler());
}
});
// Start the connection attempt.
ChannelFuture future = bootstrap.connect(new InetSocketAddress("localhost", 8000));
// Wait until the connection is closed or the connection attempt fails.
future.getChannel().getCloseFuture().awaitUninterruptibly();
// Shut down thread pools to exit.
bootstrap.releaseExternalResources();
}
use of org.jboss.netty.channel.ChannelPipeline in project Protocol-Adapter-IEC61850 by OSGP.
the class Iec61850Config method createChannelPipeline.
private ChannelPipeline createChannelPipeline(final ChannelHandler handler) throws ProtocolAdapterException {
final ChannelPipeline pipeline = Channels.pipeline();
pipeline.addLast("loggingHandler", new LoggingHandler(InternalLogLevel.INFO, true));
pipeline.addLast("iec61850RegisterDeviceRequestDecoder", new RegisterDeviceRequestDecoder());
pipeline.addLast("iec61850ChannelHandler", handler);
return pipeline;
}
Aggregations