use of org.jboss.netty.handler.codec.string.StringEncoder in project traccar by tananaev.
the class H02Protocol method initTrackerServers.
@Override
public void initTrackerServers(List<TrackerServer> serverList) {
serverList.add(new TrackerServer(new ServerBootstrap(), getName()) {
@Override
protected void addSpecificHandlers(ChannelPipeline pipeline) {
int messageLength = Context.getConfig().getInteger(getName() + ".messageLength");
pipeline.addLast("frameDecoder", new H02FrameDecoder(messageLength));
pipeline.addLast("stringEncoder", new StringEncoder());
pipeline.addLast("objectEncoder", new H02ProtocolEncoder());
pipeline.addLast("objectDecoder", new H02ProtocolDecoder(H02Protocol.this));
}
});
serverList.add(new TrackerServer(new ConnectionlessBootstrap(), getName()) {
@Override
protected void addSpecificHandlers(ChannelPipeline pipeline) {
pipeline.addLast("stringEncoder", new StringEncoder());
pipeline.addLast("objectEncoder", new H02ProtocolEncoder());
pipeline.addLast("objectDecoder", new H02ProtocolDecoder(H02Protocol.this));
}
});
}
use of org.jboss.netty.handler.codec.string.StringEncoder in project traccar by tananaev.
the class Pt502Protocol 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 Pt502FrameDecoder());
pipeline.addLast("stringEncoder", new StringEncoder());
pipeline.addLast("stringDecoder", new StringDecoder());
pipeline.addLast("objectEncoder", new Pt502ProtocolEncoder());
pipeline.addLast("objectDecoder", new Pt502ProtocolDecoder(Pt502Protocol.this));
}
};
server.setEndianness(ByteOrder.LITTLE_ENDIAN);
serverList.add(server);
}
use of org.jboss.netty.handler.codec.string.StringEncoder 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));
}
});
}
use of org.jboss.netty.handler.codec.string.StringEncoder 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));
}
});
}
use of org.jboss.netty.handler.codec.string.StringEncoder in project camel by apache.
the class NettyHttpGetWithInvalidMessageTest method createRegistry.
@Override
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry registry = super.createRegistry();
// setup the String encoder and decoder
StringDecoder stringDecoder = new StringDecoder();
registry.bind("string-decoder", stringDecoder);
StringEncoder stringEncoder = new StringEncoder();
registry.bind("string-encoder", stringEncoder);
List<ChannelHandler> decoders = new ArrayList<ChannelHandler>();
decoders.add(stringDecoder);
List<ChannelHandler> encoders = new ArrayList<ChannelHandler>();
encoders.add(stringEncoder);
registry.bind("encoders", encoders);
registry.bind("decoders", decoders);
return registry;
}
Aggregations