Search in sources :

Example 81 with ChannelPipeline

use of org.jboss.netty.channel.ChannelPipeline in project traccar by tananaev.

the class RecodaProtocol method initTrackerServers.

@Override
public void initTrackerServers(List<TrackerServer> serverList) {
    TrackerServer server = new TrackerServer(new ServerBootstrap(), getName()) {

        @Override
        protected void addSpecificHandlers(ChannelPipeline pipeline) {
            pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 4, 4, -8, 0));
            pipeline.addLast("objectDecoder", new RecodaProtocolDecoder(RecodaProtocol.this));
        }
    };
    server.setEndianness(ByteOrder.LITTLE_ENDIAN);
    serverList.add(server);
}
Also used : TrackerServer(org.traccar.TrackerServer) LengthFieldBasedFrameDecoder(org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder) ServerBootstrap(org.jboss.netty.bootstrap.ServerBootstrap) ChannelPipeline(org.jboss.netty.channel.ChannelPipeline)

Example 82 with ChannelPipeline

use of org.jboss.netty.channel.ChannelPipeline in project traccar by tananaev.

the class RitiProtocol method initTrackerServers.

@Override
public void initTrackerServers(List<TrackerServer> serverList) {
    TrackerServer server = new TrackerServer(new ServerBootstrap(), getName()) {

        @Override
        protected void addSpecificHandlers(ChannelPipeline pipeline) {
            pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 105, 2, 3, 0));
            pipeline.addLast("objectDecoder", new RitiProtocolDecoder(RitiProtocol.this));
        }
    };
    server.setEndianness(ByteOrder.LITTLE_ENDIAN);
    serverList.add(server);
}
Also used : TrackerServer(org.traccar.TrackerServer) LengthFieldBasedFrameDecoder(org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder) ServerBootstrap(org.jboss.netty.bootstrap.ServerBootstrap) ChannelPipeline(org.jboss.netty.channel.ChannelPipeline)

Example 83 with ChannelPipeline

use of org.jboss.netty.channel.ChannelPipeline in project traccar by tananaev.

the class XirgoProtocol method initTrackerServers.

@Override
public void initTrackerServers(List<TrackerServer> serverList) {
    serverList.add(new TrackerServer(new ServerBootstrap(), getName()) {

        @Override
        protected void addSpecificHandlers(ChannelPipeline pipeline) {
            pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "##"));
            pipeline.addLast("stringEncoder", new StringEncoder());
            pipeline.addLast("stringDecoder", new StringDecoder());
            pipeline.addLast("objectEncoder", new XirgoProtocolEncoder());
            pipeline.addLast("objectDecoder", new XirgoProtocolDecoder(XirgoProtocol.this));
        }
    });
    serverList.add(new TrackerServer(new ConnectionlessBootstrap(), getName()) {

        @Override
        protected void addSpecificHandlers(ChannelPipeline pipeline) {
            pipeline.addLast("stringEncoder", new StringEncoder());
            pipeline.addLast("stringDecoder", new StringDecoder());
            pipeline.addLast("objectEncoder", new XirgoProtocolEncoder());
            pipeline.addLast("objectDecoder", new XirgoProtocolDecoder(XirgoProtocol.this));
        }
    });
}
Also used : StringEncoder(org.jboss.netty.handler.codec.string.StringEncoder) CharacterDelimiterFrameDecoder(org.traccar.CharacterDelimiterFrameDecoder) StringDecoder(org.jboss.netty.handler.codec.string.StringDecoder) TrackerServer(org.traccar.TrackerServer) ServerBootstrap(org.jboss.netty.bootstrap.ServerBootstrap) ChannelPipeline(org.jboss.netty.channel.ChannelPipeline) ConnectionlessBootstrap(org.jboss.netty.bootstrap.ConnectionlessBootstrap)

Example 84 with ChannelPipeline

use of org.jboss.netty.channel.ChannelPipeline in project traccar by tananaev.

the class WondexProtocol method initTrackerServers.

@Override
public void initTrackerServers(List<TrackerServer> serverList) {
    serverList.add(new TrackerServer(new ServerBootstrap(), getName()) {

        @Override
        protected void addSpecificHandlers(ChannelPipeline pipeline) {
            pipeline.addLast("frameDecoder", new WondexFrameDecoder());
            pipeline.addLast("stringEncoder", new StringEncoder());
            pipeline.addLast("objectEncoder", new WondexProtocolEncoder());
            pipeline.addLast("objectDecoder", new WondexProtocolDecoder(WondexProtocol.this));
        }
    });
    serverList.add(new TrackerServer(new ConnectionlessBootstrap(), getName()) {

        @Override
        protected void addSpecificHandlers(ChannelPipeline pipeline) {
            pipeline.addLast("stringEncoder", new StringEncoder());
            pipeline.addLast("objectEncoder", new WondexProtocolEncoder());
            pipeline.addLast("objectDecoder", new WondexProtocolDecoder(WondexProtocol.this));
        }
    });
}
Also used : StringEncoder(org.jboss.netty.handler.codec.string.StringEncoder) TrackerServer(org.traccar.TrackerServer) ServerBootstrap(org.jboss.netty.bootstrap.ServerBootstrap) ChannelPipeline(org.jboss.netty.channel.ChannelPipeline) ConnectionlessBootstrap(org.jboss.netty.bootstrap.ConnectionlessBootstrap)

Example 85 with ChannelPipeline

use of org.jboss.netty.channel.ChannelPipeline in project vcell by virtualcell.

the class HttpClientPipelineFactory method getPipeline.

public ChannelPipeline getPipeline() throws Exception {
    ChannelPipeline pipeline = Channels.pipeline();
    // pipeline.addLast("ssl", new SslHandler(engine));
    pipeline.addLast("codec", new HttpClientCodec());
    pipeline.addLast("inflater", new HttpContentDecompressor());
    // pipeline.addLast("aggregator", new HttpChunkAggregator(1048576));
    pipeline.addLast("handler", responseHandler);
    return pipeline;
}
Also used : HttpClientCodec(org.jboss.netty.handler.codec.http.HttpClientCodec) ChannelPipeline(org.jboss.netty.channel.ChannelPipeline) HttpContentDecompressor(org.jboss.netty.handler.codec.http.HttpContentDecompressor)

Aggregations

ChannelPipeline (org.jboss.netty.channel.ChannelPipeline)165 ServerBootstrap (org.jboss.netty.bootstrap.ServerBootstrap)58 TrackerServer (org.traccar.TrackerServer)43 InetSocketAddress (java.net.InetSocketAddress)37 ChannelPipelineFactory (org.jboss.netty.channel.ChannelPipelineFactory)32 ConnectionlessBootstrap (org.jboss.netty.bootstrap.ConnectionlessBootstrap)26 Channel (org.jboss.netty.channel.Channel)26 SimpleObjectCaptureHandler (com.linkedin.databus2.test.container.SimpleObjectCaptureHandler)24 SocketAddress (java.net.SocketAddress)20 StringEncoder (org.jboss.netty.handler.codec.string.StringEncoder)18 SimpleTestServerConnection (com.linkedin.databus2.test.container.SimpleTestServerConnection)17 ChannelBuffer (org.jboss.netty.buffer.ChannelBuffer)16 NioServerSocketChannelFactory (org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory)16 HttpRequest (org.jboss.netty.handler.codec.http.HttpRequest)16 HttpResponse (org.jboss.netty.handler.codec.http.HttpResponse)16 HttpResponseEncoder (org.jboss.netty.handler.codec.http.HttpResponseEncoder)16 DefaultHttpResponse (org.jboss.netty.handler.codec.http.DefaultHttpResponse)15 HttpRequestDecoder (org.jboss.netty.handler.codec.http.HttpRequestDecoder)15 StringDecoder (org.jboss.netty.handler.codec.string.StringDecoder)14 LoggingHandler (org.jboss.netty.handler.logging.LoggingHandler)14