public void start() { Future<Furnace> future = furnace.startAsync(); try { future.get(); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException("Furnace failed to start.", e); } }
public void setup(Path repoDir) { LOG.info("Starting with repo: " + repoDir); Furnace furnace; try { furnace = FurnaceFactory.getInstance(Thread.currentThread() .getContextClassLoader(), Thread.currentThread() .getContextClassLoader()); } catch (Exception cnfe) { LOG.info("Furnace not found with TCCL, trying local CL"); furnace = FurnaceFactory.getInstance(this.getClass().getClassLoader(), this.getClass().getClassLoader()); } furnace.addRepository(AddonRepositoryMode.IMMUTABLE, repoDir.toFile()); Future<Furnace> future = furnace.startAsync(); try { future.get(); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException("Furnace failed to start.", e); } this.furnace = furnace; }
@Override public CommandResult execute() { try { furnace = FurnaceFactory.getInstance(); furnace.setServerMode(true); loadAddons(); try { Future<Furnace> future = furnace.startAsync(); future.get(); // use future.get() to wait until it is started } catch (Exception e) { System.out.println("Failed to start "+Util.WINDUP_BRAND_NAME_ACRONYM+"!"); if (e.getMessage() != null) System.out.println("Failure reason: " + e.getMessage()); e.printStackTrace(); } startServer(); } catch (Throwable t) { System.err.println(Util.WINDUP_BRAND_NAME_ACRONYM+" execution failed due to: " + t.getMessage()); t.printStackTrace(); } System.out.println("Server started..."); return null; }
@Override public CommandResult execute() { try { furnace = FurnaceFactory.getInstance(); furnace.setServerMode(true); loadAddons(); try { Future<Furnace> future = furnace.startAsync(); future.get(); // use future.get() to wait until it is started } catch (Exception e) { System.out.println("Failed to start "+Util.WINDUP_BRAND_NAME_ACRONYM+"!"); if (e.getMessage() != null) System.out.println("Failure reason: " + e.getMessage()); e.printStackTrace(); } startServer(); } catch (Throwable t) { System.err.println(Util.WINDUP_BRAND_NAME_ACRONYM+" execution failed due to: " + t.getMessage()); t.printStackTrace(); } System.out.println("Server started..."); return null; }
public void setup(File repoDir) { furnace = FurnaceFactory.getInstance(Thread.currentThread() .getContextClassLoader(), Thread.currentThread() .getContextClassLoader()); furnace.addRepository(AddonRepositoryMode.IMMUTABLE, repoDir); Future<Furnace> future = furnace.startAsync(); try { future.get(); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException("Furnace failed to start.", e); } AddonRegistry addonRegistry = furnace.getAddonRegistry(); commandFactory = addonRegistry.getServices(CommandFactory.class).get(); controllerFactory = (CommandControllerFactory) addonRegistry .getServices(CommandControllerFactory.class.getName()).get(); }
public void setup(File repoDir) { furnace = FurnaceFactory.getInstance(Thread.currentThread() .getContextClassLoader(), Thread.currentThread() .getContextClassLoader()); furnace.addRepository(AddonRepositoryMode.IMMUTABLE, repoDir); Future<Furnace> future = furnace.startAsync(); try { future.get(); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException("Furnace failed to start.", e); } AddonRegistry addonRegistry = furnace.getAddonRegistry(); commandFactory = addonRegistry.getServices(CommandFactory.class).get(); controllerFactory = (CommandControllerFactory) addonRegistry .getServices(CommandControllerFactory.class.getName()).get(); dependencyResolver = (DependencyResolver) addonRegistry .getServices(DependencyResolver.class.getName()).get(); }
private void startFurnace() throws InterruptedException, ExecutionException Future<Furnace> future = furnace.startAsync();
private void startFurnace() throws InterruptedException, ExecutionException Future<Furnace> future = furnace.startAsync();