Search in sources :

Example 21 with StringEncoder

use of org.jboss.netty.handler.codec.string.StringEncoder in project traccar by tananaev.

the class Gps103Protocol 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(2048, "\r\n", "\n", ";"));
            pipeline.addLast("stringEncoder", new StringEncoder());
            pipeline.addLast("stringDecoder", new StringDecoder());
            pipeline.addLast("objectEncoder", new Gps103ProtocolEncoder());
            pipeline.addLast("objectDecoder", new Gps103ProtocolDecoder(Gps103Protocol.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 Gps103ProtocolEncoder());
            pipeline.addLast("objectDecoder", new Gps103ProtocolDecoder(Gps103Protocol.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 22 with StringEncoder

use of org.jboss.netty.handler.codec.string.StringEncoder in project traccar by tananaev.

the class T55Protocol 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 LineBasedFrameDecoder(1024));
            pipeline.addLast("stringDecoder", new StringDecoder());
            pipeline.addLast("stringEncoder", new StringEncoder());
            pipeline.addLast("objectDecoder", new T55ProtocolDecoder(T55Protocol.this));
        }
    });
    serverList.add(new TrackerServer(new ConnectionlessBootstrap(), getName()) {

        @Override
        protected void addSpecificHandlers(ChannelPipeline pipeline) {
            pipeline.addLast("stringDecoder", new StringDecoder());
            pipeline.addLast("stringEncoder", new StringEncoder());
            pipeline.addLast("objectDecoder", new T55ProtocolDecoder(T55Protocol.this));
        }
    });
}
Also used : StringEncoder(org.jboss.netty.handler.codec.string.StringEncoder) LineBasedFrameDecoder(org.jboss.netty.handler.codec.frame.LineBasedFrameDecoder) 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 23 with StringEncoder

use of org.jboss.netty.handler.codec.string.StringEncoder in project traccar by tananaev.

the class Tk103Protocol 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 Tk103FrameDecoder());
            pipeline.addLast("stringDecoder", new StringDecoder());
            pipeline.addLast("stringEncoder", new StringEncoder());
            pipeline.addLast("objectEncoder", new Tk103ProtocolEncoder());
            pipeline.addLast("objectDecoder", new Tk103ProtocolDecoder(Tk103Protocol.this));
        }
    });
    serverList.add(new TrackerServer(new ConnectionlessBootstrap(), getName()) {

        @Override
        protected void addSpecificHandlers(ChannelPipeline pipeline) {
            pipeline.addLast("stringDecoder", new StringDecoder());
            pipeline.addLast("stringEncoder", new StringEncoder());
            pipeline.addLast("objectEncoder", new Tk103ProtocolEncoder());
            pipeline.addLast("objectDecoder", new Tk103ProtocolDecoder(Tk103Protocol.this));
        }
    });
}
Also used : StringEncoder(org.jboss.netty.handler.codec.string.StringEncoder) 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 24 with StringEncoder

use of org.jboss.netty.handler.codec.string.StringEncoder in project traccar by tananaev.

the class V680Protocol 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("stringDecoder", new StringDecoder());
            pipeline.addLast("stringEncoder", new StringEncoder());
            pipeline.addLast("objectDecoder", new V680ProtocolDecoder(V680Protocol.this));
        }
    });
    serverList.add(new TrackerServer(new ConnectionlessBootstrap(), getName()) {

        @Override
        protected void addSpecificHandlers(ChannelPipeline pipeline) {
            pipeline.addLast("stringDecoder", new StringDecoder());
            pipeline.addLast("stringEncoder", new StringEncoder());
            pipeline.addLast("objectDecoder", new V680ProtocolDecoder(V680Protocol.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)

Aggregations

StringEncoder (org.jboss.netty.handler.codec.string.StringEncoder)24 ChannelPipeline (org.jboss.netty.channel.ChannelPipeline)18 StringDecoder (org.jboss.netty.handler.codec.string.StringDecoder)17 ServerBootstrap (org.jboss.netty.bootstrap.ServerBootstrap)16 TrackerServer (org.traccar.TrackerServer)15 ConnectionlessBootstrap (org.jboss.netty.bootstrap.ConnectionlessBootstrap)12 CharacterDelimiterFrameDecoder (org.traccar.CharacterDelimiterFrameDecoder)5 JndiRegistry (org.apache.camel.impl.JndiRegistry)3 InetSocketAddress (java.net.InetSocketAddress)2 ArrayList (java.util.ArrayList)2 ExecutionHandler (org.freeswitch.esl.client.internal.debug.ExecutionHandler)2 EslFrameDecoder (org.freeswitch.esl.client.transport.message.EslFrameDecoder)2 ChannelHandler (org.jboss.netty.channel.ChannelHandler)2 DelimiterBasedFrameDecoder (org.jboss.netty.handler.codec.frame.DelimiterBasedFrameDecoder)2 LineBasedFrameDecoder (org.jboss.netty.handler.codec.frame.LineBasedFrameDecoder)2 OrderedMemoryAwareThreadPoolExecutor (org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor)2 LineOrientedRequestEncoder (org.opennms.netmgt.provision.detector.simple.support.LineOrientedRequestEncoder)2 ClientBootstrap (org.jboss.netty.bootstrap.ClientBootstrap)1 ChannelFuture (org.jboss.netty.channel.ChannelFuture)1 ChannelPipelineFactory (org.jboss.netty.channel.ChannelPipelineFactory)1