[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [equinox-dev] Embedding Equinox Example
- From: Phil Borlin <rancidfishbreath@xxxxxxxxx>
- Date: Tue, 26 Jan 2010 16:00:53 -0700
- 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:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=xm3vLbeY23FB39VRYOgqdAiU+jiHgR1S2lSCjtWUh7WVnoWx//qnuR1HteRx1OzEE/ YTfXUz1yUqLbSabiFDl8Ti64bYP/jp4qk8DzgBdrShNscu0Zgqlp8sw9bukotS7NYAv5 jR/nm19xQODCWoWMU2xPq89zMwic5fn+Ums9Q=
On Tue, Jan 26, 2010 at 3:46 PM, Neil Bartlett <njbartlett@xxxxxxxxx> wrote:
> 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
> application's classpath.
> 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);
> Kind regards,
> On Tue, Jan 26, 2010 at 10:35 PM, Phil Borlin
> <rancidfishbreath@xxxxxxxxx> wrote:
>> 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
> equinox-dev mailing list