Examples of BundleTracker


Examples of org.osgi.util.tracker.BundleTracker

        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

Examples of org.osgi.util.tracker.BundleTracker

        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

Examples of org.osgi.util.tracker.BundleTracker

    }

    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

Examples of org.osgi.util.tracker.BundleTracker

   
    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

Examples of org.osgi.util.tracker.BundleTracker

    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

Examples of org.osgi.util.tracker.BundleTracker

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

Examples of org.osgi.util.tracker.BundleTracker

         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

Examples of org.osgi.util.tracker.BundleTracker

    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

Examples of org.osgi.util.tracker.BundleTracker

        registry = new ConfigRegistryImpl(this);
        // register this as a service
        registryRegistration = context.registerService(ConfigRegistry.class.getName(), registry, null);

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

Examples of org.osgi.util.tracker.BundleTracker

    @Override
    public void start(BundleContext context) throws Exception {
        TldRegistryImpl tldRegistry = new TldRegistryImpl(context);
        tldRegistryRegistration = context.registerService(TldRegistry.class.getName(), tldRegistry, null);
       
        tldBundleTracker = new BundleTracker(context, Bundle.STARTING | Bundle.ACTIVE, tldRegistry)
        tldBundleTracker.open();
    }
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.