Examples of addRepository()


Examples of org.apache.felix.bundlerepository.RepositoryAdmin.addRepository()

        }
        else if ( "add".equals( action ) || "refresh".equals( action ) ) //$NON-NLS-1$ //$NON-NLS-2$
        {
            try
            {
                admin.addRepository( uri );
            }
            catch ( IOException e )
            {
                throw e;
            }
View Full Code Here

Examples of org.apache.felix.bundlerepository.RepositoryAdmin.addRepository()

            {
                try
                {
                    if (action.equals(REPO_ADD))
                    {
                        ra.addRepository(args[i]);
                    }
                    else if (action.equals(REPO_REFRESH))
                    {
                        ra.removeRepository(args[i]);
                        ra.addRepository(args[i]);
View Full Code Here

Examples of org.apache.felix.bundlerepository.RepositoryAdmin.addRepository()

        writeXMLToFile(tempXMLFile, xml);

        repoTracker = new ServiceTracker<RepositoryAdmin, RepositoryAdmin>(bundleContext, RepositoryAdmin.class, null);
        repoTracker.open();
        RepositoryAdmin repo = repoTracker.waitForService(30000);
        repo.addRepository(tempXMLFile.toURI().toURL());
        tempXMLFile.delete();

        Dictionary<String, Object> props = new Hashtable<String, Object>();
        props.put("repository-populated", reference.getProperty("repository-xml"));
        bundleContext.registerService(String.class, "", props);
View Full Code Here

Examples of org.apache.felix.bundlerepository.RepositoryAdmin.addRepository()

                        ra.addRepository(args[i]);
                    }
                    else if (action.equals(REPO_REFRESH))
                    {
                        ra.removeRepository(args[i]);
                        ra.addRepository(args[i]);
                    }
                    else if (action.equals(REPO_REMOVE))
                    {
                        ra.removeRepository(args[i]);
                    }
View Full Code Here

Examples of org.apache.felix.bundlerepository.RepositoryAdmin.addRepository()

        ServiceReference ref = bundleContext.getServiceReference(RepositoryAdmin.class.getName());
        RepositoryAdmin repositoryAdmin = (RepositoryAdmin) bundleContext.getService(ref);
        try {
            repositoryAdmin.removeRepository(obrFile.toURI().toURL().toExternalForm());
            repositoryAdmin.addRepository(obrFile.toURI().toURL());
        } finally {
            bundleContext.ungetService(ref);
        }
    }
View Full Code Here

Examples of org.apache.felix.bundlerepository.RepositoryAdmin.addRepository()

    private void registerRepositories() throws Exception {
        ServiceReference ref = bundleContext.getServiceReference(RepositoryAdmin.class.getName());
        RepositoryAdmin repositoryAdmin = (RepositoryAdmin) bundleContext.getService(ref);
        try {
            repositoryAdmin.addRepository(obrFile.toURI().toURL());
            for (URL repository : repositories) {
                repositoryAdmin.addRepository(repository);
            }
        } finally {
            bundleContext.ungetService(ref);
View Full Code Here

Examples of org.apache.felix.bundlerepository.RepositoryAdmin.addRepository()

        ServiceReference ref = bundleContext.getServiceReference(RepositoryAdmin.class.getName());
        RepositoryAdmin repositoryAdmin = (RepositoryAdmin) bundleContext.getService(ref);
        try {
            repositoryAdmin.addRepository(obrFile.toURI().toURL());
            for (URL repository : repositories) {
                repositoryAdmin.addRepository(repository);
            }
        } finally {
            bundleContext.ungetService(ref);
        }
    }
View Full Code Here

Examples of org.apache.felix.karaf.features.internal.FeaturesServiceImpl.addRepository()

        replay(preferencesService, prefs, repositoriesNode, featuresNode, bundleContext, installedBundle);

        FeaturesServiceImpl svc = new FeaturesServiceImpl();
        svc.setPreferences(preferencesService);
        svc.setBundleContext(bundleContext);
        svc.addRepository(uri);
       
        Repository[] repositories = svc.listRepositories();
        assertNotNull(repositories);
        assertEquals(1, repositories.length);
        assertNotNull(repositories[0]);
View Full Code Here

Examples of org.apache.karaf.features.FeaturesService.addRepository()

                try {
                    Kar kar = new Kar(file.toURI());
                    kar.extract(new File(system.getPath()), new File(workDirectory));
                    for (URI repoUri : kar.getFeatureRepos()) {
                        featuresService.removeRepository(repoUri);
                        featuresService.addRepository(repoUri);
                    }
                } catch (Exception e) {
                    throw new RuntimeException("Could not install kar: " + artifact.toString() + "\n", e);
                    //buf.append("Could not install kar: ").append(artifact.toString()).append("\n");
                    //buf.append(e.getMessage()).append("\n\n");
View Full Code Here

Examples of org.apache.karaf.features.internal.FeaturesServiceImpl.addRepository()

        expect(bundleManager.getDataFile(EasyMock.anyObject(String.class))).andReturn(dataFile);
        expect(bundleManager.installBundleIfNeeded(eq(name), eq(0), eq((String)null))).andReturn(new BundleInstallerResult(installedBundle, true)).anyTimes();

        replay(bundleManager);
        FeaturesServiceImpl svc = new FeaturesServiceImpl(bundleManager);
        svc.addRepository(uri);
        Repository[] repositories = svc.listRepositories();
        verify(bundleManager);

        assertNotNull(repositories);
        assertEquals(1, repositories.length);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.