Package org.osgi.service.indexer

Examples of org.osgi.service.indexer.ResourceAnalyzer


      // Iterate over the analyzers
      try {
        synchronized (analyzers) {
          for (Pair<ResourceAnalyzer, Filter> entry : analyzers) {
            ResourceAnalyzer analyzer = entry.getFirst();
            Filter filter = entry.getSecond();

            if (filter == null || filter.match(resource.getProperties())) {
              try {
                analyzer.analyzeResource(resource, caps, reqs);
              } catch (Exception e) {
                log(LogService.LOG_ERROR,
                    MessageFormat.format("Error calling analyzer \"{0}\" on resource {1}.", analyzer.getClass().getName(), resource.getLocation()), e);
              }
            }
          }
        }
      } finally {
View Full Code Here


    IndexResult result = new IndexResult();
    result.resource = new JarResource(file);
    result.signature = getSignature();
    synchronized (analyzers) {
      for (Pair<ResourceAnalyzer, Filter> entry : analyzers) {
        ResourceAnalyzer analyzer = entry.getFirst();
        Filter filter = entry.getSecond();

        if (filter == null || filter.match(result.resource.getProperties())) {
          analyzer.analyzeResource(result.resource, result.capabilities, result.requirements);
        }
      }
    }
    return result;
  }
View Full Code Here

    TrackingStruct struct = new TrackingStruct();
    try {
      String filterStr = (String) reference.getProperty(ResourceAnalyzer.FILTER);
      Filter filter = (filterStr != null) ? FrameworkUtil.createFilter(filterStr) : null;

      @SuppressWarnings("unchecked")
      ResourceAnalyzer analyzer = (ResourceAnalyzer) context.getService(reference);
      if (analyzer == null)
        return null;

      struct = new TrackingStruct();
View Full Code Here

      // Iterate over the analyzers
      try {
        synchronized (analyzers) {
          for (Pair<ResourceAnalyzer, Filter> entry : analyzers) {
            ResourceAnalyzer analyzer = entry.getFirst();
            Filter filter = entry.getSecond();

            if (filter == null || filter.match(resource.getProperties())) {
              try {
                analyzer.analyzeResource(resource, caps, reqs);
              } catch (Exception e) {
                log(LogService.LOG_ERROR,
                    MessageFormat.format("Error calling analyzer \"{0}\" on resource {1}.", analyzer.getClass().getName(), resource.getLocation()), e);
              }
            }
          }
        }
      } finally {
View Full Code Here

TOP

Related Classes of org.osgi.service.indexer.ResourceAnalyzer

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.