Search in sources :

Example 1 with ALPNHandler

use of org.infinispan.rest.ALPNHandler in project infinispan by infinispan.

the class SinglePortChannelInitializer method initializeChannel.

@Override
public void initializeChannel(Channel ch) throws Exception {
    super.initializeChannel(ch);
    upgradeServers.values().stream().filter(ps -> ps instanceof HotRodServer).findFirst().ifPresent(hotRodServer -> ch.pipeline().addLast(HotRodPingDetector.NAME, new HotRodPingDetector((HotRodServer) hotRodServer)));
    upgradeServers.values().stream().filter(ps -> ps instanceof RespServer).findFirst().ifPresent(respServer -> ch.pipeline().addLast(RespDetector.NAME, new RespDetector((RespServer) respServer)));
    if (server.getConfiguration().ssl().enabled()) {
        ch.pipeline().addLast(new ALPNHandler(restServer));
    } else {
        ALPNHandler.configurePipeline(ch.pipeline(), ApplicationProtocolNames.HTTP_1_1, restServer, upgradeServers);
    }
}
Also used : ALPNHandler(org.infinispan.rest.ALPNHandler) HotRodServer(org.infinispan.server.hotrod.HotRodServer) RespServer(org.infinispan.server.resp.RespServer)

Aggregations

ALPNHandler (org.infinispan.rest.ALPNHandler)1 HotRodServer (org.infinispan.server.hotrod.HotRodServer)1 RespServer (org.infinispan.server.resp.RespServer)1