Package org.osgi.framework.launch

Examples of org.osgi.framework.launch.FrameworkFactory


    }

    private void launchOSGiFramework() throws Exception {
        // Start up the OSGI framework
        ServiceLoader<FrameworkFactory> loader = ServiceLoader.load(FrameworkFactory.class);
        FrameworkFactory factory = loader.iterator().next();
        framework = factory.newFramework(new StringMap(configProps, false));

        framework.init();

        BundleContext bundleContext = framework.getBundleContext();
View Full Code Here


            InputStream is = classLoader.getResourceAsStream("META-INF/services/" + FrameworkFactory.class.getName());
            BufferedReader br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
            factoryClass = br.readLine();
            br.close();
        }
        FrameworkFactory factory = (FrameworkFactory) classLoader.loadClass(factoryClass).newInstance();
        framework = factory.newFramework(new StringMap(configProps, false));
        framework.init();
        // Process properties
        loadStartupProperties(configProps);
        processAutoProperties(framework.getBundleContext());
View Full Code Here

        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

        List<File> bundleDirs = getBundleRepos();
        ArtifactResolver resolver = new SimpleMavenResolver(bundleDirs);

        // Start up the OSGI framework
        ClassLoader classLoader = createClassLoader(resolver);
        FrameworkFactory factory = loadFrameworkFactory(classLoader);
        framework = factory.newFramework(new StringMap(config.props, false));
        framework.init();
        framework.getBundleContext().addFrameworkListener(lockCallback);
        framework.start();

        FrameworkStartLevel sl = framework.adapt(FrameworkStartLevel.class);
View Full Code Here

            InputStream is = classLoader.getResourceAsStream("META-INF/services/" + FrameworkFactory.class.getName());
            BufferedReader br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
            factoryClass = br.readLine();
            br.close();
        }
        FrameworkFactory factory = (FrameworkFactory) classLoader.loadClass(factoryClass).newInstance();
        return factory;
    }
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);
    }
View Full Code Here

            InputStream is = classLoader.getResourceAsStream("META-INF/services/" + FrameworkFactory.class.getName());
            BufferedReader br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
            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

        try
        {
            double startedNanoseconds = System.nanoTime(); // **** CHANGE FROM ORIGINAL FELIX VERSION ****
            // Create an instance of the framework.
            FrameworkFactory factory = getFrameworkFactory();
            m_fwk = factory.newFramework(configProps);
            // Initialize the framework, but don't start it yet.
            m_fwk.init();
            // Use the system bundle context to process the auto-deploy
            // and auto-install/auto-start properties.
            AutoProcessor.process(configProps, m_fwk.getBundleContext());
View Full Code Here

    }
  }

  Framework createAndRunFramework(Properties config) {
    ServiceFinder<FrameworkFactory> finder = ServiceFinder.create(FrameworkFactory.class, Main.class.getClassLoader());
    FrameworkFactory fwkFactory = finder.loadOneInstance();
    if (fwkFactory == null) {
      logger.severe("No FrameworkFactory service providers available.");
      return null;
    }

    Framework framework = fwkFactory.newFramework(config);
    logger.info("Created framework");
    try {
      framework.start();
      logger.info("Started framework");
    } catch (BundleException e) {
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);
    }
View Full Code Here

TOP

Related Classes of org.osgi.framework.launch.FrameworkFactory

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.