if (enableRemoteSecurity) {
RemoteSecurity remoteSecurity = factory.makeRemoteSecurity(config, engine);
engine = remoteSecurity.login(fluxConfig.getUser(), fluxConfig.getPassword());
}
FluxSchedulerManager schedulerManager = new FluxSchedulerManager(engine);
environment.manage(schedulerManager);
environment.addHealthCheck(new SchedulerHealthCheck(engine));
environment.addResource(new SchedulerResource(engine));
}