Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Embedding Equinox

Revision as of 17:17, 9 May 2015 by Bimargulies.gmail.com (Talk | contribs) (Bimargulies.gmail.com moved page Embedding to Embedding Equinox: Fix title)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Equinox supposed the standard SPI mechanism to embed the framework in a larger application. You put the framework jar in your classpath, and proceed as follows:


      // Obtain a framework factory.
       ServiceLoader<FrameworkFactory> loader = ServiceLoader.load(FrameworkFactory.class);
       FrameworkFactory factory = loader.iterator().next();
       // And get a framework.
       framework = factory.newFramework(configProps);
       try {
           framework.init();
       } catch (BundleException e) {
           throw new SomeRuntimeException("Failed to initialize framework", e);
       }

Back to the top