Examples of RequiredBundle


Examples of bndtools.model.importanalysis.RequiredBundle

                        break;
                    }
                }
            }

            RequiredBundle rb = new RequiredBundle(name, rbAttribs, satisfied);
            List<RequiredBundle> rbList = requiredBundles.get(name);
            if (rbList == null) {
                rbList = new LinkedList<RequiredBundle>();
                requiredBundles.put(name, rbList);
            }
View Full Code Here

Examples of bndtools.model.importanalysis.RequiredBundle

                        break;
                    }
                }
            }

            RequiredBundle rb = new RequiredBundle(name, rbAttribs, satisfied);
            List<RequiredBundle> rbList = requiredBundles.get(name);
            if (rbList == null) {
                rbList = new LinkedList<RequiredBundle>();
                requiredBundles.put(name, rbList);
            }
View Full Code Here

Examples of org.apache.felix.sigil.common.core.internal.model.osgi.RequiredBundle

        assertTrue(Arrays.asList(element.children()).contains(baz));
    }

    private void checkRequires(BundleModelElement element)
    {
        RequiredBundle foo = new RequiredBundle();
        foo.setSymbolicName("foo");
        foo.setVersions(VersionRange.parseVersionRange("1.0.0"));
        RequiredBundle bar = new RequiredBundle();
        bar.setSymbolicName("bar");
        bar.setVersions(VersionRange.parseVersionRange("[2.2.2, 3.3.3]"));
        RequiredBundle baz = new RequiredBundle();
        baz.setSymbolicName("baz");
        baz.setVersions(VersionRange.parseVersionRange("[3.0.0, 4.0.0)"));

        element.addChild(foo.clone());
        element.addChild(bar.clone());
        element.addChild(baz.clone());

        assertTrue(Arrays.asList(element.children()).contains(foo));
        assertTrue(Arrays.asList(element.children()).contains(bar));
        assertTrue(Arrays.asList(element.children()).contains(baz));
    }
View Full Code Here

Examples of org.apache.felix.sigil.common.core.internal.model.osgi.RequiredBundle

                Map<String, String> attr = requires.get(name);
                String versions = attr.containsKey(BldAttr.VERSION_ATTRIBUTE) ? attr.get(BldAttr.VERSION_ATTRIBUTE)
                    : bundleDefaults.getProperty(name);
                String resolution = attr.get(BldAttr.RESOLUTION_ATTRIBUTE);

                RequiredBundle rb = new RequiredBundle();
                rb.setSymbolicName(name);
                rb.setVersions(VersionRange.parseVersionRange(versions));

                if (BldAttr.RESOLUTION_OPTIONAL.equals(resolution))
                {
                    rb.setOptional(true);
                }
                else if (resolution != null)
                {
                    throw new IOException("Bad attribute value: "
                        + BldAttr.RESOLUTION_ATTRIBUTE + "=" + resolution);
View Full Code Here

Examples of org.apache.felix.sigil.common.core.internal.model.osgi.RequiredBundle

                for (String name : fragments.keySet())
                {
                    Map<String, String> attr = fragments.get(name);
                    String versions = attr.isEmpty() ? null
                        : attr.get(BldAttr.VERSION_ATTRIBUTE);
                    fragment = new RequiredBundle();
                    fragment.setSymbolicName(name);
                    fragment.setVersions(VersionRange.parseVersionRange(versions));
                    break;
                }
            }
View Full Code Here

Examples of org.osgi.service.packageadmin.RequiredBundle

   */
  public boolean isBundleRequiredBy(final RequiredBundle[] rbl,
                                    final Bundle requiredBundle,
                                    final Bundle requiringBundle)
  {
    final RequiredBundle rb = getRequiredBundle(rbl, requiredBundle);

    final Bundle[] requiringBundles
      = rb!=null ? rb.getRequiringBundles() : null;
    for (int j=0; requiringBundles!=null && j<requiringBundles.length;j++){
      if (requiringBundles[j].getBundleId()==requiringBundle.getBundleId()){
        return true;
      }
    }
View Full Code Here

Examples of org.osgi.service.packageadmin.RequiredBundle

   * @return The RequiredBundle object for the given bundle or
   *         <tt>null</tt> if the bundle is not required.
   */
  public RequiredBundle getRequiredBundle(final RequiredBundle[] rbl,
                                          final Bundle b)  {
    final RequiredBundle rb = (RequiredBundle) requiredBundleMap.get(b);
    if(rb != null) {
      return rb;
    }
    for (int i=0; rbl!=null && i<rbl.length; i++) {
      final Bundle rbb = rbl[i].getBundle();
View Full Code Here

Examples of org.osgi.service.packageadmin.RequiredBundle

                sb.append("</p>");
              }
              useParagraph = true;
            }

            RequiredBundle rb = pm.getRequiredBundle(rbl, b);
            Bundle[] requiringBundles = rb!=null
              ? rb.getRequiringBundles() : null;
            if (requiringBundles!=null && requiringBundles.length>0) {
              if (useParagraph) {
                sb.append("<p>");
              }
              sb.append("<b>Required by</b>");
              if (rb.isRemovalPending()) {
                sb.append(" (<i>pending removal on refresh</i>)");
              }
              for (int j=0; requiringBundles!=null && j<requiringBundles.length;
                   j++) {
                sb.append("<br>");
View Full Code Here

Examples of org.osgi.service.packageadmin.RequiredBundle

    }
    /* (non-Javadoc)
     * @see org.apache.felix.jmood.core.ManagedBundleMBean#isRemovalPending()
     */
    public boolean isRemovalPending() throws ServiceNotAvailableException{
      RequiredBundle r=InstrumentationSupport.getRequiredBundle(bundle, ac);
      if(r==null) return false;
        return r.isRemovalPending();
    }
View Full Code Here

Examples of org.osgi.service.packageadmin.RequiredBundle

    public static Bundle[] getRequiringBundles(Bundle bundle, AgentContext ac) throws ServiceNotAvailableException{
        if (bundle==null) throw new IllegalArgumentException("Bundle argument should not be null");
        if (bundle.getSymbolicName()==null) return null;
        RequiredBundle[] required=ac.getPackageadmin().getRequiredBundles(bundle.getSymbolicName());
        if (required==null) return null;
            RequiredBundle b=null;
            for (int i=0;i<required.length;i++) {
                if(bundle.getBundleId()==required[i].getBundle().getBundleId()) {
                    b=required[i];
                    break;
                }
            }
            if(b==null) {
                ac.error(InstrumentationSupport.class.getName()+": required bundle should not be null!!!!", new Exception());
                return null;
            }
            return b.getRequiringBundles();
    }
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.