use of dmg.cells.nucleus.CellCommandListener in project dcache by dCache.
the class NettyLineBasedDoor method start.
protected void start(ChannelHandlerContext ctx) throws Exception {
LineWriter writer = ctx::writeAndFlush;
clientAddress = remoteAddress.getAddress().getHostAddress();
LOGGER.debug("Client host: {}", clientAddress);
interpreter = factory.create(this, getNucleus().getThisAddress(), remoteAddress, proxyAddress, localAddress, writer, executor, poolManager, idResolverFactory, spaceDescriptionCache, spaceLookupCache);
if (interpreter instanceof CellCommandListener) {
addCommandListener(interpreter);
}
if (interpreter instanceof CellMessageReceiver) {
addMessageListener((CellMessageReceiver) interpreter);
}
if (interpreter instanceof TlsStarter) {
((TlsStarter) interpreter).setTlsStarter(e -> {
e.setUseClientMode(false);
ctx.pipeline().addFirst("tls", new SslHandler(e, true));
});
}
// Blocking to prevent that we process any commands before the cell is alive
start().get();
}
Aggregations