Package org.osgi.service.repository

Examples of org.osgi.service.repository.Repository


            }
        }

        // Try the identifier as MavenCoordinates
        if (isValidMavenIdentifier(identifier)) {
            Repository repository = injectedRepository.getValue();
            MavenCoordinates mavenId = MavenCoordinates.parse(identifier);
            Requirement req = XRequirementBuilder.createArtifactRequirement(mavenId);
            Collection<Capability> caps = repository.findProviders(req);
            if (caps.isEmpty() == false) {
                XIdentityCapability icap = (XIdentityCapability) caps.iterator().next();
                URL bundleURL = (URL) icap.getAttribute(XResourceConstants.CONTENT_URL);
                return installBundleFromURL(bundleManager, bundleURL, startLevel);
            }
View Full Code Here


            }
        }

        // Try the identifier as MavenCoordinates
        if (isValidMavenIdentifier(identifier)) {
            Repository repository = injectedRepository.getValue();
            MavenCoordinates mavenId = MavenCoordinates.parse(identifier);
            Requirement req = XRequirementBuilder.createArtifactRequirement(mavenId);
            Collection<Capability> caps = repository.findProviders(req);
            if (caps.isEmpty() == false) {
                XIdentityCapability icap = (XIdentityCapability) caps.iterator().next();
                URL bundleURL = (URL) icap.getAttribute(XResourceConstants.CONTENT_URL);
                return installBundleFromURL(bundleManager, bundleURL, startLevel);
            }
View Full Code Here

    return !capabilities.isEmpty();
  }
 
  private boolean addDependenciesFromContentRepository(Requirement requirement, List<Capability> capabilities) throws BundleException, IOException, InvalidSyntaxException, URISyntaxException {
    // TODO Why create this with each method call? What not cache it as an instance variable?
    Repository repository = new ContentRepository(installableContent, sharedContent);
    return addDependencies(repository, requirement, capabilities);
  }
View Full Code Here

    Repository repository = new ContentRepository(installableContent, sharedContent);
    return addDependencies(repository, requirement, capabilities);
  }
 
  private boolean addDependenciesFromLocalRepository(Requirement requirement, List<Capability> capabilities) throws BundleException, IOException, InvalidSyntaxException, URISyntaxException {
    Repository repository = resource.getLocalRepository();
    return addDependencies(repository, requirement, capabilities);
  }
View Full Code Here

  private boolean addDependenciesFromPreferredProviderRepository(Requirement requirement, List<Capability> capabilities) throws BundleException, IOException, InvalidSyntaxException, URISyntaxException {
    return addDependencies(preferredProviderRepository, requirement, capabilities);
  }
 
  private boolean addDependenciesFromRepositoryServiceRepositories(Requirement requirement, List<Capability> capabilities) throws BundleException, IOException, InvalidSyntaxException, URISyntaxException {
    Repository repository = new RepositoryServiceRepository();
    return addDependencies(repository, requirement, capabilities);
  }
View Full Code Here

    Repository repository = new RepositoryServiceRepository();
    return addDependencies(repository, requirement, capabilities);
  }
 
  private boolean addDependenciesFromSystemRepository(Requirement requirement, List<Capability> capabilities) throws BundleException, IOException, InvalidSyntaxException, URISyntaxException {
    Repository repository = Activator.getInstance().getSystemRepository();
    return addDependencies(repository, requirement, capabilities);
  }
View Full Code Here

    }
    catch (InvalidSyntaxException e) {
      throw new IllegalStateException(e);
    }
    for (ServiceReference<Repository> reference : references) {
      Repository repository = context.getService(reference);
      try {
        if (repository == null)
          continue;
        Map<Requirement, Collection<Capability>> map = repository.findProviders(Collections.singleton(requirement));
        Collection<Capability> capabilities = map.get(requirement);
        if (capabilities == null)
          continue;
        result.addAll(capabilities);
      }
View Full Code Here

        }

        // Try the identifier as MavenCoordinates
        else if (isValidMavenIdentifier(identifier)) {
            LOGGER.tracef("Installing initial maven capability: %s", identifier);
            Repository repository = injectedRepository.getValue();
            MavenCoordinates mavenId = MavenCoordinates.parse(identifier);
            Requirement req = XRequirementBuilder.createArtifactRequirement(mavenId);
            Collection<Capability> caps = repository.findProviders(Collections.singleton(req)).get(req);
            if (caps.isEmpty() == false) {
                XIdentityCapability icap = (XIdentityCapability) caps.iterator().next();
                URL bundleURL = (URL) icap.getAttribute(XResourceConstants.CONTENT_URL);
                result =  installBundleFromURL(bundleURL, identifier, level, listener);
            }
View Full Code Here

                } else {
                    logger.warn("Unrecognized resource repository: " + url);
                }
            }
        }
        Repository globalRepository;
        switch (repositories.size()) {
        case 0:
            globalRepository = null;
            break;
        case 1:
View Full Code Here

TOP

Related Classes of org.osgi.service.repository.Repository

Copyright © 2018 www.massapicom. 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.