Examples of ExportedPackage


Examples of aQute.bnd.build.model.clauses.ExportedPackage

        model.setPrivatePackages(Arrays.asList(new String[] {
            pkg + ".provider"
        }));

        model.setExportedPackages(Arrays.asList(new ExportedPackage(projectName + ".api", new Attrs())));

        model.setBundleDescription("${warning:please explain what this bundle does}");
        model.setBundleVersion("1.0.0.${tstamp}");

        List<VersionedClause> buildPath = new ArrayList<VersionedClause>();
View Full Code Here

Examples of com.springsource.util.osgi.manifest.ExportedPackage

        List<ExportedPackage> packageExports = new ArrayList<ExportedPackage>();
        for (String exportedPackage : partial.getExportedPackages()) {
            HeaderDeclaration declaration = findMostSpecificDeclaration(exportTemplateDeclarations, exportedPackage);

            ExportedPackage export = result.getExportPackage().addExportedPackage(exportedPackage);

            if (declaration != null) {
                export.getAttributes().putAll(declaration.getAttributes());
                Map<String, String> directives = declaration.getDirectives();
                addCommaSeparated(export.getExclude(), directives.get("excluded"));
                addCommaSeparated(export.getInclude(), directives.get("include"));
                addCommaSeparated(export.getMandatory(), directives.get("mandatory"));
                addCommaSeparated(export.getUses(), directives.get("uses"));

            }

            Set<String> uses = partial.getUses(exportedPackage);
            export.getUses().addAll(uses);

            String version = resolveVersion(declaration, bundleVersion);
            if (StringUtils.hasText(version)) {
                export.getAttributes().put("version", version);
            }
            packageExports.add(export);
        }
    }
View Full Code Here

Examples of org.apache.aries.application.modelling.ExportedPackage

    // matched requirements out of the external requirements collection.
    Map<ImportedPackage,ExportedPackage> useBundlePkgs = new HashMap<ImportedPackage,ExportedPackage>();
    for (Iterator<ImportedPackage> iter = externalReqs.iterator(); iter.hasNext(); )
    {
      ImportedPackage req = iter.next();
      ExportedPackage match = getPackageMatch(req, deployedUseBundle);
      if (match != null)
      {
        useBundlePkgs.put(req, match);
        iter.remove();
      }
View Full Code Here

Examples of org.apache.aries.application.modelling.ExportedPackage

   
    // Filter out requirements satisfied by internal capabilities.
    Collection<ImportedPackage> result = new ArrayList<ImportedPackage>();
    for (ImportedPackage req : requirements)
    {
      ExportedPackage match = getPackageMatch(req, deployedContent);
      //If we didn't find a match then it must come from outside
      if (match == null)
      {
        result.add(req);
      }
View Full Code Here

Examples of org.osgi.service.packageadmin.ExportedPackage

        t1 = System.currentTimeMillis();

        Color colA = Util.rgbInterpolate(baseColor, burnColor, (double)depth/3);
        Collection pkgs = pm.getExportedPackages(b);
        for(Iterator it = pkgs.iterator(); it.hasNext(); ) {
          ExportedPackage pkg = (ExportedPackage)it.next();
          Color col = colA;
          if(pkg.isRemovalPending()) {
            col = Util.rgbInterpolate(colA, Color.black, .5);
          }
          Bundle[] bl = pkg.getImportingBundles();
          String sId = pkg.getName() +";" + pkg.getVersion();

          if(bl == null || bl.length == 0) {
            StringBuffer lId = new StringBuffer();
            lId.append(getId());
            lId.append("/");
View Full Code Here

Examples of org.osgi.service.packageadmin.ExportedPackage

        Color colA = Util.rgbInterpolate(baseColor, burnColor, (double)depth/5);

        colA = Util.rgbInterpolate(colA, Color.black, .3);
        for(Iterator it = importedPkgs.iterator(); it.hasNext(); ) {
          ExportedPackage pkg = (ExportedPackage)it.next();
          Color col = colA;
          if(pkg.isRemovalPending()) {
            col = Util.rgbInterpolate(col, Color.black, .5);
          }
          Bundle fromB = pkg.getExportingBundle();
          String sId = pkg.getName() +";" + pkg.getVersion();

          StringBuffer lId = new StringBuffer();
          lId.append(getId());
          lId.append("/");
          lId.append("in.");
View Full Code Here

Examples of org.osgi.service.packageadmin.ExportedPackage

        Collection okSet  = getImportedPackages(b);

        // Remove wired imports
        for(Iterator it = okSet.iterator(); it.hasNext(); ) {
          final ExportedPackage pkg = (ExportedPackage) it.next();
          missing.remove(pkg.getName());
        }

        // Remove imports of packages exported by the bundle (self
        // imports from the current classloader will not have any
        // wires)
        okSet = getExportedPackages(b);
        for(Iterator it = okSet.iterator(); it.hasNext(); ) {
          final ExportedPackage pkg = (ExportedPackage) it.next();
          missing.remove(pkg.getName());
        }

        missingImports.put(b, missing);
      }
View Full Code Here

Examples of org.osgi.service.packageadmin.ExportedPackage

  public boolean isWired(final String pkgName, final Bundle b)
  {
    final Collection pkgs = getImportedPackages(b);
    for (Iterator it = pkgs.iterator(); it.hasNext(); ) {
      final ExportedPackage epkg = (ExportedPackage) it.next();
      if (pkgName.equals(epkg.getName())) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

Examples of org.osgi.service.packageadmin.ExportedPackage

  static class ExportedPackageComparator implements Comparator
  {
    public int compare(Object o1, Object o2)
    {
      ExportedPackage ep1 = (ExportedPackage) o1;
      ExportedPackage ep2 = (ExportedPackage) o2;

      // First package name
      int res = ep1.getName().compareTo(ep2.getName());
      if (0!=res) return res;

      // Then package version
      res = ep1.getVersion().compareTo(ep2.getVersion());
      if (0!=res) return res;

      // Then pending removal
      if (ep1.isRemovalPending() && !ep2.isRemovalPending()) return -1;
      if (!ep1.isRemovalPending() && ep2.isRemovalPending()) return 1;

      // Then number of importing bundles
      res = ep2.getImportingBundles().length - ep1.getImportingBundles().length;
      if (0!=res) return res;

      // Finally object identity (hashCode is the closest approximation)
      res = ep2.hashCode() - ep1.hashCode();
      return res;
    }
View Full Code Here

Examples of org.osgi.service.packageadmin.ExportedPackage

      }
      if(pkgs.size() > 0) {
        sb.append("<b>Exported packages</b>");
        List exportDescr  = new ArrayList();
        for (Iterator it = pkgs.iterator(); it.hasNext(); ) {
          ExportedPackage pkg = (ExportedPackage)it.next();
          StringBuffer   sb1  = new StringBuffer();

          sb1.append(formatPackage(pkg, false));

          if (!pkg.isRemovalPending() && !pm.isWired(pkg.getName(), b)) {
            // An exporting bundle that imports a package from itself
            // will not have a wire for that package and thus not be
            // present amongs the bundles returned by
            // pkg.getImportingBundles().  There is one exception to
            // this: When removal pending is set in an pkg, that pkg
            // is from an older generation of the bundle and there
            // must be a wire from the bundle to the old pkg and thus
            // the bundle will be present in the list returned by
            // pkg.getImportingBundles().
            sb1.append("<br>");
            sb1.append("&nbsp;&nbsp;");
            Util.bundleLink(sb1, b);
          }

          Bundle[] bl = pkg.getImportingBundles();
          for(int j = 0; bl != null && j < bl.length; j++) {
            sb1.append("<br>");
            sb1.append("&nbsp;&nbsp;");
            Util.bundleLink(sb1, bl[j]);
          }
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.