Package org.osgi.framework.launch

Examples of org.osgi.framework.launch.FrameworkFactory.newFramework()


        InputStream is = classLoader.getResourceAsStream("META-INF/services/" + FrameworkFactory.class.getName());
        BufferedReader br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
        String factoryClass = br.readLine();
        br.close();
        FrameworkFactory factory = (FrameworkFactory) classLoader.loadClass(factoryClass).newInstance();
        framework = factory.newFramework(new StringMap(configProps, false));
        framework.start();
        processAutoProperties(framework.getBundleContext());
        // Start lock monitor
        new Thread() {
            public void run() {
View Full Code Here


    private void startOSGIFramework() throws BundleException {
        Iterator<FrameworkFactory> iter = ServiceLoader.load(FrameworkFactory.class, loader).iterator();
        if (iter.hasNext()) {
            FrameworkFactory frameworkFactory = iter.next();
            Map<String, String> config = new HashMap<String, String>();
            osgiFramework = frameworkFactory.newFramework(config);
            osgiFramework.start();
        } else {
            getLog().warn("OSGI framework not found");
        }
    }
View Full Code Here

    private void startOSGIFramework() throws BundleException {
        Iterator<FrameworkFactory> iter = ServiceLoader.load(FrameworkFactory.class).iterator();
        if (iter.hasNext()) {
            FrameworkFactory frameworkFactory = iter.next();
            Map<String, String> config = new HashMap<String, String>();
            osgiFramework = frameworkFactory.newFramework(config);
            osgiFramework.start();
            scanBundleDir();
        } else {
            warn("OSGI framework not found");
        }
View Full Code Here

    protected Framework createFramework(T conf) {
        FrameworkFactory factory = conf.getFrameworkFactory();
        if (factory == null)
            throw new IllegalStateException("Cannot obtain " + FrameworkFactory.class.getName());
        Map<String, String> config = conf.getFrameworkConfiguration();
        return factory.newFramework(config);
    }

    protected Framework getFramework() {
        return framework;
    }
View Full Code Here

    }

    protected Framework createFramework(T conf) {
        FrameworkFactory factory = conf.getFrameworkFactory();
        Map<String, String> config = conf.getFrameworkConfiguration();
        return factory.newFramework(config);
    }

    @Override
    public void start() throws LifecycleException {
        try {
View Full Code Here

        InputStream is = getClass().getResourceAsStream("/META-INF/services/" + FrameworkFactory.class.getName());
        BufferedReader br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
        String factoryClass = br.readLine();
        br.close();
        FrameworkFactory factory = (FrameworkFactory) getClass().getClassLoader().loadClass(factoryClass).newInstance();
        framework = factory.newFramework(new StringMap(configProps, false));
        framework.start();
        processAutoProperties(framework.getBundleContext());
        // Start lock monitor
        new Thread() {
            public void run() {
View Full Code Here

        for (Object key : config.keySet()) {
            System.setProperty((String) key, config.get(key).toString());
        }

        FrameworkFactory factory = conf.getFrameworkFactory();
        return factory.newFramework(config);
    }

    @Override
    protected BundleContext startFramework() throws BundleException {
        BundleContext bundleContext = super.startFramework();
View Full Code Here

    protected Framework createFramework(T conf) {
        FrameworkFactory factory = conf.getFrameworkFactory();
        if (factory == null)
            throw new IllegalStateException("Cannot obtain " + FrameworkFactory.class.getName());
        Map<String, String> config = conf.getFrameworkConfiguration();
        return factory.newFramework(config);
    }

    protected Framework getFramework() {
        return framework;
    }
View Full Code Here

        Map<Object, Object> props = new HashMap<Object, Object>();
        props.put("osgi.clean", "true");
        props.put("osgi.instance.area", new File("target/workspace").toURI().toString());
        props.put("osgi.install.area", new File("target/eclipse").toURI().toString());
        props.put("osgi.configuration.area", new File("target/eclipse").toURI().toString());
        framework = factory.newFramework(props);
        framework.start();
        return framework.getBundleContext();
    }

    public BundleContext start() {
View Full Code Here

        Map<String, String> props = new HashMap<String, String>();
        props.put("osgi.clean", "true");
        props.put("osgi.dev", "target/classes");

        FrameworkFactory frameworkFactory = FrameworkFactoryFinder.loadSingleFrameworkFactory();
        Framework framework = frameworkFactory.newFramework(props);
        framework.start();
        BundleContext bc = framework.getBundleContext();
        assertNotNull(bc);

        String reference = "reference:file:" + PathUtils.getBaseDir()
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.