/** * <p> This method installs the admin console OSGi bundle respository so * our plugins can be found.</p> */ private void addRepository(String name, String path) { File pathFile = new File(path); Repository repo = new DirectoryBasedRepository( name, pathFile); modulesRegistry.addRepository(repo); try { repo.initialize(); } catch (IOException ex) { logger.log(Level.SEVERE, "Problem initializing additional repository!", ex); } }
protected ModulesRegistry createModulesRegistry() throws Exception { assert (mrReg == null); ModulesRegistry mr = AbstractFactory.getInstance().createModulesRegistry(); String hk2RepositoryUris = ctx.getProperty(Constants.HK2_REPOSITORIES); if (hk2RepositoryUris != null) { for (String s : hk2RepositoryUris.split("\\s")) { URI repoURI = URI.create(s); File repoDir = new File(repoURI); OSGiDirectoryBasedRepository repo = new OSGiDirectoryBasedRepository(repoDir.getAbsolutePath(), repoDir); repo.initialize(); mr.addRepository(repo); } } String osgiRepositoryUris = ctx.getProperty(Constants.OBR_REPOSITORIES); if (osgiRepositoryUris != null && mr instanceof OSGiObrModulesRegistryImpl) { OSGiObrModulesRegistryImpl mr1 = (OSGiObrModulesRegistryImpl) mr; for (String s : osgiRepositoryUris.split("\\s")) { mr1.addObr(URI.create(s)); } } mrReg = ctx.registerService(ModulesRegistry.class.getName(), mr, null); return mr; }