Search in sources :

Example 6 with StringEncoder

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

the class AdmProtocol 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, 2, 1, -3, 0));
            pipeline.addLast("stringEncoder", new StringEncoder());
            pipeline.addLast("objectEncoder", new AdmProtocolEncoder());
            pipeline.addLast("objectDecoder", new AdmProtocolDecoder(AdmProtocol.this));
        }
    };
    server.setEndianness(ByteOrder.LITTLE_ENDIAN);
    serverList.add(server);
}
Also used : StringEncoder(org.jboss.netty.handler.codec.string.StringEncoder) 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 7 with StringEncoder

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

the class Gl200Protocol 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 Gl200FrameDecoder());
            pipeline.addLast("stringEncoder", new StringEncoder());
            pipeline.addLast("objectEncoder", new Gl200ProtocolEncoder());
            pipeline.addLast("objectDecoder", new Gl200ProtocolDecoder(Gl200Protocol.this));
        }
    });
    serverList.add(new TrackerServer(new ConnectionlessBootstrap(), getName()) {

        @Override
        protected void addSpecificHandlers(ChannelPipeline pipeline) {
            pipeline.addLast("stringEncoder", new StringEncoder());
            pipeline.addLast("objectEncoder", new Gl200ProtocolEncoder());
            pipeline.addLast("objectDecoder", new Gl200ProtocolDecoder(Gl200Protocol.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 8 with StringEncoder

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

the class TelicProtocol 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 TelicFrameDecoder());
            pipeline.addLast("stringDecoder", new StringDecoder());
            pipeline.addLast("stringEncoder", new StringEncoder());
            pipeline.addLast("objectDecoder", new TelicProtocolDecoder(TelicProtocol.this));
        }
    };
    server.setEndianness(ByteOrder.LITTLE_ENDIAN);
    serverList.add(server);
}
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)

Example 9 with StringEncoder

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

the class TaipProtocol 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 TaipProtocolDecoder(TaipProtocol.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 TaipProtocolDecoder(TaipProtocol.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 10 with StringEncoder

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

the class Tr900Protocol 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("stringEncoder", new StringEncoder());
            pipeline.addLast("stringDecoder", new StringDecoder());
            pipeline.addLast("objectDecoder", new Tr900ProtocolDecoder(Tr900Protocol.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("objectDecoder", new Tr900ProtocolDecoder(Tr900Protocol.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)

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