Examples of Bundle


Examples of org.osgi.framework.Bundle

    switch(col) {
    case COL_ID:
      return new Long(e.getId());
    case COL_BID:
      final Bundle b = e.getBundle();
      return null!=b ? (Object) new Long(b.getBundleId()) : (Object)"";
    case COL_LEVEL:
      return Util.levelString(e.getLevel());
    case COL_TIME:
      return new Date(e.getTime());
    case COL_MESSAGE:
View Full Code Here

Examples of org.osgi.framework.Bundle

  public void run() {
    Thread currentThread = Thread.currentThread();
    try {
      while (currentThread == thread) {
        try {
          Bundle bundle = context.installBundle(TEST_BUNDLE_LOCATION);
          Thread.sleep(100);
          bundle.start();
          Thread.sleep(100);
          bundle.stop();
          Thread.sleep(100);
          bundle.uninstall();
          Thread.sleep(100);
        } catch (InterruptedException ignore) { }
      }
    } catch (BundleException be) {
      be.printStackTrace(System.err);
View Full Code Here

Examples of org.osgi.framework.Bundle

        startService(LOG_FILTER);

        start();

        bc.addFrameworkListener(this);
        Bundle b = bc.getBundle(0);
        if (b.getState() == Bundle.ACTIVE)
            activate();
        else
            info("Passive start");
    }
View Full Code Here

Examples of org.osgi.framework.Bundle

            }

            if (ref == null) {
                info("attached " + showDriver(best.getDriver()) + " -> "
                        + showDevice(dev));
                Bundle b = best.getBundle();
                if (b != null)
                    updateLife(b, LONG_LIFE);
                return;
            }
View Full Code Here

Examples of org.osgi.framework.Bundle

    private boolean isUsed(ServiceReference sr) {
        Bundle[] ba = sr.getUsingBundles();
        if (ba != null) {
            for (int i = 0; i < ba.length; i++) {
                Bundle b = ba[i];
                try {
                    for (int j = 0; j < drivers.size(); j++) {
                        DriverRef dr = (DriverRef) drivers.elementAt(j);
                        if (dr.sr.getBundle() == b)
                            return true;
View Full Code Here

Examples of org.osgi.framework.Bundle

        long now = System.currentTimeMillis();
        Bundle[] ba = bc.getBundles();
        if (ba != null) {
            for (int i = 0; i < ba.length; i++) {
                try {
                    Bundle b = ba[i];
                    if (b.getLocation().startsWith(DYNAMIC_DRIVER_TAG)) {
                        Long expire = (Long) tempDrivers.get(b);
                        boolean inUse = false;

                        ServiceReference[] sra = b.getServicesInUse();
                        if (sra != null) {
                            for (int j = 0; j < sra.length; j++) {
                                if (isDevice.match(sra[j])) {
                                    inUse = true;
                                    break;
                                }
                            }
                        }

                        if (inUse) {
                            updateLife(b, LONG_LIFE);
                        } else if (expire == null) {
                            updateLife(b, SHORT_LIFE);
                        } else if (expire.longValue() < now) {
                            info("uninstalling " + b.getLocation());
                            b.uninstall();
                        }
                    }
                } catch (Exception e) {
                }
            }
View Full Code Here

Examples of org.osgi.framework.Bundle

        }
        return props;
    }

    Bundle installBundle(String name, InputStream is) {
        Bundle b = null;
        try {
            info("installing " + name);
            b = bc.installBundle(name, is);
            b.start();
            updateLife(b, SHORT_LIFE);
            return b;
        } catch (Exception e) {
            error("failed to install " + name);
            try {
                b.uninstall();
            } catch (Exception e1) {
            }
            return null;
        } finally {
            try {
View Full Code Here

Examples of org.osgi.framework.Bundle

            }
        }
        o = sr.getProperty(org.osgi.framework.Constants.SERVICE_ID);
        if (o != null)
            sb.append(o);
        Bundle b = sr.getBundle();
        if (b != null) {
            sb.append('/');
            sb.append(b.getBundleId());
        }
        return sb.toString();
    }
View Full Code Here

Examples of org.osgi.framework.Bundle

    private String showDriver(ServiceReference sr) {
        StringBuffer sb = new StringBuffer();
        String s = (String) sr
                .getProperty(org.osgi.service.device.Constants.DRIVER_ID);
        sb.append(s != null ? s : "driver");
        Bundle b = sr.getBundle();
        if (b != null) {
            sb.append('/');
            sb.append(b.getBundleId());
        }
        return sb.toString();
    }
View Full Code Here

Examples of org.osgi.framework.Bundle

            }
          }
        }

        if(bFragments) {
          Bundle bl[] = pm.getHosts(b) ;
          Color col = Util.rgbInterpolate(baseFragmentColor, burnFragmentColor, (double)depth/3);
          for(int i = 0; i < bl.length; i++) {
            String sId = "fragment:" + b.getBundleId() + ":" + bl[i].getBundleId();
            String lId =
              getId() + "/" +
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.