Examples of BundleTracker


Examples of org.osgi.util.tracker.BundleTracker

        DiscoveryRegistry registry = new DiscoveryRegistry();
        SystemInstance.get().setComponent(DiscoveryRegistry.class, registry);
       
        started = Boolean.FALSE;
        ServerServiceTracker t = new ServerServiceTracker();
        tracker = new BundleTracker(bundleContext, Bundle.ACTIVE | Bundle.STOPPING, t);
        tracker.open();      
    }
View Full Code Here

Examples of org.osgi.util.tracker.BundleTracker

    {
        this.ctx = ctx;
        ServiceReference ref = ctx.getServiceReference(PackageAdmin.class.getName());
        pkgAdm = PackageAdmin.class.cast(ctx.getService(ref));

        BundleTracker bt = new BundleTracker(ctx, Bundle.INSTALLED | Bundle.RESOLVED | Bundle.STARTING | Bundle.ACTIVE, new BundleTrackerCustomizer() {
           
            @Override
            public void modifiedBundle(Bundle bundle, BundleEvent bundleEvent, Object o) {
            }

            @Override
            public Object addingBundle(Bundle bundle, BundleEvent bundleEvent) {
                String key = makeKey(bundle);
                name2Id.put(key, bundle.getBundleId());
                if (logger != null && logger.isLoggable(Level.FINER)) {
                    logger.log(Level.FINER, "BundleTracker.addingBundle BUNDLE " + key + " ==> " + bundle.getBundleId() + "  for " + bundle.getSymbolicName());
                }
                return null;
            }

            @Override
            public void removedBundle(Bundle bundle, BundleEvent bundleEvent, Object o) {
                String key = makeKey(bundle);
                Long bundleID = name2Id.remove(key);
                if (logger.isLoggable(Level.FINER)) {
                    logger.log(Level.FINER, "BundleTracker.removedBundle BUNDLE " + key + "  ==> " + bundle.getSymbolicName());
                }
                if (bundleID == null) {
                    logger.log(Level.WARNING, NULL_BUNDLE, key);
                }
            }
            /*
            @Override
            public Object addingBundle(Bundle bundle, BundleEvent event) {
                System.out.println("ADDING BUNDLE ==> " + bundle.getSymbolicName());
                return super.addingBundle(bundle, event);    //To change body of overridden methods use File | Settings | File Templates.
            }

            @Override
            public void removedBundle(Bundle bundle, BundleEvent event, Object object) {
                System.out.println("REMOVING BUNDLE ==> " + bundle.getSymbolicName());               
                super.removedBundle(bundle, event, object);    //To change body of overridden methods use File | Settings | File Templates.
            }
            */
        });

        bt.open();

    }
View Full Code Here

Examples of org.osgi.util.tracker.BundleTracker

        SystemInstance.get().setComponent(DiscoveryRegistry.class, registry);

        started = Boolean.FALSE;
        stopped = false;
        final ServerServiceTracker t = new ServerServiceTracker();
        tracker = new BundleTracker(bundleContext, Bundle.ACTIVE | Bundle.STOPPING, t);
        tracker.open();
    }
View Full Code Here

Examples of org.osgi.util.tracker.BundleTracker

        stopped = false;
        executor = Executors.newFixedThreadPool(3);
        contextPathMap = Collections.synchronizedMap(new HashMap<String, WebApplications>())
        eventDispatcher = new WebContainerEventDispatcher(context);
        bt = new BundleTracker(context, Bundle.STARTING | Bundle.ACTIVE, new WebBundleTrackerCustomizer());
        bt.open();
       
        LOGGER.debug("Web container extender started");
    }
View Full Code Here

Examples of org.osgi.util.tracker.BundleTracker

    private static final Logger LOG = LoggerFactory.getLogger(DatabaseDriverExtender.class);
   
    private BundleTracker tracker;
   
    public void start(BundleContext context) throws Exception {
        tracker = new BundleTracker(context, Bundle.ACTIVE, new DriverBundleTrackerCustomizer());
        tracker.open();
    }
View Full Code Here

Examples of org.osgi.util.tracker.BundleTracker

        eventDispatcher = new BlueprintEventDispatcher(context, executors);
        containers = new HashMap<Bundle, BlueprintContainerImpl>();

        ServiceReference sr = this.context.getServiceReference("org.osgi.service.framework.CompositeBundleFactory");
        if (sr == null) {
            bt = new BundleTracker(context, Bundle.STARTING | Bundle.ACTIVE | Bundle.STOPPING, new BlueprintBundleTrackerCustomizer());
        } else {
            // composite bundle factory service is active, let's track blueprint bundles installed in the child frameworks too.
            bt = new BundleTracker(context, Bundle.STARTING | Bundle.ACTIVE | Bundle.STOPPING, new BlueprintMutilBundleTrackerCustomizer());  
        }
        bt.open();

        // Create and publish a ParserService
        parserServiceReg = context.registerService(ParserService.class.getName(),
View Full Code Here

Examples of org.osgi.util.tracker.BundleTracker

        eventDispatcher = new BlueprintEventDispatcher(context, executors);
        containers = new HashMap<Bundle, BlueprintContainerImpl>();

        ServiceReference sr = this.context.getServiceReference("org.osgi.service.framework.CompositeBundleFactory");
        if (sr == null) {
            bt = new BundleTracker(context, Bundle.STARTING | Bundle.ACTIVE | Bundle.STOPPING, new BlueprintBundleTrackerCustomizer());
        } else {
            // composite bundle factory service is active, let's track blueprint bundles installed in the child frameworks too.
            bt = new BundleTracker(context, Bundle.STARTING | Bundle.ACTIVE | Bundle.STOPPING, new BlueprintMutilBundleTrackerCustomizer());  
        }
        bt.open();

        // Create and publish a ParserService
        parserServiceReg = context.registerService(ParserService.class.getName(),
View Full Code Here

Examples of org.osgi.util.tracker.BundleTracker

    private BundleTracker tracker;

    public void start(BundleContext context) throws Exception {
        OSGiOMMetaFactoryLocator locator = new OSGiOMMetaFactoryLocator(context);
        OMAbstractFactory.setMetaFactoryLocator(locator);
        tracker = new BundleTracker(context, Bundle.ACTIVE, locator);
        tracker.open();
    }
View Full Code Here

Examples of org.osgi.util.tracker.BundleTracker

        Server defaultServer = DefaultJettyAtJettyHomeHelper.startJettyAtJettyHome(context);

        //Create a bundle tracker to help deploy webapps and ContextHandlers
        BundleWatcher bundleTrackerCustomizer = new BundleWatcher();
        bundleTrackerCustomizer.setWaitForDefaultServer(defaultServer != null);
        _webBundleTracker =  new BundleTracker(context, Bundle.ACTIVE | Bundle.STOPPING, bundleTrackerCustomizer);
        bundleTrackerCustomizer.setBundleTracker(_webBundleTracker);
        bundleTrackerCustomizer.open();
    }
View Full Code Here

Examples of org.osgi.util.tracker.BundleTracker

    // Track the main-thread executor and register the Eclipse ApplicationLauncher around it
    executorTracker = new MainThreadExecutorTracker(context);
    executorTracker.open();

    // Ensure that the Equinox Application Admin bundle is fully started
    bundleTracker = new BundleTracker(context, Bundle.INSTALLED | Bundle.RESOLVED | Bundle.STARTING, null) {
        @Override
        public Object addingBundle(Bundle bundle, BundleEvent event) {
            if("org.eclipse.equinox.app".equals(bundle.getSymbolicName())) {
                try {
                        bundle.start();
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.