Examples of SimpleFilter


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

        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;
            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);
                }
View Full Code Here

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

        final BundleImpl bundle, final String className,
        final String expr, final boolean checkAssignable)
        throws InvalidSyntaxException
    {
        // Define filter if expression is not null.
        SimpleFilter filter = null;
        if (expr != null)
        {
            try
            {
                filter = SimpleFilter.parse(expr);
View Full Code Here

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

    public synchronized List getServiceReferences(String className, SimpleFilter filter)
    {
        if ((className == null) && (filter == null))
        {
            // Return all services.
            filter = new SimpleFilter(Constants.OBJECTCLASS, "*", SimpleFilter.PRESENT);
        }
        else if ((className != null) && (filter == null))
        {
            // Return services matching the class name.
            filter = new SimpleFilter(Constants.OBJECTCLASS, className, SimpleFilter.EQ);
        }
        else if ((className != null) && (filter != null))
        {
            // Return services matching the class name and filter.
            List filters = new ArrayList(2);
            filters.add(new SimpleFilter(Constants.OBJECTCLASS, className, SimpleFilter.EQ));
            filters.add(filter);
            filter = new SimpleFilter(null, filters, SimpleFilter.AND);
        }
        // else just use the specified filter.

        Set<BundleCapability> matches = m_regCapSet.match(filter, false);

View Full Code Here

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

                newAttrs.put(
                    BundleRevision.PACKAGE_NAMESPACE,
                    path);

                // Create filter now so we can inject filter directive.
                SimpleFilter sf = SimpleFilter.convert(newAttrs);

                // Inject filter directive.
// TODO: OSGi R4.3 - Can we insert this on demand somehow?
                Map<String, String> dirs = clause.m_dirs;
                Map<String, String> newDirs = new HashMap<String, String>(dirs.size() + 1);
                newDirs.putAll(dirs);
                newDirs.put(
                    Constants.FILTER_DIRECTIVE,
                    sf.toString());

                // Create package requirement and add to requirement list.
                reqList.add(
                    new BundleRequirementImpl(
                        owner,
View Full Code Here

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

        for (ParsedHeaderClause clause : clauses)
        {
            try
            {
                String filterStr = clause.m_dirs.get(Constants.FILTER_DIRECTIVE);
                SimpleFilter sf = (filterStr != null)
                    ? SimpleFilter.parse(filterStr)
                    : new SimpleFilter(null, null, SimpleFilter.MATCH_ALL);
                for (String path : clause.m_paths)
                {
                    // Create requirement and add to requirement list.
                    reqList.add(
                        new BundleRequirementImpl(
View Full Code Here

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

                newAttrs.put(
                    BundleRevision.HOST_NAMESPACE,
                    clauses.get(0).m_paths.get(0));

                // Create filter now so we can inject filter directive.
                SimpleFilter sf = SimpleFilter.convert(newAttrs);

                // Inject filter directive.
// TODO: OSGi R4.3 - Can we insert this on demand somehow?
                Map<String, String> dirs = clauses.get(0).m_dirs;
                Map<String, String> newDirs = new HashMap<String, String>(dirs.size() + 1);
                newDirs.putAll(dirs);
                newDirs.put(
                    Constants.FILTER_DIRECTIVE,
                    sf.toString());

                reqs.add(new BundleRequirementImpl(
                    owner, BundleRevision.HOST_NAMESPACE,
                    newDirs,
                    newAttrs));
View Full Code Here

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

                newAttrs.put(
                    BundleRevision.BUNDLE_NAMESPACE,
                    path);

                // Create filter now so we can inject filter directive.
                SimpleFilter sf = SimpleFilter.convert(newAttrs);

                // Inject filter directive.
// TODO: OSGi R4.3 - Can we insert this on demand somehow?
                Map<String, String> dirs = clause.m_dirs;
                Map<String, String> newDirs = new HashMap<String, String>(dirs.size() + 1);
                newDirs.putAll(dirs);
                newDirs.put(
                    Constants.FILTER_DIRECTIVE,
                    sf.toString());

                // Create package requirement and add to requirement list.
                reqList.add(
                    new BundleRequirementImpl(
                        owner,
View Full Code Here

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

    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);
        }
      }
View Full Code Here

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

    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);
        }
      }
View Full Code Here

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

                newAttrs.put(
                    BundleRevision.PACKAGE_NAMESPACE,
                    path);

                // Create filter now so we can inject filter directive.
                SimpleFilter sf = SimpleFilter.convert(newAttrs);

                // Inject filter directive.
// TODO: OSGi R4.3 - Can we insert this on demand somehow?
                Map<String, String> dirs = clause.m_dirs;
                Map<String, String> newDirs = new HashMap<String, String>(dirs.size() + 1);
                newDirs.putAll(dirs);
                newDirs.put(
                    Constants.FILTER_DIRECTIVE,
                    sf.toString());

                // Create package requirement and add to requirement list.
                reqList.add(
                    new BundleRequirementImpl(
                        owner,
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.