[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [equinox-dev] Embedding Equinox Example
- From: Neil Bartlett <njbartlett@xxxxxxxxx>
- Date: Tue, 26 Jan 2010 22:46:31 +0000
- Delivered-to: firstname.lastname@example.org
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=rbZDfMyzCuCmjrkYeG5P47TFhuTG9kVWCqNp5XWSBVN5t07LAKNLlGj8Emqa3bHNRs yqAlkJoIU8yjhl81Pc82xVHXwXOLc+flkj+voszthqtZ3gUlYV33ZAt6Q09yD4pQzhiO dsA4nzeBc5sMOGmrtYogfNJzD02g+DuuMcP3s=
Why so complicated??
Craig: to launch either Felix 2.0 or Equinox 3.5 (and probably
Knopflerfish, not sure which versions though) embedded within a larger
Java application, you can simply use the new launching API included in
OSGi R4.2... see section 6.2 of the Core specification. Assuming you
are running on Java6, this allows you to choose the framework
implementation simply by putting the relevant JAR on your
You asked for code so here it is:
FrameworkFactory factory = ServiceLoader.load(FrameworkFactory.class);
Map config = new HashMap();
// Add some config properties to the map, if required
Framework framework = factory.newFramework(config);
On Tue, Jan 26, 2010 at 10:35 PM, Phil Borlin
> Probably the easiest way is to download the Eclipse SDK if you don't
> have it already.
> In the menu go to File -> New -> Project.
> Select Plug-in Project and click next.
> Name it something like com.yourdomain.test (or whatever) and click next
> Make sure "This plug-in will make contributions to the UI" is unchecked.
> Make sure you click the "Yes" radio button next to "Would you like to
> create a rich client application"
> Click Next
> Select the "Headless Hello RCP" template and click Finish.
> This will create two classes:
> Application and Activator. ÂThere is plenty of documentation on what
> you can do with the Activator so I won't go into it. ÂOpen up the
> Application class and treat the start method as you would a main
> method in a traditional Java program. ÂFor example you can set up your
> JFrame here or whatever you want.
> Next take a look at your MANIFEST.MF file. ÂEclipse provides a nice UI
> to edit this or you can go straight to the MANIFEST.MF tab and hand
> edit it.
> Lastly go to the Overview tab of the MANIFEST.MF file and look for the
> section entitled "Testing". ÂThere are hyperlinks to run or debug your
> That's it. ÂThe platform takes care of initializing osgi and loading
> bundles for you and you are now free to add your own bundles.
> On Tue, Jan 26, 2010 at 2:32 PM, Â<craig@xxxxxxxxxxxxxxxxx> wrote:
>> Sorry if this is not the right place for this question, I could not find
>> an equinox-users mailing list.
>> I have a Swing based application that is able to be extended via a plugin
>> model and we would like to improve this ability by basing it upon OSGI.
>> I have implemented a POC of this using Apache Felix, based on the
>> instructions on this page:
>> Now I would like to try the POC using Equinox so we can compare and
>> contrast so we can pick one to move forward with.
>> However, I am having trouble finding any documentation similar to the
>> Felix page I mentioned above. Basically I am looking for an in-code
>> example (not a command-line example) of how to instantiate an OSGI
>> Framework based on Equinox.
>> Does anyone know of any documentation or a code example that shows this
>> for a simple use case?
>> Thanks in advance.
>> Craig S. Dickson
>> equinox-dev mailing list
> equinox-dev mailing list