Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » RCP, eRCP, and OSGi best practices
RCP, eRCP, and OSGi best practices [message #106079] Tue, 11 March 2008 01:15 Go to next message
Eclipse UserFriend
Originally posted by: jconlon.apache.org

Cut my teeth on OSGi with Felix before I was seduced into porting my GUI
to an Eclipse RCP Product. I love the tooling, but Now I will be moving
parts of it to eRCP and there is even a requirement to run some of our
bundles in a headless Equinox runtime.

So I need to start moving back towards an OSGi orientation without going
to far out on my own (ironically to be more standard). Are there any
guidelines published for us Eclipse product authors that need to start
moving our code so that it will run in more standard and diverse
Eclipse/Equinox/OSGi runtimes?

Specifically:

For starters, I need to create more generic bundles. Are there any tips
for breaking the required bundle habit? (For example, when creating a
simple bundle in an Eclipse Plugin, how can I just import
org.osgi.framework instead of using required bundle to get the framework?)

There are some wrapped bundles I am using that require log4j. What is
the best practice for logging within a hybrid set of bundles that maybe
used for Eclipse RCP products, eRCP mobile apps and Equinox headless
runtimes? Is the OSGi LogService a viable choice for these environments?

thanks for any suggestions,
John
Re: RCP, eRCP, and OSGi best practices [message #106110 is a reply to message #106079] Tue, 11 March 2008 03:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ronbermejo.nospamm.com

John E. Conlon wrote:

> Specifically:

> For starters, I need to create more generic bundles. Are there any tips
> for breaking the required bundle habit? (For example, when creating a
> simple bundle in an Eclipse Plugin, how can I just import
> org.osgi.framework instead of using required bundle to get the framework?)

Hi,

As of 3.4M2 PDE introduced some neat Quickfixes to help in this regard.
http://download.eclipse.org/eclipse/downloads/drops/S-3.4M2- 200709210919/eclipse-news-M2.html

Another possible solution for this would be to use the bnd tool:
http://www.aqute.biz/Code/Bnd

Hth!
Ron
Re: RCP, eRCP, and OSGi best practices [message #106138 is a reply to message #106110] Tue, 11 March 2008 14:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jconlon.apache.org

Hi Ron,

The Quickfix addition to 3.4 is nice, but it doesn't appear to give me
anything I can't already do manually. I already export my packages and
use imports when I can with the current 3.3.

The most simple question in regard to creating cleaner bundles:

Is there a way when building an RCP application in the Eclipse PDE to
import the package org.osgi.framework so I can build a simple bundle
with out resorting to require bundle?

kind regards,
John

Ron Bermejo wrote:
> John E. Conlon wrote:
>
>> Specifically:
>
>> For starters, I need to create more generic bundles. Are there any
>> tips for breaking the required bundle habit? (For example, when
>> creating a simple bundle in an Eclipse Plugin, how can I just import
>> org.osgi.framework instead of using required bundle to get the
>> framework?)
>
> Hi,
>
> As of 3.4M2 PDE introduced some neat Quickfixes to help in this regard.
> http://download.eclipse.org/eclipse/downloads/drops/S-3.4M2- 200709210919/eclipse-news-M2.html
>
>
> Another possible solution for this would be to use the bnd tool:
> http://www.aqute.biz/Code/Bnd
>
> Hth!
> Ron
>
Re: RCP, eRCP, and OSGi best practices [message #106194 is a reply to message #106138] Wed, 12 March 2008 06:47 Go to previous messageGo to next message
Gunnar Wagenknecht is currently offline Gunnar WagenknechtFriend
Messages: 486
Registered: July 2009
Location: San Francisco ✈ Germany
Senior Member

John E. Conlon schrieb:
> Is there a way when building an RCP application in the Eclipse PDE to
> import the package org.osgi.framework so I can build a simple bundle
> with out resorting to require bundle?

If you look at the "Plug-in Project" wizard there is a group "Target
Platform". If you select "an OSGi framework" it will use Import-Package
instead of Require-Bundle when creating the plug-in.

After that I recommend using "Automated Management of Dependencies"
together with Import-Package (can be found on the Dependencies tab of
the Manifest editor).

-Gunnar

--
Gunnar Wagenknecht
gunnar@wagenknecht.org
http://wagenknecht.org/
Re: RCP, eRCP, and OSGi best practices [message #106278 is a reply to message #106194] Thu, 13 March 2008 01:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jconlon.apache.org

Hi Gunnar,

see inline...

Gunnar Wagenknecht wrote:
> John E. Conlon schrieb:
>> Is there a way when building an RCP application in the Eclipse PDE to
>> import the package org.osgi.framework so I can build a simple bundle
>> with out resorting to require bundle?
>
> If you look at the "Plug-in Project" wizard there is a group "Target
> Platform". If you select "an OSGi framework" it will use Import-Package
> instead of Require-Bundle when creating the plug-in.


Yep that did the trick on the importing of the framework. I've seen
that option but always considered it for only building bundles for the
Equinox framework. Looks like I can use it within my RCP products as
well when I want to create basic bundles. Can it be used for build full
fledged RCP bundles that extend workbench for views and editors etc.?


>
> After that I recommend using "Automated Management of Dependencies"
> together with Import-Package (can be found on the Dependencies tab of
> the Manifest editor).
>
> -Gunnar
>
This too I've seen but have not used. Can I use it to convert from
Require-Bundle to import and have it convert my manifests?

thanks for pointing me in the right direction,

John
Re: RCP, eRCP, and OSGi best practices [message #106385 is a reply to message #106278] Sat, 15 March 2008 05:04 Go to previous message
Gunnar Wagenknecht is currently offline Gunnar WagenknechtFriend
Messages: 486
Registered: July 2009
Location: San Francisco ✈ Germany
Senior Member

John E. Conlon schrieb:
> Can it be used for build full
> fledged RCP bundles that extend workbench for views and editors etc.?

Yes. From Eclipse side a plug-in is just a bundle. The only problem I
run into (with 3.3) is that PDE does not offer you all extension points
if you use Import-Package instead of Require-Bundle. However, that's
just a tooling problem and does not affect runtime.

>> After that I recommend using "Automated Management of Dependencies"
>> together with Import-Package (can be found on the Dependencies tab of
>> the Manifest editor).

> This too I've seen but have not used. Can I use it to convert from
> Require-Bundle to import and have it convert my manifests?

Let's say it that way ... it helps with "Import-Package" if you don't
know which packages you need. You simple select the bundles to be added
to the classpath. Later on, you invoke the "Organize Manifest" action
and PDE adds all the necessary "Import-Package" entries for you.

-Gunnar

--
Gunnar Wagenknecht
gunnar@wagenknecht.org
http://wagenknecht.org/
Previous Topic:log4j Unexpected Result
Next Topic:ClassLoader issue: Loading classes of other bundles
Goto Forum:
  


Current Time: Tue Oct 26 06:45:17 GMT 2021

Powered by FUDForum. Page generated in 0.02150 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top