private static Function<Stopper, ChannelInitializer<SocketChannel>> buildChannelInitializer(final LaunchConfig launchConfig) {
return stopper -> new RatpackChannelInitializer(launchConfig, createHandler(launchConfig), stopper);
}
private static Handler createHandler(final LaunchConfig launchConfig) {
final HandlerFactory handlerFactory = launchConfig.getHandlerFactory();
if (launchConfig.isDevelopment()) {
File classFile = ClassUtil.getClassFile(handlerFactory);
if (classFile != null) {
Factory<Handler> factory = new ReloadableFileBackedFactory<>(classFile.toPath(), true, (file, bytes) -> createHandler(launchConfig, handlerFactory));