Package org.osgi.service.repository

Examples of org.osgi.service.repository.Repository.findProviders()


    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


        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

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.