/** * Stops the server when closed */ @Override default void close() { stop(); }
private Collection<AddonRepository> getRepositories() { return (addonView == null) ? furnace.getRepositories() : addonView.getRepositories(); } }
@Inject public FurnaceServiceProducer(Furnace furnace) { this.addonRegistry = furnace.getAddonRegistry(); }
private void waitUntilStarted() { while (furnace.getStatus().isStarting()) { try { Thread.sleep(10); } catch (InterruptedException e) { throw new ContainerException("Interrputed while waiting for STARTED state.", e); } } }
@Override public String toString() { String result = "Furnace: " + runnable.furnace.hashCode() + "\nStatus: " + runnable.furnace.getStatus() + "\n\n"; for (AddonRepository repository : runnable.furnace.getRepositories()) { result += repository + "\n"; } result += "\n" + runnable.furnace; return result; } }
private void waitUntilStable(Furnace forge) throws InterruptedException { while (forge.getStatus().isStarting()) { Thread.sleep(10); } } }
@Override public CommandResult execute() { furnace.addRepository(AddonRepositoryMode.IMMUTABLE, new File(directory)); return CommandResult.CONTINUE; }
private List<AddonInfo> collectRequiredAddons(final AddonInfo addonInfo) { return furnace.getLockManager().performLocked(LockMode.READ, new Callable<List<AddonInfo>>() { @Override public List<AddonInfo> call() throws Exception { List<AddonInfo> allAddons = new LinkedList<>(); collectRequiredAddons(addonInfo, allAddons); return allAddons; } }); }
@Override public MutableAddonRepository call() throws Exception { return (MutableAddonRepository) runnable.furnace.addRepository(AddonRepositoryMode.MUTABLE, new File(addonDir, OperatingSystemUtils.getSafeFilename(repositoryName))); } });
public void stop() { furnace.stop(); } }
@Override public CommandResult execute() { furnace.addRepository(AddonRepositoryMode.MUTABLE, new File(directory)); return CommandResult.CONTINUE; }
@Override public void execute() { furnace.getLockManager().performLocked(LockMode.WRITE, new Callable<Object>() { @Override public Object call() throws Exception { deploy(repository); repository.enable(addonInfo.getAddon()); return null; } }); }
@PreDestroy public void destroy() { furnace.stop(); } }
@Override public CommandResult execute() { furnace.addRepository(AddonRepositoryMode.MUTABLE, new File(directory)); return CommandResult.CONTINUE; }
@Override public void execute() { furnace.getLockManager().performLocked(LockMode.WRITE, new Callable<Object>() { @Override public Object call() throws Exception { AddonId id = getRequestedAddonInfo().getAddon(); repository.disable(id); repository.undeploy(id); return null; } }); }
@PreDestroy public void destroy() { furnace.stop(); } }
@Override public CommandResult execute() { furnace.addRepository(AddonRepositoryMode.IMMUTABLE, new File(directory)); return CommandResult.CONTINUE; }
@PreDestroy public void destroy() { furnace.stop(); } }