public Maven getMaven() { if (maven != null) return maven; maven = registry.getPlugin(Maven.class); return maven; }
private synchronized Collection<? extends ProxyHandler> getProxyHandlers() throws Exception { if (proxyHandlers.isEmpty() && registry != null) { List<ProxyHandler> proxyHandlers = registry.getPlugins(ProxyHandler.class); this.proxyHandlers.addAll(proxyHandlers); logger.debug("Proxy handlers {}", proxyHandlers); } return proxyHandlers; }
public Maven getMaven() { if (maven != null) return maven; maven = registry.getPlugin(Maven.class); return maven; }
private synchronized Collection<? extends ProxyHandler> getProxyHandlers() throws Exception { if (proxyHandlers.isEmpty() && registry != null) { List<ProxyHandler> proxyHandlers = registry.getPlugins(ProxyHandler.class); this.proxyHandlers.addAll(proxyHandlers); logger.debug("Proxy handlers {}", proxyHandlers); } return proxyHandlers; }
public Maven getMaven() { if (maven != null) return maven; maven = registry.getPlugin(Maven.class); return maven; }
private synchronized Collection<? extends URLConnectionHandler> getURLConnectionHandlers() throws Exception { if (connectionHandlers.isEmpty() && registry != null) { List<URLConnectionHandler> connectionHandlers = registry.getPlugins(URLConnectionHandler.class); this.connectionHandlers.addAll(connectionHandlers); logger.debug("URL Connection handlers {}", connectionHandlers); } return connectionHandlers; }
public Maven getMaven() { if ( maven != null) return maven; maven = registry.getPlugin(Maven.class); return maven; }
private synchronized Collection<? extends URLConnectionHandler> getURLConnectionHandlers() throws Exception { if (connectionHandlers.isEmpty() && registry != null) { List<URLConnectionHandler> connectionHandlers = registry.getPlugins(URLConnectionHandler.class); this.connectionHandlers.addAll(connectionHandlers); logger.debug("URL Connection handlers {}", connectionHandlers); } return connectionHandlers; }
public Maven getMaven() { if (maven != null) return maven; maven = registry.getPlugin(Maven.class); return maven; }
@Override public void handle(URLConnection connection) throws Exception { for (URLConnectionHandler h : registry.getPlugins(URLConnectionHandler.class)) { h.handle(connection); } }
public Maven getMaven() { if (maven != null) return maven; maven = registry.getPlugin(Maven.class); return maven; }
public void handle(URLConnection connection) throws Exception { for (URLConnectionHandler h : registry.getPlugins(URLConnectionHandler.class)) { h.handle(connection); } }
private URLConnector getConnector() { URLConnector connector; synchronized (this) { connector = registry != null ? registry.getPlugin(URLConnector.class) : null; } if (connector == null) connector = new DefaultURLConnector(); return connector; }
@Override public void handle(URLConnection connection) throws Exception { for (URLConnectionHandler h : registry.getPlugins(URLConnectionHandler.class)) { h.handle(connection); } }
private void regenerateIndex() throws Exception { BundleIndexer indexer = registry.getPlugin(BundleIndexer.class); if (indexer == null) throw new IllegalStateException("Cannot index repository: no Bundle Indexer service or plugin found."); Set<File> allFiles = new HashSet<File>(); gatherFiles(allFiles); FileOutputStream out = null; try { out = new FileOutputStream(localIndex); if (!allFiles.isEmpty()) { Map<String, String> config = new HashMap<String, String>(); config.put(BundleIndexer.REPOSITORY_NAME, this.getName()); config.put(BundleIndexer.ROOT_URL, localIndex.getCanonicalFile().toURI().toURL().toString()); indexer.index(allFiles, out, config); } else { ByteArrayInputStream emptyRepo = new ByteArrayInputStream("<?xml version='1.0' encoding='UTF-8'?>\n<repository lastmodified='0'/>".getBytes()); IO.copy(emptyRepo, out); } } finally { out.close(); } }
private FileRepo lookupCachedFileRepo() { if (registry != null) { List<FileRepo> repos = registry.getPlugins(FileRepo.class); for (FileRepo repo : repos) { if ("cache".equals(repo.getName())) return repo; } } return null; }
/** * @return the class to use for URL connections. It's retrieved from the * registry under the URLConnector class, or it will be the * DefaultURLConnector if the former was not found. */ private URLConnector getConnector() { URLConnector connector; synchronized (this) { connector = registry != null ? registry.getPlugin(URLConnector.class) : null; } if (connector == null) { DefaultURLConnector defaultConnector = new DefaultURLConnector(); defaultConnector.setRegistry(registry); connector = defaultConnector; } return connector; }
/** * Notify all {@link RepositoryListenerPlugin}s that this repository is * updated. */ private void notifyRepositoryListeners() { registry.getPlugins(RepositoryListenerPlugin.class) .forEach((RepositoryListenerPlugin rp) -> rp.repositoryRefreshed(this)); }
/** * @return the class to use for URL connections. It's retrieved from the * registry under the URLConnector class, or it will be the * DefaultURLConnector if the former was not found. */ private URLConnector getConnector() { URLConnector connector; synchronized (this) { connector = registry != null ? registry.getPlugin(URLConnector.class) : null; } if (connector == null) { DefaultURLConnector defaultConnector = new DefaultURLConnector(); defaultConnector.setRegistry(registry); connector = defaultConnector; } return connector; }
/** * Notify all {@link RepositoryListenerPlugin}s that this repository is * updated. */ private void notifyRepositoryListeners() { registry.getPlugins(RepositoryListenerPlugin.class) .forEach((RepositoryListenerPlugin rp) -> rp.repositoryRefreshed(this)); }