use of org.apache.plc4x.java.spi.Plc4xNettyWrapper in project plc4x by apache.
the class CustomProtocolStackConfigurer method configurePipeline.
/**
* Applies the given Stack to the Pipeline
*/
@Override
public Plc4xProtocolBase<BASE_PACKET_CLASS> configurePipeline(Configuration configuration, ChannelPipeline pipeline, boolean passive, List<EventListener> ignore) {
if (this.encryptionHandler != null) {
pipeline.addLast(this.encryptionHandler);
}
pipeline.addLast(getMessageCodec(configuration));
Plc4xProtocolBase<BASE_PACKET_CLASS> protocol = configure(configuration, this.protocol.apply(configuration));
DriverContext driverContext = this.driverContext.apply(configuration);
if (driverContext != null) {
protocol.setDriverContext(driverContext);
}
Plc4xNettyWrapper<BASE_PACKET_CLASS> context = new Plc4xNettyWrapper<>(pipeline, passive, protocol, basePacketClass);
pipeline.addLast(context);
return protocol;
}
Aggregations