@Override public void addRepository(ExtensionRepository repository) { addRepository(repository, DEFAULT_PRIORITY); }
@Override @Deprecated public ExtensionRepository addRepository(ExtensionRepositoryId repositoryId) throws ExtensionRepositoryException { return addRepository((ExtensionRepositoryDescriptor) repositoryId); }
@Override public ExtensionRepository addRepository(ExtensionRepositoryDescriptor repositoryDescriptor, int priority) throws ExtensionRepositoryException { ExtensionRepository repository; try { ExtensionRepositoryFactory repositoryFactory = this.componentManager.getInstance(ExtensionRepositoryFactory.class, repositoryDescriptor.getType()); repository = repositoryFactory.createRepository(repositoryDescriptor); addRepository(repository, priority); } catch (ComponentLookupException e) { throw new ExtensionRepositoryException( "Unsupported repository type [" + repositoryDescriptor.getType() + "]", e); } return repository; }
@Override public void initialize() throws InitializationException { // Set descriptor setDescriptor(new DefaultExtensionRepositoryDescriptor("remote")); // Load default extension repositories for (ExtensionRepositorySource repositoriesSource : this.repositoriesSources) { for (ExtensionRepositoryDescriptor repositoryDescriptor : repositoriesSource .getExtensionRepositoryDescriptors()) { try { addRepository(repositoryDescriptor, repositoriesSource.getPriority()); } catch (ExtensionRepositoryException e) { this.logger.error("Failed to add repository [" + repositoryDescriptor + "]", e); } } } }
public void addRepository(ExtensionRepositoryId repositoryId) throws ExtensionRepositoryException { try { ExtensionRepositoryFactory repositoryFactory = this.componentManager.lookup(ExtensionRepositoryFactory.class, repositoryId.getType()); addRepository(repositoryFactory.createRepository(repositoryId)); } catch (ComponentLookupException e) { throw new ExtensionRepositoryException("Unsupported repository type[" + repositoryId.getType() + "]", e); } }