/** * Runs the application by performing all necessary initialization logic * like service registrations, etc. * * @param preRunRunnable * - to execute logic between * {@link Bootstrap#preRun(SnowOwlConfiguration, Environment)} * and * {@link Bootstrap#run(SnowOwlConfiguration, Environment, IProgressMonitor)} * @param monitor * - to monitor application startup */ public void run(PreRunRunnable preRunRunnable, IProgressMonitor monitor) throws Exception { if (!isRunning()) { checkState(bootstrap != null, "Bootstrap the application first"); if (preRunCompleted.compareAndSet(false, true)) { this.bootstrap.preRun(configuration, environment); } if (preRunRunnable != null) { preRunRunnable.run(); } LOG.info("Preparing to run Snow Owl..."); this.bootstrap.run(configuration, environment, monitor); checkApplicationState(); running.set(true); LOG.info("Snow Owl successfully started."); } else { LOG.info("Snow Owl is already running."); } }