Package org.osgi.util.tracker

Examples of org.osgi.util.tracker.BundleTracker


public class Activator implements BundleActivator, BundleTrackerCustomizer {
  BundleTracker bt;
  ServiceRegistration testListenerRegistration = null;

  public void start(final BundleContext bc) throws Exception {
    bt = new BundleTracker(bc, Bundle.ACTIVE, this);
    bt.open();

    TestListener tl = new TestListener() {
      public void addError(Test test, Throwable t) {
      }
View Full Code Here


            AdapterFactory factory,
            AdapterImplementations adapterImplementations) {
        this.bundleContext = bundleContext;
        this.factory = factory;
        this.adapterImplementations = adapterImplementations;
        this.bundleTracker = new BundleTracker(bundleContext, Bundle.ACTIVE, this);
        this.bundleTracker.open();
    }
View Full Code Here

        for (Bundle bundle : context.getBundles())
            registerBundleMailcapEntries(bundle);

        CommandMap.setDefaultCommandMap(commandMap);

        bundleTracker = new BundleTracker(context, Bundle.ACTIVE | Bundle.UNINSTALLED | Bundle.STOP_TRANSIENT,
                new BundleTrackerCustomizer() {

                    public void removedBundle(Bundle bundle, BundleEvent event, Object object) {
                        unregisterBundleMailcapEntries(bundle);
                    }
View Full Code Here

        this.configServiceReg = this.context.registerService(ManagedService.class.getName(), new JettyManagedService(this), props);

        this.eventAdmintTracker = new ServiceTracker(this.context, EventAdmin.class.getName(), this);
        this.eventAdmintTracker.open();

        this.bundleTracker = new BundleTracker(this.context, Bundle.ACTIVE | Bundle.STARTING, this);
        this.bundleTracker.open();
    }
View Full Code Here

    }

    public void start(BundleContext context) throws Exception {
        this.context = context;
        this.context.addBundleListener(this);
        this.tracker = new BundleTracker(this.context, Bundle.ACTIVE | Bundle.STARTING, this);
        if (!this.synchronous) {
            this.executors = createExecutor();
        }
        doStart();
    }
View Full Code Here

   
    String bundleId = cb.getSymbolicName()+"/"+cb.getVersion();
    if (alreadyRecursedContexts.putIfAbsent(bundleId, bundleId) == null) {

      // let's track each of the bundle in the CompositeBundle
      BundleTracker bt = new InternalRecursiveBundleTracker(compositeBundleContext, stateMask,
          customizer, true);
      bt.open();
      BundleTrackerFactory.registerBundleTracker(bundleScope, bt);
    }
  }
View Full Code Here

    public RecursiveBundleTracker(BundleContext context, int stateMask, BundleTrackerCustomizer customizer) {
        //This test only makes sense for composite bundles, but in the interests of more consistent behavior lets leave it.
        // We always need INSTALLED events so we can recursively listen to the frameworks
        if ((stateMask & COMPOSITE_BUNDLE_MASK) != COMPOSITE_BUNDLE_MASK)
            throw new IllegalArgumentException();
        BundleTracker tracker = null;
        try {
            //R43, equinox composite bundles seem to produce appropriate bundle event hook notifications
            tracker = new BundleHookBundleTracker(context, stateMask, customizer);
        } catch (Throwable e) {
        }
        if (areMultipleFrameworksAvailable(context)) {
            compositeTracker = new InternalRecursiveBundleTracker(context, stateMask, customizer, tracker == null);
        } else {
            compositeTracker = null;
        }
        if (tracker == null && compositeTracker == null) {
            //R42
            tracker = new BundleTracker(context, stateMask, customizer);
        }
        this.tracker = tracker;
    }
View Full Code Here

            throw new IllegalArgumentException();
       
        if (areMultipleFrameworksAvailable(context)) {
          tracker = new InternalBundleTracker(context, stateMask);
        } else {
          tracker = new BundleTracker(context, stateMask, this);
        }
    }
View Full Code Here

         CompositeBundle cb = (CompositeBundle) b;
         BundleContext compositeBundleContext = cb
                 .getCompositeFramework().getBundleContext();
   
         // let's track each of the bundle in the CompositeBundle
         BundleTracker bt = new BundleTracker(compositeBundleContext, stateMask, btc);
         bt.open();
         BundleTrackerFactory.registerBundleTracker(bundleScope, bt);
     }
View Full Code Here

    private BundleTracker tracker;

    //private JdbcLeakPreventionListener jdbcPreventionListener;

    public void start(BundleContext context) throws Exception {
        tracker = new BundleTracker(context, Bundle.ACTIVE, new DriverBundleTrackerCustomizer());
        tracker.open();

        //jdbcPreventionListener = new JdbcLeakPreventionListener();
        //context.addBundleListener(jdbcPreventionListener);
    }
View Full Code Here

TOP

Related Classes of org.osgi.util.tracker.BundleTracker

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.