Examples of Bundle


Examples of org.osgi.framework.Bundle

      Object val = buckets.get(key);
      if(val instanceof Collection) {
        Collection bucket = (Collection)val;
        JMenu subMenu = new JMenu(key.toString());
        for(Iterator it2 = bucket.iterator(); it2.hasNext(); ) {
          Bundle bundle = (Bundle)it2.next();
          JMenuItem item = makeSelectBundleItem(bundle);
          subMenu.add(item);
        }
        selectMenu.add(subMenu);
      } else if(val instanceof Bundle) {
        Bundle bundle = (Bundle)val;
        JMenuItem item = makeSelectBundleItem(bundle);
        selectMenu.add(item);
      } else {
        throw new RuntimeException("Unknown object=" + val);
      }
View Full Code Here

Examples of org.osgi.framework.Bundle

                        null,
                        options,
                        options[1]);
    if(n == 0) {
      try {
        Bundle sysBundle = Activator.getBC().getBundle((long)0);
        sysBundle.stop();
      } catch (Exception e) {
        showErr("Failed to stop bundle.", e);
      }
    }
  }
View Full Code Here

Examples of org.osgi.framework.Bundle

                                    null,
                                    null,
                                    lastBundleLocation);

      if(lastBundleLocation != null && !"".equals(lastBundleLocation)) {
        Bundle b = Activator.getTargetBC().installBundle(lastBundleLocation);
        Dictionary headers = b.getHeaders();
        if(Util.doAutostart() && Util.canBeStarted(b)) {
          startBundle(b);
        }
      }
    } catch (Exception e) {
View Full Code Here

Examples of org.osgi.framework.Bundle

      int levelMax = -1;

      int bid = 0;
      int lastLevel = -1;
      for(Iterator it = all.iterator(); it.hasNext(); ) {
        Bundle b   = (Bundle)it.next();
        String loc = b.getLocation();

        bid++;

        URL srcURL = new URL(loc);

        String name = Util.shortLocation(loc);

        ZipEntry entry = new ZipEntry(base + "/" + name);

        int level     = -1;

        try {
          level = sl.getBundleStartLevel(b);
        } catch (Exception ignored) {        }

        levelMax = Math.max(level, levelMax);

        if(level != -1 && level != lastLevel) {
          xargs.append("-initlevel " + level + "\n");
          lastLevel = level;
        }

        xargs.append("-install file:" + name + "\n");

        out.putNextEntry(entry);

        InputStream in = null;
        try {
          in = srcURL.openStream();
          int n = 0;
          while ((n = in.read(buf)) != -1) {
            out.write(buf, 0, n);
          }
        } finally {
          try {
            in.close();
          } catch (Exception ignored) { }
        }
      }

      bid = 0;
      for(Iterator it = all.iterator(); it.hasNext(); ) {
        Bundle b   = (Bundle)it.next();
        bid++;

        if(b.getState() == Bundle.ACTIVE) {
          xargs.append("-start " + bid + "\n");
        }
      }

      if(levelMax != -1) {
View Full Code Here

Examples of org.osgi.framework.Bundle

  public Bundle[] getSelectedBundles() {
    final ArrayList res = new ArrayList(bundleCache.length);

    for(int i = 0; i < bundleCache.length; i++) {
      final Bundle b = bundleCache[i];
      if(isSelected(b)) {
        res.add(b);
      }
    }
    return (Bundle[]) res.toArray(new Bundle[res.size()]);
View Full Code Here

Examples of org.osgi.framework.Bundle

    }.start();
  }

  void stopBundles(Bundle[] bl) {
    for(int i = 0; bl != null && i < bl.length; i++) {
      Bundle b = bl[i];
      stopBundle(b);
    }
  }
View Full Code Here

Examples of org.osgi.framework.Bundle

      stopBundle(b);
    }
  }
  void startBundles(Bundle[] bl) {
    for(int i = 0; bl != null && i < bl.length; i++) {
      Bundle b = bl[i];
      startBundle(b);
    }
  }
View Full Code Here

Examples of org.osgi.framework.Bundle

    }
  }

  void updateBundles(Bundle[] bl) {
    for(int i = 0; bl != null && i < bl.length; i++) {
      Bundle b = bl[i];
      updateBundle(b);
    }
  }
View Full Code Here

Examples of org.osgi.framework.Bundle

    }
  }

  void uninstallBundles(Bundle[] bl) {
    for(int i = 0; bl != null && i < bl.length; i++) {
      Bundle b = bl[i];
      uninstallBundle(b, true);
    }
  }
View Full Code Here

Examples of org.osgi.framework.Bundle


  void addFile(File file) {
    try {
      String location = "file:" + file.getAbsolutePath();
      Bundle b = Activator.getTargetBC().installBundle(location);

      if(Util.doAutostart() && Util.canBeStarted(b)) {
        startBundle(b);
      }
    } catch (Exception e) {
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.