Examples of CapabilitySet


Examples of org.apache.felix.framework.capabilityset.CapabilitySet

                // In that case, the fragment capability is still indexed.
                // It will be the resolver's responsibility to find all
                // attached hosts for fragments.
                if (cap.getRevision() == br)
                {
                    CapabilitySet capSet = m_capSets.get(cap.getNamespace());
                    if (capSet == null)
                    {
                        capSet = new CapabilitySet(null, true);
                        m_capSets.put(cap.getNamespace(), capSet);
                    }
                    capSet.addCapability(cap);
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.felix.framework.capabilityset.CapabilitySet

        List<BundleCapability> caps = br.getDeclaredCapabilities(null);
        if (caps != null)
        {
            for (BundleCapability cap : caps)
            {
                CapabilitySet capSet = m_capSets.get(cap.getNamespace());
                if (capSet != null)
                {
                    capSet.removeCapability(cap);
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.felix.framework.capabilityset.CapabilitySet

        m_logger = logger;
        m_callbacks = callbacks;

        List indices = new ArrayList();
        indices.add(Constants.OBJECTCLASS);
        m_regCapSet = new CapabilitySet(indices, false);
    }
View Full Code Here

Examples of org.apache.felix.framework.capabilityset.CapabilitySet

    m_fwkExecEnvStr = (fwkExecEnvStr != null) ? fwkExecEnvStr.trim() : null;
    m_fwkExecEnvSet = parseExecutionEnvironments(fwkExecEnvStr);

    List<String> indices = new ArrayList<String>();
    indices.add(BundleRevision.BUNDLE_NAMESPACE);
    m_capSets.put(BundleRevision.BUNDLE_NAMESPACE, new CapabilitySet(indices, true));

    indices = new ArrayList<String>();
    indices.add(BundleRevision.PACKAGE_NAMESPACE);
    m_capSets.put(BundleRevision.PACKAGE_NAMESPACE, new CapabilitySet(indices, true));

    indices = new ArrayList<String>();
    indices.add(BundleRevision.HOST_NAMESPACE);
    m_capSets.put(BundleRevision.HOST_NAMESPACE, new CapabilitySet(indices, true));
  }
View Full Code Here

Examples of org.apache.felix.framework.capabilityset.CapabilitySet

      for (BundleCapability cap : caps) {
        // If the capability is from a different revision, then
        // don't index it since it is a capability from a fragment.
        // In that case, the fragment capability is still indexed.
        if (cap.getRevision() == br) {
          CapabilitySet capSet = m_capSets.get(cap.getNamespace());
          if (capSet == null) {
            capSet = new CapabilitySet(null, true);
            m_capSets.put(cap.getNamespace(), capSet);
          }
          capSet.addCapability(cap);
        }
      }
    }

    if (Util.isFragment(br)) {
View Full Code Here

Examples of org.apache.felix.framework.capabilityset.CapabilitySet

      // We only need be concerned with declared capabilities here,
      // because resolved capabilities will be a subset.
      List<BundleCapability> caps = br.getDeclaredCapabilities(null);
      if (caps != null) {
        for (BundleCapability cap : caps) {
          CapabilitySet capSet = m_capSets.get(cap.getNamespace());
          if (capSet != null) {
            capSet.removeCapability(cap);
          }
        }
      }

      if (Util.isFragment(br)) {
View Full Code Here

Examples of org.apache.felix.framework.capabilityset.CapabilitySet

     */
  public synchronized SortedSet<BundleCapability> getCandidates(BundleRequirement req, boolean obeyMandatory) {
//    BundleRevision reqRevision = req.getRevision();
    SortedSet<BundleCapability> result = new TreeSet<BundleCapability>(new CandidateComparator());

    CapabilitySet capSet = m_capSets.get(req.getNamespace());
    if (capSet != null) {
      // Get the requirement's filter; if this is our own impl we
      // have a shortcut to get the already parsed filter, otherwise
      // we must parse it from the directive.
      SimpleFilter sf = null;
      if (req instanceof BundleRequirementImpl) {
        sf = ((BundleRequirementImpl) req).getFilter();
      } else {
        String filter = req.getDirectives().get(
            Constants.FILTER_DIRECTIVE);
        if (filter == null) {
          sf = new SimpleFilter(null, null, SimpleFilter.MATCH_ALL);
        } else {
          sf = SimpleFilter.parse(filter);
        }
      }

      // Find the matching candidates.
      Set<BundleCapability> matches = capSet.match(sf, obeyMandatory);
      for (BundleCapability cap : matches) {
        /* TODO: karl - is this correct?
         * if (System.getSecurityManager() != null) {
          if (req.getNamespace().equals(
              BundleRevision.PACKAGE_NAMESPACE)
View Full Code Here

Examples of org.apache.felix.framework.capabilityset.CapabilitySet

    m_fwkExecEnvStr = (fwkExecEnvStr != null) ? fwkExecEnvStr.trim() : null;
    m_fwkExecEnvSet = parseExecutionEnvironments(fwkExecEnvStr);

    List<String> indices = new ArrayList<String>();
    indices.add(BundleRevision.BUNDLE_NAMESPACE);
    m_capSets.put(BundleRevision.BUNDLE_NAMESPACE, new CapabilitySet(indices, true));

    indices = new ArrayList<String>();
    indices.add(BundleRevision.PACKAGE_NAMESPACE);
    m_capSets.put(BundleRevision.PACKAGE_NAMESPACE, new CapabilitySet(indices, true));

    indices = new ArrayList<String>();
    indices.add(BundleRevision.HOST_NAMESPACE);
    m_capSets.put(BundleRevision.HOST_NAMESPACE, new CapabilitySet(indices, true));
  }
View Full Code Here

Examples of org.apache.felix.framework.capabilityset.CapabilitySet

      for (BundleCapability cap : caps) {
        // If the capability is from a different revision, then
        // don't index it since it is a capability from a fragment.
        // In that case, the fragment capability is still indexed.
        if (cap.getRevision() == br) {
          CapabilitySet capSet = m_capSets.get(cap.getNamespace());
          if (capSet == null) {
            capSet = new CapabilitySet(null, true);
            m_capSets.put(cap.getNamespace(), capSet);
          }
          capSet.addCapability(cap);
        }
      }
    }

    if (Util.isFragment(br)) {
View Full Code Here

Examples of org.apache.felix.framework.capabilityset.CapabilitySet

      // We only need be concerned with declared capabilities here,
      // because resolved capabilities will be a subset.
      List<BundleCapability> caps = br.getDeclaredCapabilities(null);
      if (caps != null) {
        for (BundleCapability cap : caps) {
          CapabilitySet capSet = m_capSets.get(cap.getNamespace());
          if (capSet != null) {
            capSet.removeCapability(cap);
          }
        }
      }

      if (Util.isFragment(br)) {
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.