Refine search
public ConverterFactory getConverterFactory() { if (converterFactory == null) { AddonRegistry addonRegistry = furnace.getAddonRegistry(); Imported<ConverterFactory> converterFactoryImport = addonRegistry.getServices(ConverterFactory.class); converterFactory = converterFactoryImport.get(); } return converterFactory; }
public GraphApiCompositeClassLoaderProvider() { this.furnace = SimpleContainer.getFurnace(GraphApiCompositeClassLoaderProvider.class.getClassLoader()); for (Addon addon : this.furnace.getAddonRegistry().getAddons()) { if (addon.getClassLoader() != null && addon.getClassLoader().equals(GraphApiCompositeClassLoaderProvider.class.getClassLoader())) { this.addon = addon; break; } } }
@Override public Set<ClassLoader> call() throws Exception { if (furnace.getStatus().isStarted()) { long registryVersion = furnace.getAddonRegistry().getVersion(); if (registryVersion != lastRegistryVersion) { result.clear(); lastRegistryVersion = registryVersion; for (Addon addon : furnace.getAddonRegistry().getAddons()) { ClassLoader classLoader = addon.getClassLoader(); if (classLoader != null) result.add(classLoader); } } } return result; } };
private Iterable<ProjectProvider> getProviders() { AddonRegistry addonRegistry = getAddonRegistry(); if (addonRegistry.getVersion() != version) { version = addonRegistry.getVersion(); providers.clear(); for (ProjectProvider provider : addonRegistry.getServices(ProjectProvider.class)) { providers.add(provider); } } return providers; }
private GitIgnoreConfig getGitIgnoreConfig() { if (gitIgnoreConfig == null) { AddonRegistry addonRegistry = SimpleContainer.getFurnace(getClass().getClassLoader()).getAddonRegistry(); gitIgnoreConfig = addonRegistry.getServices(GitIgnoreConfig.class).get(); } return gitIgnoreConfig; }
@Override public URL call() throws Exception { URL result = null; for (Addon addon : furnace.getAddonRegistry().getAddons(AddonFilters.allLoaded())) { URL url = addon.getClassLoader().getResource(name); if (url != null) { result = url; break; } } return result; } });
ForgeScriptEngine(ForgeScriptEngineFactory factory) { this.factory = factory; AddonRegistry addonRegistry = Furnace.instance(getClass().getClassLoader()).getAddonRegistry(); this.shellFactory = addonRegistry.getServices(ShellFactory.class).get(); this.resourceFactory = addonRegistry.getServices(ResourceFactory.class).get(); }
@Override public UICommand getCommand(AddonRegistry addonRegistry, UIContext context) { return addonRegistry.getServices(type).get(); }
@Override public Result execute(UIExecutionContext context) final Furnace furnace = SimpleContainer.getFurnace(getClass().getClassLoader()); AddonManager addonManager = SimpleContainer.getServices(getClass().getClassLoader(), AddonManager.class).get(); AddonDependencyResolver resolver = SimpleContainer .getServices(getClass().getClassLoader(), AddonDependencyResolver.class).get(); Set<Addon> addons = furnace.getAddonRegistry().getAddons(); AddonId addonId = addons.stream().map(a -> a.getId()).filter(a -> a.getName().equals(named.getValue())) .findFirst().get(); String addonAPIVersion = resolver.resolveAPIVersion(addonId).get(); for (AddonRepository r : furnace.getRepositories())
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(); }
@Override public Result execute(UIExecutionContext context) throws Exception Furnace furnace = SimpleContainer.getFurnace(getClass().getClassLoader()); AddonRegistry registry = furnace.getAddonRegistry(); AddonManager addonManager = registry.getServices(AddonManager.class).get(); ProjectFactory projectFactory = getProjectFactory(); ResourceFactory resourceFactory = registry.getServices(ResourceFactory.class).get(); GitUtils gitUtils = registry.getServices(GitUtils.class).get(); .addArguments("clean", "install", "-Dversion.furnace=" + furnace.getVersion(), "-Dversion.forge=" + Versions.getImplementationVersionFor(getClass())) .runTests(false) RemoveRequest removeRequest = addonManager.remove(id); removeRequest.perform(); Addons.waitUntilStopped(registry.getAddon(id)); progressMonitor.worked(1);
private Imported<TemplateGenerator> getTemplateGenerators() { if (generators == null) { AddonRegistry addonRegistry = SimpleContainer.getFurnace(getClass().getClassLoader()).getAddonRegistry(); generators = addonRegistry.getServices(TemplateGenerator.class); } return generators; } }
private Addon getAddon() { Set<Addon> addons = SimpleContainer.getFurnace(RexsterInitializer.class.getClassLoader()).getAddonRegistry().getAddons(); for (Addon addon : addons) { boolean isRexster = addon.getId().getName().contains("rexster"); if (isRexster) { return addon; } } return null; }
AddonManager addonManager = SimpleContainer.getServices(getClass().getClassLoader(), AddonManager.class).get(); AddonId id = AddonId.from(coordinate.getGroupId() + ":" + coordinate.getArtifactId(), coordinate.getVersion()); RemoveRequest removeRequest = addonManager.remove(id); removeRequest.perform(); AddonRegistry registry = SimpleContainer.getFurnace(getClass().getClassLoader()).getAddonRegistry(); Addons.waitUntilStopped(registry.getAddon(id)); InstallRequest installRequest = addonManager.install(id); installRequest.perform();
private void startFurnace() throws InterruptedException, ExecutionException Future<Furnace> future = furnace.startAsync(); for (Addon addon : furnace.getAddonRegistry().getAddons()) if (!addon.getStatus().isStarted()) for (Addon addon : furnace.getAddonRegistry().getAddons()) if (!addon.getStatus().isStarted()) System.err.println("WARN: " + addon.getId() + " status: " + addon.getStatus());
final AddonRegistry addonRegistry = forge.getAddonRegistry(); for (Addon addon : addonRegistry.getAddons()) Future<Void> future = addon.getFuture(); if (future != null) future.get(); if (addon.getStatus().isStarted()) ServiceRegistry registry = addon.getServiceRegistry(); ExportedInstance<?> exportedInstance = registry.getExportedInstance(testClassName);
/** * Returns all of the {@link ConfigurationOption} in the specified {@link Addon}. */ public static Iterable<ConfigurationOption> getWindupConfigurationOptions(Addon addon) { IdentityHashMap<ClassLoader, Addon> classLoaderToAddon = new IdentityHashMap<>(); for (Addon loadedAddon : FurnaceHolder.getAddonRegistry().getAddons()) { classLoaderToAddon.put(loadedAddon.getClassLoader(), loadedAddon); } List<ConfigurationOption> results = new ArrayList<>(); Imported<ConfigurationOption> options = FurnaceHolder.getAddonRegistry() .getServices(ConfigurationOption.class); for (ConfigurationOption option : options) { ClassLoader optionClassLoader = option.getClass().getClassLoader(); Addon optionAddon = classLoaderToAddon.get(optionClassLoader); if (optionAddon.equals(addon)) { results.add(option); } } return results; }
@Override public T produce(CreationalContext<T> ctx) { return furnaceProducer.getFurnace().getAddonRegistry().getServices(type).iterator().next(); }
/** * Gets the transformers for the given graph context, or loads them if necessary. */ public static List<TechnologyReferenceTransformer> getTransformers(RuleLoaderContext ruleLoaderContext) { List<TechnologyReferenceTransformer> transformerList = new ArrayList<>(); Iterable<TechnologyReferenceTransformerLoader> loaders = FurnaceHolder.getFurnace().getAddonRegistry() .getServices(TechnologyReferenceTransformerLoader.class); loaders.forEach((loader) -> { transformerList.addAll(loader.loadTransformers(ruleLoaderContext)); }); return transformerList; }
@Override public Iterable<String> getCompletionProposals(UIContext context, InputComponent<?, String> input, String value) { Set<String> items = new TreeSet<String>(); Set<Addon> addons = furnace.getAddonRegistry().getAddons(); for (Addon addon : addons) { if (addon.getId().toCoordinates().startsWith(value)) items.add(addon.getId().getName()); } return items; } });