Package org.osgi.framework.startlevel

Examples of org.osgi.framework.startlevel.FrameworkStartLevel


        framework = factory.newFramework(new StringMap(config.props, false));
        framework.init();
        framework.getBundleContext().addFrameworkListener(lockCallback);
        framework.start();

        FrameworkStartLevel sl = framework.adapt(FrameworkStartLevel.class);
        sl.setInitialBundleStartLevel(config.defaultBundleStartlevel);

        // If we have a clean state, install everything
        if (framework.getBundleContext().getBundles().length == 1) {

            LOG.info("Installing and starting initial bundles");
View Full Code Here


       
        bundle.start();      
       
        Thread.sleep(2000);
       
        FrameworkStartLevel sl = framework.adapt(FrameworkStartLevel.class);
       
        MockLock lock = (MockLock) main.getLock();

        Assert.assertEquals(100, sl.getStartLevel());      

        // simulate losing a lock
        lock.setIsAlive(false);
        lock.setLock(false);
       
        // lets wait until the start level change is complete
        lock.waitForLock();
        Assert.assertEquals(1, sl.getStartLevel());

        Thread.sleep(1000);
       
        // get lock back
        lock.setIsAlive(true);
View Full Code Here

        }

        determineBundleLevelThreshold();
       
        // Display active start level.
        FrameworkStartLevel fsl = getBundleContext().getBundle(0).adapt(FrameworkStartLevel.class);
        if (fsl != null) {
            System.out.println("START LEVEL " + fsl.getStartLevel() + " , List Threshold: " + bundleLevelThreshold);
        }

        ShellTable table = new ShellTable();
        table.column("ID").alignRight();
        table.column("State");
View Full Code Here

        framework = factory.newFramework(new StringMap(config.props, false));
        framework.init();
        framework.getBundleContext().addFrameworkListener(lockCallback);
        framework.start();

        FrameworkStartLevel sl = framework.adapt(FrameworkStartLevel.class);
        sl.setInitialBundleStartLevel(config.defaultBundleStartlevel);

        // If we have a clean state, install everything
        if (framework.getBundleContext().getBundles().length == 1) {

            LOG.info("Installing and starting initial bundles");
View Full Code Here

        // Check if we want to convert URLs to maven style
        boolean convertToMavenUrls = Boolean.parseBoolean(configProps.getProperty(PROPERTY_CONVERT_TO_MAVEN_URL, "true"));

        // Retrieve the Start Level service, since it will be needed
        // to set the start level of the installed bundles.
        FrameworkStartLevel sl = framework.adapt(FrameworkStartLevel.class);

        // Set the default bundle start level
        int ibsl = 60;
        try {
            String str = configProps.getProperty("karaf.startlevel.bundle");
View Full Code Here

            lock.release();
        }
    }

    protected void setStartLevel(int level, long timeout) throws Exception {
        FrameworkStartLevel fsl = framework.adapt(FrameworkStartLevel.class);
        int current = fsl.getStartLevel();
        if (current < level) {
            for (int l = current + 1; l <= level; l++) {
                doSetStartLevel(fsl, l, 0);
            }
        } else if (current > level) {
View Full Code Here

        properties.save();
    }

    public void setStartLevel(int startLevel) {
        Bundle b = getBundleContext().getBundle(0);
        FrameworkStartLevel fsl = (FrameworkStartLevel) b.adapt(FrameworkStartLevel.class);
        fsl.setStartLevel(startLevel, null);
    }
View Full Code Here

        fsl.setStartLevel(startLevel, null);
    }

    public int getStartLevel() {
        Bundle b = getBundleContext().getBundle(0);
        FrameworkStartLevel fsl = (FrameworkStartLevel) b.adapt(FrameworkStartLevel.class);
        return fsl.getStartLevel();
    }
View Full Code Here

        properties.save();
    }

    public void setStartLevel(int startLevel) {
        Bundle b = getBundleContext().getBundle(0);
        FrameworkStartLevel fsl = (FrameworkStartLevel) b.adapt(FrameworkStartLevel.class);
        fsl.setStartLevel(startLevel, null);
    }
View Full Code Here

        fsl.setStartLevel(startLevel, null);
    }

    public int getStartLevel() {
        Bundle b = getBundleContext().getBundle(0);
        FrameworkStartLevel fsl = (FrameworkStartLevel) b.adapt(FrameworkStartLevel.class);
        return fsl.getStartLevel();
    }
View Full Code Here

TOP

Related Classes of org.osgi.framework.startlevel.FrameworkStartLevel

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.